-
Notifications
You must be signed in to change notification settings - Fork 248
Description
Unable to write 0xFF to the eeprom on atmega32p.
I was attempting to save some configurations onto eeprom that loads on boot so I can keep a callibration.
Serializing with hubpack. I noticed that the negative numbers were not reloading correctly.
Overwriting with an 0xFF left the cell unchanged, so i16's were wrong.
After chasing through the hal and the I found the folowing code.
avr-hal/avr-hal-generic/src/eeprom.rs
Line 167 in d191b57
| fn raw_write_byte(&mut self, address: u16, data: u8) { |
when the byte is FF is does not appear to write correctly.
I took out the 'if' with a bare write
and it worked for write but the erase function is borked.
I have tried this on other boards same result, so I think it's a bug.
I am running
- rustc 1.70.0-nightly (5e1d3299a 2023-03-31)
- promini
- ubuntu
Simplified example:
https://github.com/zignig/steves_brain/tree/main/scraps/eepromtest
There appears to be a bit overwrite strategy for eeprom , I am reading the AVR documentation to grok it.