bloombloombloom / Bloom

A debug interface for AVR-based embedded systems development on GNU/Linux.
https://bloom.oscillate.io/
Other
64 stars 3 forks source link

Support EEPROM access via GDB #58

Closed navnavnav closed 1 year ago

navnavnav commented 1 year ago

Looking at GDB's source code, it doesn't appear to support the addressing of EEPROM, for AVR targets. Because of this, it was assumed that GDB lacked support for EEPROM access on AVR targets.

Currently, Bloom users cannot use GDB's load command when loading an ELF that includes an .eeprom section.

However, EEPROM addresses are, in fact, offset by 0x00810000 in the GCC toolchain. GDB will use this same offset when addressing EEPROM. This means Bloom can support EEPROM access via GDB.

To do this, we need to adjust the length of the "ram" section in the memory map, to accommodate the target's EEPROM capacity (with the 0x00810000 offset in mind). Then, GDB will send us memory access packets for EEPROM, as it does for RAM and FLASH, from which the memory type can be resolved.

With this change, I'm hoping GDB will be able to update EEPROM as well as FLASH, when uploading the program via GDB's load command.

Looking to get this into v0.12.0.

navnavnav commented 1 year ago

Quick update on this:

Have made good progress. EEPROM access via GDB works for PDI and debugWire targets. I can now load ELFs with EEPROM sections without issue.

Still need to test JTAG and UPDI targets.

navnavnav commented 1 year ago

Development work for this is complete.

(gdb) monitor eeprom fill --value=aabbcc
Filled 1024 bytes of EEPROM, with values: aabbccaabbccaabbccaabbccaabbccaabbcc ...
(gdb)

These changes are already in the develop branch and will be included in v0.12.0.

Will be a while before I publish v0.12.0 - lots to do.

Closing this now.