Fix Boot Loop on ESP32S3 Due to Mis-defined SPI Port #3488
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
People have been having trouble using SPI on ESP32 S3. Here are a couple of related discussions:
#3283
espressif/arduino-esp32#10254
The ESP IDF code indicates that only SPI 2 and 3 should be used. See: https://github.com/espressif/esp-idf/blob/9b3eda09741b5c7dae8f22fe60d193dcc3a7ec44/components/soc/esp32s3/include/soc/soc.h#L37
When
SPI_PORT
is defined toFSPI
, the ESP Arduino framework defines it to0
. https://github.com/espressif/arduino-esp32/blob/7018cd114d00249674567846c9d67fbb3a1240a3/cores/esp32/esp32-hal-spi.h#L32Using
0
withREG_SPI_BASE
in ESP IDF soc.h returns NULL, which causes all subsequent SPI actions to hard-fault.The simplest solution is to not define
SPI_PORT
toFSPI
, but rather to GSPI2 or GPSI3 by default, as these are supported by the ESP IDF.