Page 1 of 1

Option to disable HAL mutexes

Posted: Wed Nov 23, 2016 10:11 pm
by the-fallen
Hi there. I stumbled upon HAL mutex locks while trying to find out why a certain LCD driver is so slow in the ESP32.

I think I understand what they are good for.

Google told me that me-no-dev committed this change :
https://github.com/espressif/arduino-es ... 9fd0b62419

And it seems that there now is an option to disable those mutexes.

Now I wonder how to use that option in Arduino correctly (I already disabled SPI HAL mutexes by changing esp32-hal-spi but I am sure thats not the way I should do that).

And just for understanding: do I need to take care oft something if I disable those mutexes?

Many thanks in advance.

Re: Option to disable HAL mutexes

Posted: Fri Dec 02, 2016 2:05 pm
by ESP_Me-no-dev
you should disable mutextes by changing the option in tools/sdk/include/config/sdkconfig.h which is generated by menuconfig when libs are prepared in IDF. I will add it as option to the boards soon also.
If you use Arduino the usual way and do not spawn threads or run code on both cores at the same time that accesses the same peripheral, you should be safe without mutexes. If you want to use threads, make sure that SPI for example is accessed only in that thread.