PiSupply / PiJuice

Resources for PiJuice HAT for Raspberry Pi - use your Pi Anywhere
https://uk.pi-supply.com/collections/pijuice/products/pijuice-portable-power-raspberry-pi
GNU General Public License v3.0
438 stars 104 forks source link

eeprom_erase_error while upgrading to 1.5 #690

Open Jamos1988 opened 3 years ago

Jamos1988 commented 3 years ago

Tried upgrading from GUI, then got this error: eeprom_erase_error Was from 1.4 to 1.5, but it failed and now there is communication error. After rebooting the battery icon in the taskbar is gone. And now when scanning for the i2c, it is gone. Can't do anything with it anymore.

mmilann commented 3 years ago

Problem with bulk erase is that it clears configuration and calibration parameters that starts from address 0x0803BC00. So pijuiceboot erases only necessary pages in code segment.

thesteg commented 3 years ago

Yes, absolutely... So if you save the emulated eeprom contents before the bulk erase, program the main binary then rewrite the eeprom section it seems to work much more consistently than the block erase.

Not sure how to link but try flash.sh from my forked repo.

mmilann commented 3 years ago

This is interesting idea regarding that some people need to burn multiple pijuice units with same configuration, so option to dump configuration flash part to file or download it from file would be desirable PiJuice software feature.

I suggest that it can be part of pijuiceboot.py script.

Here are some additional options, if you are python developer you are welcome to contribute: --bulk_erase. Will do this suggestion. --dump_config [path to file]. Calibration area should be skipped because it is specific to pijuice sample and differ from unit to unit. --load_config [path to file]. Will program only configuration memory. This can be read modify write approach in order to preserve calibration area, and fill new config area from file.

thesteg commented 3 years ago

I'll have a think on the extra bits, I'm in the depths of the SOC estimation atm, it'll be a while.

It'd actually be nice to be able to restore my calibration data, I've totally scrambled it on my units so I have no reference any more.

I do wonder if the bootloader is doing something funny though, there is no reason why the block erase should fail but I do know it behaves differently if the first page is erased and a reset occurs. I don't really have the time to look at it right now.

mmilann commented 3 years ago

You can re-calibrate running pijuice_calib.py script. Separate PiJuice from Rpi and connect only I2C lines plus GND (by wires) and attach 100 Ohm resistor between PiJuice 5V GPIO and GND then run script.