0

I'm currently designing a Raspberry pi HAT. A HAT need to have an eeprom memory on it with several information. This memory is read at boot time of the Raspberry pi. My question is the following:

  • Can I read this memory at another moments than the boot time ? (for example when I run my software)
  • If yes, how can I do this?
  • Is that possible to add another information (like string value jsut for my software and not for the boot time) in the memory and read it at another moment ?

Thanks in advance!

0

The HAT spec basically calls for the EEPROM to be an I2C device slaved on address 0x50 (which is more-or-less an industry default). At boot time, the device tree layout and other stuff is read from that EEPROM, and the recommendation is to leave those pins alone. So there shouldn't be any problem accessing that EEPROM anytime you like (it's just a slave I2C device).

So your choices boil down to:

  1. Embed your custom data in a manufacturer custom data atom in the HAT's EEPROM format (note there are tools linked there to read/write flashes from 4kbyte up to 128kbyte so you can just get a bigger one, to a point). Or...
  2. Put your data in after the HAT atoms, basically hiding it after the formatted bits. The HAT spec doesn't require that the atoms fill the flash, so most HATs will have unused space after the formatted part. Or...
  3. Slave in another I2C flash just for your data on a different address. If it changes often, this might not be a bad idea to reduce the risk of bricking your board. Or...
  4. Do something else entirely and don't mess with the I2C. :-)

Make sure to have a look at the flash script to see what they do with dtoverlay to get access to the I2C; you might need that if the system is in an unfriendly state.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.