Arduino compile to .bin?

Post here first, or if you can't find a relevant section!
Post Reply
arpruss
Posts: 83
Joined: Sat Dec 21, 2019 10:06 pm

Arduino compile to .bin?

Post by arpruss »

Is there a way to get the Arduino IDE with Roger's core compile to a .bin file that could be uploaded to a device by a user using the STM Demonstrator, without bothering with a bootloader?
.rpv
Posts: 43
Joined: Wed Dec 18, 2019 10:19 pm

Re: Arduino compile to .bin?

Post by .rpv »

Using stlink on arduino ide doesn't need bootloader, serial or messing with the boot pins.

But also, arduino ide creates a .bin file when compiles, it saves it on the OS temp folder, just check your compile resume log, it says something about an .ino.elf file, on the same folder it leaves the .bin file.

Look for something like:

"C:\\Users\\<USERNAME>\\AppData\\Local\\Arduino15\\packages\\STM32\\tools\\xpack-arm-none-eabi-gcc\\9.2.1-1.1/bin/arm-none-eabi-size" -A "C:\\Users\\<USERNAME>\\AppData\\Local\\Temp\\arduino_build_239137/sketch.ino.elf"
hobbya
Posts: 49
Joined: Thu Dec 19, 2019 3:27 pm
Answers: 1

Re: Arduino compile to .bin?

Post by hobbya »

Does the demonstrator accept hex files?
You can compile to hex file using "Ctrl+Alt+S" or "Export Complied Binary" under the Sketch menu.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Arduino compile to .bin?

Post by mrburnette »

Argh....

Usually the talk about binary files lead to talk about HEX and the file format. Here is a link to a reference regarding the Intel format:
http://www.keil.com/support/docs/1584/

You can also google and download the ancient Intel pdf doc.


Ray
arpruss
Posts: 83
Joined: Sat Dec 21, 2019 10:06 pm

Re: Arduino compile to .bin?

Post by arpruss »

In case anybody wants to distribute binaries of a sketch, here's the trick. Set the upload method to Serial. Compile. You will get a .bin file in the temp directory (if you want to see which directory that is, turn on verbose compilation in Arduino). This .bin file can be uploaded by the user using the Demonstrator.

When I've been giving instructions (e.g., in my Instructables projects) for uploading sketches, previously I was telling users to install a bootloader with the Demonstrator, then install the Arduino environment, and then finally use Arduino to compile and install the sketch. But now I see that giving people a .bin file lets them skip a lot of the steps.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Arduino compile to .bin?

Post by ag123 »

in the Arduino preferences

there is actually a parameter for the build path
https://github.com/arduino/Arduino/blob ... es.txt#L56

Code: Select all

# temporary build path, normally this goes into the default
# "temp" folder for that platform (as defined by java)
# but this can be used to set a specific file in case of problems
#build.path=build
you can change that to a fixed build location, so that the build objects and binaries would be deposited in that path instead of a temp folder.
Post Reply

Return to “General discussion”