-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
ESP32S3 SPI2_HOST could not support 6 device, only 4 work. #9547
Comments
Same issue mentioned here but only handled in ESP-IDF : espressif/esp-idf#8876 |
The development version has the new setting. |
Thanks Lbernstone for quick reply! I updated the line you highlighted in arduino-esp32 but compilation has issue, mentions missing files. I had to download from idf-c432c692fa and added all missing files to 2.0.11 folder still complains lots of "not declared in this scope" or suggested alternative ... It seems I need an entire version of arduino-esp32 to handle the SPI issue, not only modifying the line of "#define SOC_SPI_PERIPH_CS_NUM(i) (((i)==0)? 2: (((i)==1)? 6: 3))". ESP-IDF and arduino-esp32 are totally different structure. Files from former cannot directly move to latter for upgrade. Pls help! |
The first link is instructions to install the development version. The second link shows where the files are coming from. |
Added the DEV link to Arduino and downloaded ESP32 3.0.0RC1. Double checked the soc_caps.h with 6 device supported. I connected 3 SPI sensors to SPI2 (HSPI I believe, set SCK 12, MOSI 11, MISO 13) with 3 CS ports. If I enable all 3, none working or only the 2nd is working, others reporting 0xFF. However, when I test them one by one, each works well. I guess it might be a code issue? I'm using standard SPI code, not HSPI code from ESP. void setup() { Serial.begin(115200); |
Perhaps you have another issue. Are you sure all those devices will work at the settings you have provided? The ESP32S3 can certainly handle multiple SPI devices. See https://wokwi.com/projects/395883588108483585 for an example |
Thanks Lbernstone! You gave me an excellent link for my reference. Yes, all sensors works in each single test but could not switch from one to next. If switching, all 0xFF. The wiring in your link is exactly what I need; however, the code is not so straight forward to me. I attached the code and my commets, pls help. THX! #include <SD.h> SPIClass SPI2(2); // If I have 3 SPI device, should I create 3 constructors here? void setup() { mySPI.begin(12, 13, 11, 15); // Here creates 1 SPI device. Following is a SPI from ESPRESSIF: #include <SPI.h> // Define ALTERNATE_PINS to use non-standard GPIO pins for SPI bus #ifdef ALTERNATE_PINS static const int spiClk = 1000000; // 1 MHz //uninitalised pointers to SPI objects void setup() { //clock miso mosi ss //set up slave select pins as outputs as the Arduino API // the loop function runs over and over again until power down or reset |
This site is not meant to be a tutorial- it is for errors in the code in the repository here. Please ask general questions at https://esp32.com |
Board
ESP32S3 Wroom 1 N8R2
Device Description
ESP32S3 supports only 4 SPI device on SPI2 bus while claims supporting 6 device. I new installed Arduino 2.3.2 and installed ESPRESSIF V2.0.11, found the file soc_caps.h indicates it supports "#define SOC_SPI_PERIPH_CS_NUM(i) 3". However, in ESP-IDF V5.2.1, same file says: "#define SOC_SPI_PERIPH_CS_NUM(i) (((i)==0)? 2: (((i)==1)? 6: 3))". Copied the latest file to Arduino and upload with issue still exists. Strongly suggest upgrading Arduino-esp32 library as well to handle the 4 SPI issue. THANKS!!
Hardware Configuration
ESP32S3 N8R2 reading 16x Honey ABP SPI sensors.
Version
v2.0.10
IDE Name
Arduino IDE
Operating System
WIN11
Flash frequency
80MHZ
PSRAM enabled
yes
Upload speed
115200
Description
ESP32S3 supports only 4 SPI device on SPI2 bus while claims supporting 6 device. I new installed Arduino 2.3.2 and installed ESPRESSIF V2.0.11, found the file soc_caps.h indicates it supports "#define SOC_SPI_PERIPH_CS_NUM(i) 3". However, in ESP-IDF V5.2.1, same file says: "#define SOC_SPI_PERIPH_CS_NUM(i) (((i)==0)? 2: (((i)==1)? 6: 3))". Copied the latest file to Arduino and upload with issue still exists. Strongly suggest upgrading Arduino-esp32 library as well to handle the 4 SPI issue. THANKS!!
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: