I verified that I could read a Spansion S25FL127 128 Mbit NOR flash using either SPI port, the VSPI port on pins 18, 19, 23 (ss = 5) and the HSPI port on pins 12, 13, 14 (ss = 15). I am pretty sure any GPIO can be the chip select but I didn't try any others. I didn't see any timing differences between the two ports and the times to read/write a page (~4500 us), erase the chip (~43 sec) were about the same between the two ports. The erase time is also about the same when erasing the same flash with an STM32L4 but the page read/write times are about ten times longer with the ESP32. Not sure why. I put the sketch to test SPI flash in my github repository (https://github.com/kriswiner/ESP32).
Are there more than two SPI ports on the ESP32? Can I use any pins for SPI or only the V and H SPI pins called out in the pinmap here (https://github.com/espressif/arduino-esp32)?
Reading SPI Flash memory
Re: Reading SPI Flash memory
That seems unusual. Same factor (x10) for both reads and writes?onehorse wrote:The erase time is also about the same when erasing the same flash with an STM32L4 but the page read/write times are about ten times longer with the ESP32. Not sure why. I put the sketch to test SPI flash in my github repository (https://github.com/kriswiner/ESP32).
If you use the GPIO Matrix then you can remap the VSPI & HSPI interfaces to any pins. This limits max clock rate to 40MHz.onehorse wrote: Are there more than two SPI ports on the ESP32? Can I use any pins for SPI or only the V and H SPI pins called out in the pinmap here (https://github.com/espressif/arduino-esp32)?
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: Reading SPI Flash memory
Just for completeness sake: You could also in theory connect the chip in parallel with the chip that contains the main program code, with only the /CS line connected to a different GPIO. Unfortunately, esp-idf does not support this yet.
Re: Reading SPI Flash memory
Yes. The 4 MBytes (~3 Mbytes of space available to the user) on the board I am using is likely enough for casual use. I wanted to be able to add more.
I have a couple of add-ons I designed for a Teensy with either 16 Mbyte or 128 Mbyte. There is even an SPI NOR Flash with 256 MByte available I have used but it is pretty expensive. The point is, I thought the internal flash was limited to 16 MByte because of the addressing inside the chip Maybe this only applies to the progran flash and doesn't apply to a flash treated as an external memory anyway.
In my dev board design I didn't expose the internal flash pins so connecting to one of the SPI ports is really the only option for me.
I have a couple of add-ons I designed for a Teensy with either 16 Mbyte or 128 Mbyte. There is even an SPI NOR Flash with 256 MByte available I have used but it is pretty expensive. The point is, I thought the internal flash was limited to 16 MByte because of the addressing inside the chip Maybe this only applies to the progran flash and doesn't apply to a flash treated as an external memory anyway.
In my dev board design I didn't expose the internal flash pins so connecting to one of the SPI ports is really the only option for me.
Who is online
Users browsing this forum: No registered users and 118 guests