I have been trying to get SPI working so that I can use Flashrom to program a BIOS chip with Libreboot. I am using a Raspberry Pi Model B+ connected via short F-F jumper wires to a Pomona 5252 clip over the Macronix MX25L3205D chip on the motherboard. I am replicating a setup I successfully used to flash Libreboot to the same model of laptop (a ThinkPad T400) a few months ago, but something isn't working. My jumpers are connected properly for the pinout, the Pomona and chip are both making good contact and have been thoroughly cleaned with Isopropyl Alcohol, the jumper wires have been tested for continuity and resistance and there's nothing out of the ordinary with them, and spidev0.0, 0.1, and 1.0 are appearing in /dev. SPI is enabled in raspi-config, and I have set config.txt to enable the second SPI interface, just in case the problem I was having was with the first. Neither work. Flashrom reports that the chip cannot be found, while spidev-test (with MISO and MOSI bridged as specified) simply outputs its first three lines of information, before not outputting the table of hex values it is meant to. I have tried this on four versions of Rasbpian, the latest three (which span Debian 8 and Debian 9), as well as a version from 2014 which could not properly compile either of the tools I use to test due to package problems (I gave up on this version).

Just to be sure by B+ isn't dead, I have also tested this with a Model B Rev. 2, to the same results.

I think I must be misconfiguring something, somewhere on the Pi. I know this worked before, and I even flashed back the Raspbian version I used before for one of my tests, but I don't have the SD card I used then and I have no idea what could be wrong.

What is wrong with my SPI interface? This worked recently, so I think this should be fixable, but I am probably missing something.

  • Have you enabled SPI with raspi-config? We will also need to see photos of all the connections and the code/command you are using to communicate. – Steve Robillard Mar 8 '18 at 6:45
  • Yes, as I said I did enable SPI in raspi-config, and also enabled the second interface in config.txt. Unfortunately, I can't post pictures right now, but I can assure you the connections have been triple-checked and I have been trying for two days, to the point that I have the pinout of the Macronix chip memorized. I would not be concerned about the wiring side of things, pretty sure this is either software or something weird with the ThinkPad board. – DodoDude700 Mar 8 '18 at 6:56
  • You could try a simple loop back test. Connect MISO to MOSI (GPIO9/10, pins 21/19). Then sudo pigpiod then pigs spio 0 40000 0 then pigs spix 0 23 78 91 245 should respond 4 23 78 91 245. – joan Mar 8 '18 at 8:20
  • @joan That works. However, spidev_test does not. Is something wrong with spidev, somehow? – DodoDude700 Mar 9 '18 at 5:15
  • That means the SPI hardware is okay. There was a Linux driver change a year or so ago which meant that an unused SPI control field is now being used. Perhaps your spidev-test has not been updated to zero the control field properly. – joan Mar 9 '18 at 8:37

Your Answer

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

Browse other questions tagged or ask your own question.