Issue with isolating a cpu1 core ESP-IDF
Posted: Thu Mar 16, 2023 2:43 pm
Hey,
I am struggling to find a solution for my problem. Here are the details:
DevKit - ESP-WROVER-KIT-E, using ESP-IDF framework
My goal is to use ESP32 both cores separately - CPU1 have to be responsible ONLY for data measurement, CPU0 - http server, connection to wifi and etc.
Data measurement goal - 10 kHz, no jitter, measurement time - around 20-30% of single core RAM consumption, MAX priority (data measurement cannot be interrupted by any source (wifi, wdt, http, etc.)
Here comes the problem - I am unable to exclude all the tasks from core0. All the affinity settings i can find in menuconfig are set to cpu0, the measurement task - pinned to cpu1. However, there is still an enormous amount of jitter, while connecting to the http server, which would make the measurement unreliable. (1) Is there a possible way to COMPLETELY exclude all the other stuff from cpu1 and use it only for data measurement? if not, whats the reason of having dual core?
(2) Triggering the measurement - i have created a esp_timer, dispatch_mode configured as ISR, it is registered properly (i think). I am deciding between 2 options - either modifying a global variable, whilst constantly checking its value in data measurement task OR notifying the task that it should start. Second way is harder to implement, but should save a lot of RAM (as from what i have read already). Which way i should choose? I want to dedicate CPU1 only for data measurement part, so the polling doesn't sound as bad. Accessing global variable from both ISR and measurement task also does not scare me since it's only "a switch", no sensitive data being passed.
Sorry for the long post, I hope someone can help me.
Thanks in advance !
Best regards,
Saulius J
I am struggling to find a solution for my problem. Here are the details:
DevKit - ESP-WROVER-KIT-E, using ESP-IDF framework
My goal is to use ESP32 both cores separately - CPU1 have to be responsible ONLY for data measurement, CPU0 - http server, connection to wifi and etc.
Data measurement goal - 10 kHz, no jitter, measurement time - around 20-30% of single core RAM consumption, MAX priority (data measurement cannot be interrupted by any source (wifi, wdt, http, etc.)
Here comes the problem - I am unable to exclude all the tasks from core0. All the affinity settings i can find in menuconfig are set to cpu0, the measurement task - pinned to cpu1. However, there is still an enormous amount of jitter, while connecting to the http server, which would make the measurement unreliable. (1) Is there a possible way to COMPLETELY exclude all the other stuff from cpu1 and use it only for data measurement? if not, whats the reason of having dual core?
(2) Triggering the measurement - i have created a esp_timer, dispatch_mode configured as ISR, it is registered properly (i think). I am deciding between 2 options - either modifying a global variable, whilst constantly checking its value in data measurement task OR notifying the task that it should start. Second way is harder to implement, but should save a lot of RAM (as from what i have read already). Which way i should choose? I want to dedicate CPU1 only for data measurement part, so the polling doesn't sound as bad. Accessing global variable from both ISR and measurement task also does not scare me since it's only "a switch", no sensitive data being passed.
Sorry for the long post, I hope someone can help me.
Thanks in advance !
Best regards,
Saulius J