Page 1 of 1

Arduino compile to .bin?

Posted: Tue Apr 07, 2020 12:45 am
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?

Re: Arduino compile to .bin?

Posted: Tue Apr 07, 2020 1:06 am
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"

Re: Arduino compile to .bin?

Posted: Tue Apr 07, 2020 2:48 am
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.

Re: Arduino compile to .bin?

Posted: Tue Apr 07, 2020 7:09 pm
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

Re: Arduino compile to .bin?

Posted: Sun Jun 21, 2020 3:09 pm
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.

Re: Arduino compile to .bin?

Posted: Sun Jun 21, 2020 10:21 pm
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.