Christoph1985
Posts: 66
Joined: Sat Jul 28, 2012 11:58 am
Location: Germany

Defining GPIO state with EEPROM

Thu Feb 26, 2015 5:55 pm

Hello,

I finally get to work the access to an EEPROM on i2c-0.
Since I plan to create my own HAT, I try to setup my GPIOs via the EEPROM.

To start, I used the template from the RPi-Prototype-HAT by Watterott.

I managed to flash the EEPROM and also read the content back to a file.
I also changed a GPIO value of GPIO 23 from input to output and flashed it back to the EEPROM.
For my understanding, after the next reboot, GPIO 23 should be set as an output.
Is there anything else to do?

My EEPROM-dump of the actual content looks like this:

Code: Select all

# ---------- Dump generated by eepdump handling format version 0x01 ----------
#
# --Header--
# signature=0x69502d52
# version=0x01
# reserved=0
# numatoms=2
# eeplen=117
# ----------


# Start of atom #0 of type 0x0001 and length 57
# Vendor info
product_uuid 14dd9866-bd62-40c9-90cb-b30250e9c168
product_id 0x0002
product_ver 0x0001
vendor "Watterott electronic"   # length=20
product "RPi-Proto-HAT"   # length=13
# End of atom. CRC16=0x8840


# Start of atom #1 of type 0x0002 and length 32
# GPIO map info
gpio_drive 0
gpio_slew 0
gpio_hysteresis 0
back_power 0
#        GPIO  FUNCTION  PULL
#        ----  --------  ----
setgpio  23      OUTPUT     DEFAULT
# End of atom. CRC16=0x70d1
By the chance I would like to understand some additional options:

- What does product_uuid, product_id and product_ver depends on? The EEPROM type? Where do I get ne necessary information?

- When dumping an .eep file to a textfile with eepdump, it will always end ind "EOF-Error":

Code: Select all

Warning: Dump finished before EOF
Warning: EOF does not match length specified in header
Can anyone help on all or at least a few of my questions?
I think there is not much information to find at the moment for programming you own HAT-EEPROMs.

Thanks in advance.

P.S. I use the 24C32WP EEPROM from ST.
elektronx.de

Christoph1985
Posts: 66
Joined: Sat Jul 28, 2012 11:58 am
Location: Germany

Re: Defining GPIO state with EEPROM

Tue Mar 10, 2015 11:37 am

It isn`t that easy as I thought, right? :-(
elektronx.de

Christoph1985
Posts: 66
Joined: Sat Jul 28, 2012 11:58 am
Location: Germany

Re: Defining GPIO state with EEPROM

Mon May 11, 2015 5:34 pm

I am really wondering if it is already possible, to load the GPIO-Settings in the EEPROM on startup.

I haven`t found any information about using it in reality ;-)
Are there any information how to set up the Pi to use it or is there still something missing?


Thanks :-)
elektronx.de

Return to “HATs and other add-ons”