Impact of concurrency constraints in SPI Flash interface
Posted: Mon Jan 13, 2020 8:44 pm
Hello all,
I am trying to track down some issues in the FastLED support for ESP32, particularly when combined with SPIFFS (for loading web interface stuff and storing animation patterns). We have had a number of reports that our driver (which uses the RMT peripheral to push bits out to the LED strips) produces weird glitchy effects when the program is accessing Flash memory using the SPI API. I recently ran across this discussion on the GitHub page:
https://github.com/espressif/esp-idf/tr ... sh-on-spi1
One issue is that apparently there is a bug in the xtensa support in gcc: the IRAM_ATTR is not properly retained during template expansion. As a result, some of the key functions in our driver are not in IRAM; in particular, some of the functions called by the interrupt handler. (We have a bug report filed)
BUT, it still seems puzzling why there would be interference between SPIFFS and FastLED because for the most part people call them synchronously. That is, they open a file, read it, and close it, then call FastLED.show(). It really shouldn't matter if the FastLED code is not in IRAM.
My question (finally) is whether there might be some other reason for this problem. Is there SPI bus activity going on outside the explicit flash read and write calls? Maybe some async task that is pulling data in or syncing the meta-data?
Any help would be greatly appreciated!
I am trying to track down some issues in the FastLED support for ESP32, particularly when combined with SPIFFS (for loading web interface stuff and storing animation patterns). We have had a number of reports that our driver (which uses the RMT peripheral to push bits out to the LED strips) produces weird glitchy effects when the program is accessing Flash memory using the SPI API. I recently ran across this discussion on the GitHub page:
https://github.com/espressif/esp-idf/tr ... sh-on-spi1
One issue is that apparently there is a bug in the xtensa support in gcc: the IRAM_ATTR is not properly retained during template expansion. As a result, some of the key functions in our driver are not in IRAM; in particular, some of the functions called by the interrupt handler. (We have a bug report filed)
BUT, it still seems puzzling why there would be interference between SPIFFS and FastLED because for the most part people call them synchronously. That is, they open a file, read it, and close it, then call FastLED.show(). It really shouldn't matter if the FastLED code is not in IRAM.
My question (finally) is whether there might be some other reason for this problem. Is there SPI bus activity going on outside the explicit flash read and write calls? Maybe some async task that is pulling data in or syncing the meta-data?
Any help would be greatly appreciated!