-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SPI commands hang on SPI_PARAM_LOCK() #7556
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
Comments
In global you should have |
For the pre-compiled libraries in arduino-esp32, sdkconfig.h already disables HAL locks. Looking at PR 6425, SPI.h has |
Thank you @me-no-dev using However, the original code was the way it was as it was wrapped inside a class (hardware abstraction layer), so the SPIClass was created dynamically. This might be worth noting for future reference, as this is a change in behaviour between 2.0.3 and newer .4 and .5 versions. Other people may run into similar issues. |
@stuartpittaway it is worth looking into. Change of behavior comes probably from this change. At the same time, properly specifying which SPI bus you will use in the global is the correct way, even though it worked before. |
@stuartpittaway Can this be considered as answered? |
Board
ESP32 DEVKITC
Device Description
DevKITC ESP32 module running on custom PCB for DIYBMS controller.
Hardware Configuration
VSPI port being used on pins GPIO18(CLK), GPIO19(MISO), GPIO23 (MOSI) and GPIO4 CS
This communicates with XPT2046 touch screen controller.
Version
v2.0.5
IDE Name
PlatformIO
Operating System
Windows 10
Flash frequency
40M
PSRAM enabled
yes
Upload speed
921000
Description
This is existing code which has worked (and still works) on v2.0.3 Arduino ESP32 framework.
On 2.0.4 and 2.0.5, the code hangs when calling
beginTransaction
on the VSPI bus.This appears to be caused by an infinite loop when calling the macro
SPI_PARAM_LOCK()
which attempts to obtain a semaphore (xSemaphoreTake
)If I add
#define CONFIG_DISABLE_HAL_LOCKS 1
to the top of the debug sketch provided - the code works as expected, and no longer hangs.This appears to be related to the code added in issue #6425
I'm using this framework library reference in my platformio.ini file
Sketch
Debug Message
Other Steps to Reproduce
Tested 2.0.4 and 2.0.5 both fail. 2.0.3 works.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: