-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FSPI and ESP32-S2 #9210
Comments
Please explain better what the issue is, and what you believe the fix would be. The default for SPI is to use HSPI, which will not use the SPI flash pins. However, they are available if you have a valid use case. |
This is perfectly valid. From esp32-hal-spi.c Lines 129 to 133 - ESP32S2 maps the SPI peripherals.static spi_t _spi_bus_array[] = {
#if CONFIG_IDF_TARGET_ESP32S2
{(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 0, -1, -1, -1, -1},
{(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 1, -1, -1, -1, -1},
{(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 2, -1, -1, -1, -1}
From libraries/SPI/src/SPI.cpp Lines 74 to 85 - ESP32S2 maps SPI object to use FSPI (ESP32-S2 SPI2)#if CONFIG_IDF_TARGET_ESP32
SPIClass SPI(VSPI);
#else
SPIClass SPI(FSPI);
#endif |
I don't see anything to fix. Please let me know if you disagree and explain how is it wrong. |
sorry, i was speaking about the comment: "SPI bus attached to the flash (can use the same data lines but different SS)" |
Yes, correct, but FSPI (ESP32-S2 SPI2) can be used to control external flash / psram, if necessary. ESP32-S2N4R2 uses SPI0 for controlling internal SoC Flash (4MB) and the SPI1 for controlling the internal SoC (2MB) PSRAM. In order to use SPI2 (Arduino FSPI) to access external memory, I'd suggest to use IDF calls instead and not use Arduino SPI Class. IDF Flash SPI API is described here: Related IDF examples: In order to use IDF + Arduino, it would be necessary to create an
|
i have no problem using it, it's just that the comments are wrong. I expect something like this:
|
OK. It sounds good for the ESP32-S2. I'll change the code to reflect this description and commentaries. |
We shall also consider that those code lines about FSPI and HSPI are valid for ESP32 too. |
@vincentfenet Check the changes in https://github.com/espressif/arduino-esp32/pull/9216/files and let me know if you agree to them. Thanks! |
i totaly agree with this. thanks for your cooperation ! |
Board
ESP32-S2FN4R2
Device Description
none
Hardware Configuration
none
Version
latest master (checkout manually)
IDE Name
none
Operating System
none
Flash frequency
none
PSRAM enabled
yes
Upload speed
115200
Description
looks like this is not vaild for ESP32S2.
when i look at the ESP32S2 documentation:
Ports of embedded flash correspond to pins of ESP32-S2FH2 and ESP32-S2FH4 as follows:
–CS# = SPICS0
–DI = SPID
–DO = SPIQ
–CLK = SPICLK
–WP# = SPIWP
–HOLD# = SPIHD
Ports of embedded PSRAM correspond to pins of ESP32-S2FN4R2 and ESP32-S2R2 as follows:
–CE# = SPICS1
–SI/SIO0 = SPID
–SO/SIO1 = SPIQ
–SCLK = SPICLK
–SIO2 = SPIWP
–SIO3 = SPIHD
These pins are not recommended for other uses
could you please fix this ?
thanks,
vincent
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: