This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPI flash MISO on GPIO 24 does not work (?)

Hi,

I have connected and SPI flash module to my pca10040 dev board. I wrote a test cycle of erase/write/verify for the entire flash and it works correctly. My initial pinout setup is:

#define FLASH_SPI_SS_PIN 3
#define FLASH_SPI_MISO_PIN 4
#define FLASH_SPI_SCK_PIN 28
#define FLASH_SPI_MOSI_PIN 29

Then I tried to move the pins to different GPIOs but the test fails at random at the first write/verify cycle (i.e. write and read data don't match). The new pins are:

#define FLASH_SPI_SS_PIN 25
#define FLASH_SPI_MISO_PIN 24
#define FLASH_SPI_SCK_PIN 23
#define FLASH_SPI_MOSI_PIN 22

What's most puzzling is that I found out that the troublesome pin is GPIO 24. Leaving it to previous 4 and moving all other pins makes the test pass. What's even more strange is than exchanging wires and pin configuration, the test also passes. So this configuration works:

#define FLASH_SPI_SS_PIN 24  // Was 25
#define FLASH_SPI_MISO_PIN 25  // Was 24
#define FLASH_SPI_SCK_PIN 23
#define FLASH_SPI_MOSI_PIN 22

I'm not sure what's going on. Notice I don't use those pins anywhere else in my code.

Any ideas?

Thanks a lot!

Parents Reply Children
No Data
Related