cdc_acm: usb 1-1.1.2: Product: Arduino Leonardo
[22703.481710] usb 1-1.1.2: Manufacturer: Arduino LLC
[22703.482841] cdc_acm 1-1.1.2:1.0: ttyACM0: USB ACM device
[22710.982560] usb 1-1.1.2: USB disconnect, device number 14
You need to use a ISP programmer. The bootloader will not write to the fuses or the eeprom and it will not overwrite itself. See the example sketch ArduinoISP for how to use another Arduino as an ISP programmer.
jski3:
It appears that both flash and eeprom memory are written to?
The Arduino bootloader will often just report "SUCCESS!" for any command that it does not understand. Include the "verify" option (-v ?) in your command line to see if you can read back the data you wrote.
For a long time I was getting a verify error when using the Arduino ISP sketch to load fresh firmware into a ATmega328p. The problem was that when avrdude connected to the Arduino running Arduino ISP it reset that Arduino and suddenly I was talking to that Arduino's bootloader instead of the Arduino ISP sketch. They speak the same STK500V1 protocol. The bootloader was happy to report "SUCCESS!" for commands it didn't understand and when avrdude asked it to read back the fuses it read back the current fuses which did NOT match the value that the bootloader had just reported successfully setting!
jski3:
Do I need to write to efuse, lfuse, and/or hfuse to load amforth?
What do the amforth instructions say about that?
jski3:
Is the bootloader on the Leonardo board overwritten by amforth?
Not with the avrdude command you're currently using.
jski3:
It appears that both flash and eeprom memory are written to?
I believe so. The bootloader on the Leonardo does support writing to EEPROM.
johnwasser:
Include the "verify" option (-v ?) in your command line to see if you can read back the data you wrote.
-v is verbose output (add more -v for more verbosity). Verification is on by default, but jski3 has disabled it in their avrdude command by passing the -V option (combined with the -D option as -DV). @jski3 if you want to enable verification, you should use this command:
Just giving in and using C++ has to be starting to look a lot more appealing at this point. I'm sure you will be able to get Forth going with enough perseverance though!
The Amforth binary uses the bootloader space. You need to use an ISP programmer to upload this. The bootloader cannot overwrite itself. You need to set the fuses as Amforth advises.