ATMega4809 on a breadboard...almost!

Hi all-

I'm setting up an ATMega4809 on a breadboard by following this excellent tutorial. So far I have added the MegaCoreX and Arduino megaAVR boards to the Arduino IDE and downloaded the Optiboot bootloader to the '4809 by setting up an Uno as a UPDI programmer. I'm seeing a twice-blinking LED on pin 7 so I believe the bootloader is operational. So far so good.

I'm attempting to use an FTDI Basic to talk to the chip, but I'm running into the following gotcha:

  • if I choose ATMega4809 under 'Tools/Board/MegaCoreX' the code won't compile. (Basic blink program. The error I get is 'Error compiling for board ATmega4809')

  • if I choose 'Arduino Uno WiFi Rev2' it will compile (that board uses a 4809 too) but then it cannot communicate with the bootloader. Apparently this is not supported by this particular board.

Search as I might I have been unable to find any posts concerning this situation. I could of course just program it via UPDI, but I'd really like to be able to use the serial monitor in the IDE.

Can anyone shed any light on what I am missing?


  • if I choose ATMega4809 under ‘Tools/Board/MegaCoreX’ the code won’t compile. (Basic blink program. The error I get is ‘Error compiling for board ATmega4809’)

Can you attempt to get a more descriptive error message by changing your preferences in the IDE ?

That’s a good idea…I completely forgot about that! The whole thing is too big to be included in the body of this post, so I’ll attach the file. I’ll put the last part in here because it look like the problem is with the last step of linking. It fails because for some reason the line begins with ‘cmd’ rather than a full path. Not sure how that’s the case, or what the solution is…!

Compiling libraries...

Compiling core...

Using precompiled core: C:\Users\pferrick\AppData\Local\Temp\arduino_cache_349971\core\core_8af70896c6b072252fd1bb0005ecfce0.a

Linking everything together...

"C:\\Users\\pferrick\\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 -Wl,--section-start=.text=0x200 -mmcu=atmega4809 -o "C:\\Users\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456/34_blink.ino.elf" "C:\\Users\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456\\sketch\\34_blink.ino.cpp.o" "C:\\Users\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456/..\\arduino_cache_349971\\core\\core_8af70896c6b072252fd1bb0005ecfce0.a" "-LC:\\Users\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456" -lm

"C:\\Users\\pferrick\\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\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456/34_blink.ino.elf" "C:\\Users\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456/34_blink.ino.eep"

"C:\\Users\\pferrick\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456/34_blink.ino.elf" "C:\\Users\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456/34_blink.ino.hex"

cmd /C "C:\\Users\\pferrick\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objdump" --disassemble --source --line-numbers --demangle --section=.text "C:\\Users\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456/34_blink.ino.elf" > "C:\\Users\\pferrick\\AppData\\Local\\Temp\\arduino_build_853456/34_blink.ino.lst"

exec: "cmd": executable file not found in %PATH%

Error compiling for board ATmega4809.


error_output.txt (9.01 KB)

Replying to myself....

A quick search for 'exec: "cmd": executable file not found in %PATH%' shows that others have had this issue. Hopefully after sifting through the posts on this subject I will uncover the problem.

If anyone has a quick solution right off the top of their head, that's great too!


Well, I got it to work by backing off from version 1.04 of MegaCoreX to version 1.03. Maybe there's a typo in there somewhere? Anyway, I'm happily uploading code to my '4809 now.

Thanks everyone.