Reassign SPI CS1 Pin?

AA Systems
Posts: 3
Joined: Mon May 24, 2021 8:59 pm

Reassign SPI CS1 Pin?

Postby AA Systems » Tue May 25, 2021 2:26 am

Hi - We made the mistake in our PCB design of using GPIO-26 on an ESP32-S2-Wrover-1 module to drive a motor controller input and only realized too late that GPIO-26 is a reserved pin on the ESP32-S2.

The ESP32-S2 datasheet (p. 11)
https://www.espressif.com/sites/default ... eet_en.pdf
clearly says that GPIO-26 is reserved for SPI CS1 and not to use GPIO-26: "By default, IO26 is connected to the CS pin of the PSRAM and cannot be used for other functions."

Sure enough, every time we try to set GPIO-26 to HIGH to enable the motor driver, the ESP32 stops executing and crashes.

Is there a way to reassign the SPICS1 pin to some other pin so we can use GPIO26 as currently wired?

I took a look at the SPI Flash reference
https://docs.espressif.com/projects/esp ... e_config_t
but it's unclear whether this can be used for SPI1 bus or not.

Welcome any guidance/help here. Thanks! Dan.

Sprite
Espressif staff
Espressif staff
Posts: 10619
Joined: Thu Nov 26, 2015 4:08 am

Re: Reassign SPI CS1 Pin?

Postby Sprite » Tue May 25, 2021 4:05 am

It is technically re-assignable on the ESP32, I believe, but it would not do what you would want it to do. The issue is that even if you reassigned it on the ESP32, you would still have the PSRAM chip sharing a bus with the SPI flash; the only reason those don't talk through eachother is that they both have a separate CS pin. If you go and put random signals on what effectively is the pad that is connected to the SPI flash CS pin, you will have reacting to commands meant for the SPI flash and interfering what that does, leading to crashes.

AA Systems
Posts: 3
Joined: Mon May 24, 2021 8:59 pm

Re: Reassign SPI CS1 Pin?

Postby AA Systems » Tue May 25, 2021 4:39 am

Thank you for the quick response. Sounds like there is no software fix and we will have to solder in a jumper wire to a different GPIO.

AA Systems
Posts: 3
Joined: Mon May 24, 2021 8:59 pm

Re: Reassign SPI CS1 Pin?

Postby AA Systems » Sun Oct 10, 2021 12:51 am

Thanks again for the earlier reply. I was wondering, out of curiosity, why bother exposing GPIO26 externally if it cannot be used as a GPIO?

If there is anything I can do to salvage the existing boards as is, and use the GPIO26 by reconfiguring the ESP32 in software, I would welcome any advice.

Thanks!

Sprite
Espressif staff
Espressif staff
Posts: 10619
Joined: Thu Nov 26, 2015 4:08 am

Re: Reassign SPI CS1 Pin?

Postby Sprite » Sun Oct 10, 2021 1:48 am

Thanks again for the earlier reply. I was wondering, out of curiosity, why bother exposing GPIO26 externally if it cannot be used as a GPIO?
I don't know. Generally, if you'd have the pads, you want to lead out as many signals as possible, if anything because it may help in debugging PSRAM issues. The pad could also be used for ATE purposes (=factory testing).
If there is anything I can do to salvage the existing boards as is, and use the GPIO26 by reconfiguring the ESP32 in software, I would welcome any advice.
You could potentially make use of the flash guards when you need to make that pin low... effectively, you disable any activity on the flash bus, make the pin low, make it high again, then resume flash operations... but that would only allow you to send out short low pulses, and wouldn't allow you to do anything else during that time as the flash can't be operational... aside from that, sorry, no idea.

Who is online

Users browsing this forum: ChatGPT-User and 1 guest