Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Export Compiled Binary' Not working for ATMEGA32u4 boards #2620

Open
3 tasks done
Carter3DP opened this issue Jan 27, 2025 · 1 comment
Open
3 tasks done

'Export Compiled Binary' Not working for ATMEGA32u4 boards #2620

Carter3DP opened this issue Jan 27, 2025 · 1 comment
Labels
type: imperfection Perceived defect in any part of project

Comments

@Carter3DP
Copy link

Carter3DP commented Jan 27, 2025

Describe the problem

When using the 'Export compiled binary' option to get binaries for a selected sketch, the binary with both the program and the bootloader, labeled sketch.ino.with_bootloader.hex, will only contain the bootloader.

Verbose Console Output:

FQBN: arduino:avr:leonardo
Using board 'leonardo' from platform in folder: C:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...
C:\Users\GG\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\leonardo C:\Users\GG\AppData\Local\arduino\sketches\CEDB5789CFED8CCAFE1AEB67D28F75C3\sketch\ExtruderPSICONTROL.ino.cpp -o nul
Alternatives for functions.h: [[email protected]]
ResolveLibrary(functions.h)
  -> candidates: [[email protected]]
C:\Users\GG\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\leonardo -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\CartersFunc C:\Users\GG\AppData\Local\arduino\sketches\CEDB5789CFED8CCAFE1AEB67D28F75C3\sketch\ExtruderPSICONTROL.ino.cpp -o nul
Alternatives for SevSeg.h: [[email protected]]
ResolveLibrary(SevSeg.h)
  -> candidates: [[email protected]]
C:\Users\GG\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\leonardo -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\CartersFunc -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\SevSeg C:\Users\GG\AppData\Local\arduino\sketches\CEDB5789CFED8CCAFE1AEB67D28F75C3\sketch\ExtruderPSICONTROL.ino.cpp -o nul
Alternatives for EEPROM.h: [[email protected]]
ResolveLibrary(EEPROM.h)
  -> candidates: [[email protected]]
C:\Users\GG\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\leonardo -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\CartersFunc -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\SevSeg -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\EEPROM\src C:\Users\GG\AppData\Local\arduino\sketches\CEDB5789CFED8CCAFE1AEB67D28F75C3\sketch\ExtruderPSICONTROL.ino.cpp -o nul
C:\Users\GG\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\leonardo -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\CartersFunc -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\SevSeg -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\EEPROM\src C:\Users\GG\OneDrive\Documents\Arduino\libraries\CartersFunc\functions.cpp -o nul
C:\Users\GG\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\leonardo -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\CartersFunc -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\SevSeg -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\EEPROM\src C:\Users\GG\OneDrive\Documents\Arduino\libraries\SevSeg\SevSeg.cpp -o nul
Generating function prototypes...
C:\Users\GG\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\leonardo -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\CartersFunc -IC:\Users\GG\OneDrive\Documents\Arduino\libraries\SevSeg -IC:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\EEPROM\src C:\Users\GG\AppData\Local\arduino\sketches\CEDB5789CFED8CCAFE1AEB67D28F75C3\sketch\ExtruderPSICONTROL.ino.cpp -o C:\Users\GG\AppData\Local\Temp\2596247215\sketch_merged.cpp
C:\Users\GG\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\GG\AppData\Local\Temp\2596247215\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"Arduino Leonardo\"" "-IC:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\leonardo" "-IC:\\Users\\GG\\OneDrive\\Documents\\Arduino\\libraries\\CartersFunc" "-IC:\\Users\\GG\\OneDrive\\Documents\\Arduino\\libraries\\SevSeg" "-IC:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\EEPROM\\src" "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3\\sketch\\ExtruderPSICONTROL.ino.cpp" -o "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3\\sketch\\ExtruderPSICONTROL.ino.cpp.o"
Compiling libraries...
Compiling library "CartersFunc"
"C:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"Arduino Leonardo\"" "-IC:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\leonardo" "-IC:\\Users\\GG\\OneDrive\\Documents\\Arduino\\libraries\\CartersFunc" "-IC:\\Users\\GG\\OneDrive\\Documents\\Arduino\\libraries\\SevSeg" "-IC:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\EEPROM\\src" "C:\\Users\\GG\\OneDrive\\Documents\\Arduino\\libraries\\CartersFunc\\functions.cpp" -o "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3\\libraries\\CartersFunc\\functions.cpp.o"
Compiling library "SevSeg"
"C:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"Arduino Leonardo\"" "-IC:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\leonardo" "-IC:\\Users\\GG\\OneDrive\\Documents\\Arduino\\libraries\\CartersFunc" "-IC:\\Users\\GG\\OneDrive\\Documents\\Arduino\\libraries\\SevSeg" "-IC:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\EEPROM\\src" "C:\\Users\\GG\\OneDrive\\Documents\\Arduino\\libraries\\SevSeg\\SevSeg.cpp" -o "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3\\libraries\\SevSeg\\SevSeg.cpp.o"
Compiling library "EEPROM"
Compiling core...
Using precompiled core: C:\Users\GG\AppData\Local\arduino\cores\arduino_avr_leonardo_6422f678ae1166e036ea66191b5e59b8\core.a
Linking everything together...
"C:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega32u4 -o "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3/ExtruderPSICONTROL.ino.elf" "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3\\sketch\\ExtruderPSICONTROL.ino.cpp.o" "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3\\libraries\\CartersFunc\\functions.cpp.o" "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3\\libraries\\SevSeg\\SevSeg.cpp.o" "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3/..\\..\\cores\\arduino_avr_leonardo_6422f678ae1166e036ea66191b5e59b8\\core.a" "-LC:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3" -lm
"C:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3/ExtruderPSICONTROL.ino.elf" "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3/ExtruderPSICONTROL.ino.eep"
"C:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3/ExtruderPSICONTROL.ino.elf" "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3/ExtruderPSICONTROL.ino.hex"

Using library CartersFunc at version 1.0.0 in folder: C:\Users\GG\OneDrive\Documents\Arduino\libraries\CartersFunc 
Using library SevSeg at version 3.7.0 in folder: C:\Users\GG\OneDrive\Documents\Arduino\libraries\SevSeg 
Using library EEPROM at version 2.0 in folder: C:\Users\GG\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\EEPROM 
"C:\\Users\\GG\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\GG\\AppData\\Local\\arduino\\sketches\\CEDB5789CFED8CCAFE1AEB67D28F75C3/ExtruderPSICONTROL.ino.elf"
Sketch uses 13522 bytes (47%) of program storage space. Maximum is 28672 bytes.
Global variables use 892 bytes (34%) of dynamic memory, leaving 1668 bytes for local variables. Maximum is 2560 bytes.

Pastebins with binaries:

https://pastebin.com/gXFUiufj
https://pastebin.com/JnGzk1wU

To reproduce

1.Create sketch with anything, blank sketches will produce the same results.
2.Select a development board with a 32u4, Leonardo and Micro being the ones I found.
3.Export compiled binary.

Expected behavior

Binaries should contain code other than only the bootloader.

Arduino IDE version

2.3.4

Operating system

Windows

Operating system version

Windows 10

Additional context

Discussion: https://forum.arduino.cc/t/exporting-compiled-binary-not-exporting-sketch-properly/1346173

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@Carter3DP Carter3DP added the type: imperfection Perceived defect in any part of project label Jan 27, 2025
@Carter3DP
Copy link
Author

I have found a workaround for this issue should anyone run across this.
Grab the board manager from this forum post and insert the link into 'Board manager URLs' in the Arduino IDE preferences. Then search and install "SparkFun AVR Boards" from the built in boards manager. Select the SparkFun Pro Micro as your board and compile, and now the binary should have your program included.
Pastebin with working binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant