I have a project with the ESP32-C3 chip, and I need to use the SPI pins (SPICS0, SPICLK, SPIQ, SPID) as GPIOs since I don't have any more available pins. I understand that these are internally connected to the flash. For this reason, if I try to set them through the iomux to function as GPIOs, the MCU resets continuously. It's not working.
Is there an effective way to configure and use them as GPIOs without encountering this issue?
ESP32-C3 SPI Pins as GPIO
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3 SPI Pins as GPIO
No. The ESP32-C3 caches need to be able to fetch data from flash for the system to work, so there's no way to use these pins as GPIOs and have a working system.
Re: ESP32-C3 SPI Pins as GPIO
I'am using ESP32-C3FH4. It has in-packge flash. So I don't use an external flash.
Even without external flash there is no way to use them?
Even without external flash there is no way to use them?
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3 SPI Pins as GPIO
There is not; the internal flash still is connected to those pins.
Re: ESP32-C3 SPI Pins as GPIO
Well, thanks for the support.
I have one more doubt. If using these pins is imposibble. Why does the datasheet mention that using SPI pins as GPIO is not recommended instead of explicitly stating that you can't?
Thanks again.
I have one more doubt. If using these pins is imposibble. Why does the datasheet mention that using SPI pins as GPIO is not recommended instead of explicitly stating that you can't?
Thanks again.
Re: ESP32-C3 SPI Pins as GPIO
SPIHD (GPIO12) and SPIWP (GPIO13) Pins are available to use as GPIO?
In the Pin Layout section (2.1) of the datasheet, Pins 19 and 20 (SPIHD and SPIWP) of the ESP32C3-FH4 are labeled as NC (Not Connected). However, in the table in section 2.3, they are designated as default GPIOs. I tested using them as outputs, and it worked for me, but according to the datasheet, this shouldn't be possible. Hence, my uncertainty.
In the Pin Layout section (2.1) of the datasheet, Pins 19 and 20 (SPIHD and SPIWP) of the ESP32C3-FH4 are labeled as NC (Not Connected). However, in the table in section 2.3, they are designated as default GPIOs. I tested using them as outputs, and it worked for me, but according to the datasheet, this shouldn't be possible. Hence, my uncertainty.
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-C3 SPI Pins as GPIO
Because technically, it's possible to add another SPI device in parallel with the flash, and you'd use those pins then. In practice, this has a ton of downsides, and after attempting to support it for the ESP32 in ESP-IDF, we decided to abandon software support for it for later chips.
You can use those pins if a. you don't run the flash in QIO/QOUT mode, and b. the flash happens to be configured in such a way that it doesn't care what the values on those pins are.Mateo4865 wrote: ↑Wed Mar 06, 2024 2:19 pmSPIHD (GPIO12) and SPIWP (GPIO13) Pins are available to use as GPIO?
In the Pin Layout section (2.1) of the datasheet, Pins 19 and 20 (SPIHD and SPIWP) of the ESP32C3-FH4 are labeled as NC (Not Connected). However, in the table in section 2.3, they are designated as default GPIOs. I tested using them as outputs, and it worked for me, but according to the datasheet, this shouldn't be possible. Hence, my uncertainty.
Who is online
Users browsing this forum: No registered users and 107 guests