Unable to get the 328 which I usually use for my projects, I am moving to the 4808 version atmega.
Up to now I have installed MegaCoreX in the arduino IDE, uploaded a bootloader via jtag2updi installed on a nano using the UPDI pins on the 4808.
Then I have programmed the 4808 using a FTDI link via platformio (full normal stuff)
However, having to add both UPDI and FTDE headers takes some space up, for little advantage, as you can program etc via UPDI alone. Indeed, if I knock up a simple 4808 with UPDI on the UPDI pin and FTDE on pins PF6(via 100nf cap to rst), PC0 and PC1 to Tx/Rx. then just a couple of 100nf on the supply and an LED on the built-in-LED pin PA7; I can then program this via the above method, or by just uploading say blink via jtag2updi in the arduino IDE.
But, I usually use platformio to develop code, when I try to use the same nano with jtag2updi via Platformio although it appears to work (see dialogue below) nothing appears to work on the 4808 - load blink via FTDE - 4808 happily blinks, use UPDI and the built-in-LED just stays illuminated. (There is a warning about not having flash or boot - but it continues and gives success)
Try any other program, build in platformio, load via FTDE - all good, load via UPDI - no go just the illuminated LED
Transfer the code to arduino IDE, it builds and uploads correctly via UPDI
Any suggestions on fixing this?
Output dialogue following build:
Configuring upload protocol…
AVAILABLE: jtag2updi
CURRENT: upload_protocol = jtag2updi
Looking for upload port…
Auto-detected: COM7
Uploading .pio\build\ATmega4808\firmware.hex
avrdude: jtagmkII_initialize(): Cannot locate “flash” and “boot” memories in description
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.15s
avrdude: Device signature = 0x1e9650 (probably m4808)
avrdude: NOTE: “flash” memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file “.pio\build\ATmega4808\firmware.hex”
avrdude: writing flash (780 bytes):
Writing | ################################################## | 100% 0.23s
avrdude: 780 bytes of flash written
avrdude: verifying flash memory against .pio\build\ATmega4808\firmware.hex:
avrdude: load data flash data from input file .pio\build\ATmega4808\firmware.hex:
avrdude: input file .pio\build\ATmega4808\firmware.hex contains 780 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.16s
avrdude: verifying …
avrdude: 780 bytes of flash verified
avrdude: safemode: Fuses OK (E:FF, H:FF, L:FF)
avrdude done. Thank you.
============================== [SUCCESS] Took 3.37 seconds ==============================
- Terminal will be reused by tasks, press any key to close it.
the ini file is just:
[env:ATmega4808]
platform = atmelmegaavr
board = ATmega4808
framework = arduino
; upload_protocol= arduino
(I un-comment the last line when using FTDE)