Hello forks.
I would like to let ESP32 read data at constant interval. But it seems that ESP32 occasionally freeze for a while.
I could that using AVR. but slow.
Thank you.
How to prevent ESP32 from switching tasks?
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to prevent ESP32 from switching tasks?
Can you give a bit more info; what data are you trying to read and at what frequency?
Re: How to prevent ESP32 from switching tasks?
Thank you.
It will be 10Msps, at least 1M.
I think ESP32 performs best, by sending a command to RTos, which preventing RTos from switching tasks.
Is it right?
Thank you.
It will be 10Msps, at least 1M.
I think ESP32 performs best, by sending a command to RTos, which preventing RTos from switching tasks.
Is it right?
Thank you.
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to prevent ESP32 from switching tasks?
It depends. The ESP32 has a RTOS system that makes it somewhat of an issue to disable task switching (you can only do it up to a certain point). However, in contrast to an AVR, the ESP32 has a lot of versatile peripherals to do stuff in hardware, without the CPU actually having to actively do the transfers. Hence my question: what data are you trying to read? As in: where does it come from, what protocol does it have?
Re: How to prevent ESP32 from switching tasks?
It is 1-wire transfer protocol. And it is an original one.
BTY, I found a code shown below works well. ESP32 no longer go into panic.
portMUX_TYPE mutex = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL(&mutex);
vTaskDelay(8000 / portTICK_PERIOD_MS);
portEXIT_CRITICAL(&mutex);
Thank you.
BTY, I found a code shown below works well. ESP32 no longer go into panic.
portMUX_TYPE mutex = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL(&mutex);
vTaskDelay(8000 / portTICK_PERIOD_MS);
portEXIT_CRITICAL(&mutex);
Thank you.
Who is online
Users browsing this forum: Bing [Bot], msfujino and 43 guests