So I've been playing with the nvm controller on mega0 and xTiny chips...
Apparently you can use the "Chip Erase" command from application section code, and it will erase the entire chip. Including any bootloader that is present.
That seems a bit counter-intuitive. I would have expected the application to be unable to damage the bootloader!
Bug? Or am I missing some reason that this is intended behavior?
Flash Self-Programming test tool Cmd: dump 0x8000 16 FFFF8000: 01 C0 D6 C0 11 24 80 91 40 00 28 2F 30 E0 83 FD .⸮⸮⸮.$⸮⸮@.(/0⸮⸮⸮ Cmd: dump fuses 1280: 00 00 02 FF 00 C4 03 00 02 FF C5 FF FF FF 00 06 ...⸮.⸮...⸮⸮⸮⸮⸮.. 1290: 3D 2A 54 D4 85 48 A2 64 2D FF 86 46 94 64 F0 22 =*TԅH⸮d-⸮⸮F⸮d⸮" Cmd: nvmctrl cher // It's gone at this point. // This happens to be a curiosity nano, so I can do: WWHackintosh<4875> avrdude -pattiny3217 -ccuriositynano_updi -Pusb -Uflash:r:foo.hex:i : avrdude: Device signature = 0x1e9522 (probably t3217) avrdude: reading flash memory: Reading | ################################################## | 100% 6.14s avrdude: Flash is empty, resulting file has no contents.
I've duplicated this on an ATtiny3217 (Curiosity Nano) and an ATmega4809 (Arduino Every)
https://github.com/Optiboot/opti...