Go Down

Topic: Export compiled Binary produces 2 .hex files but no .bin file? (Read 1 time) previous topic - next topic

2n3904

I'm trying to do a Sketch > Export compiled Binary on Arduino IDE 1.8.5 but i only get 2 .hex files without the .bin file in the sketch folder. How do I generate the .bin file?

Output:
Code: [Select]

D:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Arduino\hardware -hardware C:\Users\gio\AppData\Local\Arduino15\packages -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -tools C:\Users\gio\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino\libraries -libraries D:\Arduino\MY_SKETCHES\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path C:\Users\gio\AppData\Local\Temp\arduino_build_665589 -warnings=default -build-cache C:\Users\gio\AppData\Local\Temp\arduino_cache_603271 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.arduinoOTA.path=D:\Arduino\hardware\tools\avr -verbose C:\Users\gio\Desktop\Blink\Blink.ino
D:\Arduino\arduino-builder -compile -logger=machine -hardware D:\Arduino\hardware -hardware C:\Users\gio\AppData\Local\Arduino15\packages -tools D:\Arduino\tools-builder -tools D:\Arduino\hardware\tools\avr -tools C:\Users\gio\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino\libraries -libraries D:\Arduino\MY_SKETCHES\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path C:\Users\gio\AppData\Local\Temp\arduino_build_665589 -warnings=default -build-cache C:\Users\gio\AppData\Local\Temp\arduino_cache_603271 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.arduinoOTA.path=D:\Arduino\hardware\tools\avr -verbose C:\Users\gio\Desktop\Blink\Blink.ino
Using board 'uno' from platform in folder: D:\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: D:\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\gio\AppData\Local\Temp\arduino_build_665589\sketch\Blink.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\gio\AppData\Local\Temp\arduino_build_665589\sketch\Blink.ino.cpp" -o "C:\Users\gio\AppData\Local\Temp\arduino_build_665589\preproc\ctags_target_for_gcc_minus_e.cpp"
"D:\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\gio\AppData\Local\Temp\arduino_build_665589\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-ID:\Arduino\hardware\arduino\avr\cores\arduino" "-ID:\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\gio\AppData\Local\Temp\arduino_build_665589\sketch\Blink.ino.cpp" -o "C:\Users\gio\AppData\Local\Temp\arduino_build_665589\sketch\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-gcc"  -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "C:\Users\gio\AppData\Local\Temp\arduino_build_665589/Blink.ino.elf" "C:\Users\gio\AppData\Local\Temp\arduino_build_665589\sketch\Blink.ino.cpp.o" "C:\Users\gio\AppData\Local\Temp\arduino_build_665589/..\arduino_cache_603271\core\core_arduino_avr_uno_fd040c28ca717db04400ddff4ecd4334.a" "-LC:\Users\gio\AppData\Local\Temp\arduino_build_665589" -lm
"C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "C:\Users\gio\AppData\Local\Temp\arduino_build_665589/Blink.ino.elf" "C:\Users\gio\AppData\Local\Temp\arduino_build_665589/Blink.ino.eep"
"C:\Users\gio\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -R .eeprom  "C:\Users\gio\AppData\Local\Temp\arduino_build_665589/Blink.ino.elf" "C:\Users\gio\AppData\Local\Temp\arduino_build_665589/Blink.ino.hex"
Sketch uses 928 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

Juraj

AVR uses hex file for upload

DrAzzy

That's correct. Normally one uses .hex (Intel hex) format for compiled code on avrs.

There are many converters to turn .hex into .bin if you for some weird reason need a .bin (Google: Intel hex to bin) But you probably don't actually want a .bin!
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

2n3904

Yes i know that Arduino uses .hex file to upload to a board but i need the .bin file too for other purpose. Is it not what the Export compiled Binary supposed to do?

Budvar10

Look for hex2bin on google.

The avr-objcopy do this for you also:
avr-objcopy -I ihex Blink.cpp.hex -O binary Blink.cpp.bin
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Juraj

Yes i know that Arduino uses .hex file to upload to a board but i need the .bin file too for other purpose. Is it not what the Export compiled Binary supposed to do?
no. it will output what it uses for next step.
you can change the output with a flag in boards.txt. for example
uno.build.preferred_out_format=bin

2n3904

Look for hex2bin on google.

The avr-objcopy do this for you also:
avr-objcopy -I ihex Blink.cpp.hex -O binary Blink.cpp.bin
Thanks! The hex2bin works.

Juraj


2n3904

Im trying to customize a bootloader to include sdcard loading functionality but the library im looking at needs it in binary.

Juraj

Im trying to customize a bootloader to include sdcard loading functionality but the library im looking at needs it in binary.
the samd boards have SDU (SD Update), but AVR can't run code in RAM so that will be tricky

DrAzzy

Neat project. Let me know how it goes - thats one of very few reasons i can imagine to want a .bin of a compiled sketch.

the samd boards have SDU (SD Update), but AVR can't run code in RAM so that will be tricky
Unsure how this is relevant? Hes not trying to run code from ram, just have the bootloader copy a compiled binary from sd card to flash.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Juraj

Neat project. Let me know how it goes - thats one of very few reasons i can imagine to want a .bin of a compiled sketch.

Unsure how this is relevant? Hes not trying to run code from ram, just have the bootloader copy a compiled binary from sd card to flash.
Yes. I was thinning in the samd way.

Ariadne bootloader to upload over Ethernet W5x00 exists.
Why bootloader for SD card wasn't made long time ago?

Go Up