====== Rpi3 Eeprom Flash ======
===== Objectif =====
Lecture ecriture d'eeprom SOP8 avec l'utilitaire flashrom sur rpi3.
===== Raccordement Interface SPI =====
Source : [[https://wiki.gentoo.org/wiki/User:Sakaki/Sakaki%27s_EFI_Install_Guide/Disabling_the_Intel_Management_Engine|https://wiki.gentoo.org/wiki/User:Sakaki/Sakaki%27s_EFI_Install_Guide/Disabling_the_Intel_Management_Engine]]
==== Pin Mapping ====
|{{:electronique:numerique:eeprom_flash:rpi_gpio_header_ic_flash.png?nolink&570x450}}|{{:electronique:numerique:eeprom_flash:flash_8_pinout.png?nolink&386x232}}|
==== Pin functions ====
^IC Pin^IC Name^Wire Colour^RPi3/4 Pin^RPi3/4 Name^Function|
|1|/CS|White|24|SPI_CE0_N|Chip select; drive low to enable device|
|2|DO|Grey|21|SPI_MISO|Standard SPI data output (from chip)|
|3|/WP|Blue|16|GPIO23 / GPIO_GEN4|Write protect; drive high to enable status registers to be written|
|4|GND|Black|25|Ground|Ground|
|5|DI|Orange|19|SPI_MOSI|Standard SPI data input (to chip)|
|6|CLK|Yellow|23|SPI_CLK|SPI clock|
|7|/HOLD|Green|18|GPIO24 / GPI_GEN5|Hold; drive low to pause device while actively selected|
|8|VCC|Red|17|3.3v|Power supply (NB do //not// use 5v)|
===== Breadboard =====
S'équiper en support zif sop8 150mil et 200mil
{{:electronique:numerique:eeprom_flash:rpi_gpio_flash_breadboard.jpg?nolink&500x381|rpi_gpio_flash_breadboard.jpg}}
===== R/W eeprom =====
==== Flashrom ====
\\
Package apt-get install falshrom sur raspbian.
Penser à activer l'interface spi via l'interface raspi-config\\
=== Read ===
flashrom --programmer linux_spi:dev=/dev/spidev0.0,spispeed=1000 --read dump.bin
\\
Toujours dumper 2 ou 3 fois et comparer les md5sum\\
=== Write ===
flashrom --programmer linux_spi:dev=/dev/spidev0.0,spispeed=1000 --write dump.bin
Plus d'infos sur le site de flashrom : [[https://www.flashrom.org/RaspberryPi|https://www.flashrom.org/RaspberryPi]]
==== Comparer 2 dumps ====
vimdiff -y <(xxd bios_locked.bin) <(xxd bios_unlocked.bin)