RTOS running on one core only
Re: RTOS running on one core only
Ok I have also have an issue where my esp32 from DO-IT using NODEMCU-12E board in boards manager doesnt accept rtos and throws error in arduino i am so frustrated by this especially because i specially ordered these because of the rtos and dual core capability.Can any one of u please tell me how to run rtos on the DO-IT board,i have tries this but returns an error saying that xtraskcreate doesnt exist or xtask"anything here" is not defined and the code doesnt even compile , I am too frustrated about this please can anyone fix this???/
Re: RTOS running on one core only
Could you please post the specific error output you're getting?sankd420 wrote: Ok I have also have an issue where my esp32 from DO-IT using NODEMCU-12E board in boards manager doesnt accept rtos and throws error in arduino i am so frustrated by this especially because i specially ordered these because of the rtos and dual core capability.Can any one of u please tell me how to run rtos on the DO-IT board,i have tries this but returns an error saying that xtraskcreate doesnt exist or xtask"anything here" is not defined and the code doesnt even compile , I am too frustrated about this please can anyone fix this???/
Re: RTOS running on one core only
Thank you, you are more patient than I would be.
Another way to argue is:
If running RTOS on one processor means that CTOS on the other processor is not an OS then running CTOS on one processor means that RTOS on the other processor is not an OS. Together that would mean that there is no OS on either processor. Which is ridiculous.
Please, continue your innovative work on esp-32.
Tom Meyers
Another way to argue is:
If running RTOS on one processor means that CTOS on the other processor is not an OS then running CTOS on one processor means that RTOS on the other processor is not an OS. Together that would mean that there is no OS on either processor. Which is ridiculous.
Please, continue your innovative work on esp-32.
Tom Meyers
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: RTOS running on one core only
Hello Mr. @HelWeb
I found the time critical core 1 operations solution as described by you very suitable to my needs. In fact, I would like to make a bare metal in core 1 even if being inside a task called with no interrupts on that core; no other tasks or O.S.
However I seen in some answers in this topic regarding a need of core 0 to talk to core 1 (interrupts or similar), what would disturb core 1 "real time" operations.
Have you run into some similar situation, by your posts it seems to me that you managed to make it really work - my understanding is that you can keep the ESP32 talking and "functioning" normally with core 0 while running your time critical operations on core 1. AND have both talking to each other if needed.
Finally, are the code texts that you posted all needed to start something in this way or are excerpts and more work is needed.
Thanks in advance
I found the time critical core 1 operations solution as described by you very suitable to my needs. In fact, I would like to make a bare metal in core 1 even if being inside a task called with no interrupts on that core; no other tasks or O.S.
However I seen in some answers in this topic regarding a need of core 0 to talk to core 1 (interrupts or similar), what would disturb core 1 "real time" operations.
Have you run into some similar situation, by your posts it seems to me that you managed to make it really work - my understanding is that you can keep the ESP32 talking and "functioning" normally with core 0 while running your time critical operations on core 1. AND have both talking to each other if needed.
Finally, are the code texts that you posted all needed to start something in this way or are excerpts and more work is needed.
Thanks in advance
-
- Posts: 1
- Joined: Tue Nov 10, 2020 1:52 pm
Re: RTOS running on one core only
On Fri Apr 05, 2019 10:34 pm HelWeb asked "But now i have the problem, how to measure such times in a program - who can help ?"
A lot of time has passed but I only found this thread recently when I was trying to optimise my capture software.
I am an amateur who has dabbled with software on and off over the years and now, nearing 70, I have set myself a difficult challenge that I hope that I am a little closer to achieving with HelWeb's code snippet so - thank you to HelWeb!
My solution to the above question is to use
I had to use an array to review the timings later because Serial.print is too slow.
Feeding a pulse sequence from an Arduino Nano programmed in assembler, with pulses from 125nS to 875nS resulting in output pulses of 158nS to 830nS. This was vastly superior to my results using interrupts (also using ESP.getCycleCount() for timing) that gave poor, unstable results until the Nano pulses were over about 3uS, with a similar interval between.
A lot of time has passed but I only found this thread recently when I was trying to optimise my capture software.
I am an amateur who has dabbled with software on and off over the years and now, nearing 70, I have set myself a difficult challenge that I hope that I am a little closer to achieving with HelWeb's code snippet so - thank you to HelWeb!
My solution to the above question is to use
- while(i < 20) {
- irq=REG_READ(GPIO_IN_REG) & (1<<21); // Test pin 21
- if (irq != lastIrq) {
- irqArray[i] = irq;
- CountArray[i]=ESP.getCycleCount();
- i++;
- if (irq) REG_WRITE(GPIO_OUT_W1TS_REG,(1<<22));
- else REG_WRITE(GPIO_OUT_W1TC_REG,(1<<22));
- lastIrq=irq;
- } // if irq
- } // while i
Feeding a pulse sequence from an Arduino Nano programmed in assembler, with pulses from 125nS to 875nS resulting in output pulses of 158nS to 830nS. This was vastly superior to my results using interrupts (also using ESP.getCycleCount() for timing) that gave poor, unstable results until the Nano pulses were over about 3uS, with a similar interval between.
Re: RTOS running on one core only
Long time this topic was commented, however I have an additional comment on how to get this run.
Basically if you would like to run a separate function on Core 1 you will face issues that others observed, if the interrupts are disabled on core1. And I figured out, if everything is ran from RAM on that core then you should be fine.
For example I had issues to run ethernet on Core 0 and time critical application on Core 1. And I could get proper operation only if all of the functions that Core 1 app calls has an attribute IRAM_ATTR and all related variables / constants have the attribute DMA_ATTR. If during running time anything uses flash on Core 1 that can cause conflicts.
I hope this is useful addition for the previous posts.
Basically if you would like to run a separate function on Core 1 you will face issues that others observed, if the interrupts are disabled on core1. And I figured out, if everything is ran from RAM on that core then you should be fine.
For example I had issues to run ethernet on Core 0 and time critical application on Core 1. And I could get proper operation only if all of the functions that Core 1 app calls has an attribute IRAM_ATTR and all related variables / constants have the attribute DMA_ATTR. If during running time anything uses flash on Core 1 that can cause conflicts.
I hope this is useful addition for the previous posts.
Re: RTOS running on one core only
Hello,
this interesting discussion contains almost all the information I need, but unfortunately I couldn't reproduce it in my env. Could someone shed a light in my mind? ...
So, I have an ESP32-S3 (2 cores)
In the 'Component config -> ESP System Settings' I unchecked (disabled) 'Watch CPU1 Idle Task' and 'Also watch CPU1 tick interrupt'
I couldn't find any settings about enabling static task execution, but I don't really understand why does it matter? The required memories (stack, etc) is allocated only once, during starting of the task on CPU1.
In the source I've defined a task and scheduled it with xTaskCreatePinnedToCore(...). In the task I print the affinity of itself (it is 1). So far so good. Changing a volatile variable in this task has an effect in the main_app().
But once I disable the interrupts in this task (on core1) by calling the portDISABLE_INTERRUPTS(); the execution falls apart. Among many others I can see this message:
Loosely coupled question but originally I tried to override the esp_startup_start_app_other_cores_default() method in order to completely override the core1 execution (according to this: https://docs.espressif.com/projects/esp ... re-startup). I terribly failed. What is wrong with overriding this way?
My code seemingly didn't start in that method (I tried to blink a led, I tried to write into a volatile variable, but no effect anyway)
Thanks for your answers!
ps: I'm using the latest, currently 5.0 IDF
this interesting discussion contains almost all the information I need, but unfortunately I couldn't reproduce it in my env. Could someone shed a light in my mind? ...
So, I have an ESP32-S3 (2 cores)
In the 'Component config -> ESP System Settings' I unchecked (disabled) 'Watch CPU1 Idle Task' and 'Also watch CPU1 tick interrupt'
I couldn't find any settings about enabling static task execution, but I don't really understand why does it matter? The required memories (stack, etc) is allocated only once, during starting of the task on CPU1.
In the source I've defined a task and scheduled it with xTaskCreatePinnedToCore(...). In the task I print the affinity of itself (it is 1). So far so good. Changing a volatile variable in this task has an effect in the main_app().
But once I disable the interrupts in this task (on core1) by calling the portDISABLE_INTERRUPTS(); the execution falls apart. Among many others I can see this message:
What is going on here? Is the portDISABLE_INTERRUPTS() call disables interrupts on core0 also? How to disable interrupts only on one core?Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0).
Loosely coupled question but originally I tried to override the esp_startup_start_app_other_cores_default() method in order to completely override the core1 execution (according to this: https://docs.espressif.com/projects/esp ... re-startup). I terribly failed. What is wrong with overriding this way?
Code: Select all
void esp_startup_start_app_other_cores_default(void) {
...
}
Thanks for your answers!
ps: I'm using the latest, currently 5.0 IDF
Re: RTOS running on one core only
Hi HelWeb,
-In the company I work for we are trying to do something similar with ESP32s3 however we needed hardware Interrupts on core 1, we managed to boot core 1 without starting the FreeRTOS schedule, however we are still struggling as it is not a reliable process, it could be probably because of some silicon level bugs on the chip, which there is no information about (talking for ESP32s3 as its errata has documented 3 bugs only !).
-Its now 2023 and Espressif still don't want to support this approach (only Espressif know why !). For my opinion ESP32 series will remain for doing hobbies and university level projects, or as an add-on to add wireless connectivity another MCU( STM, TI, NXP ext), unless Espressif does something about it, which till now they don't want do anything about, and they are happy with the business they have now.
I like to call all MCU from Espressif as a "freeRTOS MCU", as simply they are not made to be operated without FreeRTOS (or similar OS like zephyr ), it is theoretically possible, but in practice.....
-In the company I work for we are trying to do something similar with ESP32s3 however we needed hardware Interrupts on core 1, we managed to boot core 1 without starting the FreeRTOS schedule, however we are still struggling as it is not a reliable process, it could be probably because of some silicon level bugs on the chip, which there is no information about (talking for ESP32s3 as its errata has documented 3 bugs only !).
-Its now 2023 and Espressif still don't want to support this approach (only Espressif know why !). For my opinion ESP32 series will remain for doing hobbies and university level projects, or as an add-on to add wireless connectivity another MCU( STM, TI, NXP ext), unless Espressif does something about it, which till now they don't want do anything about, and they are happy with the business they have now.
I like to call all MCU from Espressif as a "freeRTOS MCU", as simply they are not made to be operated without FreeRTOS (or similar OS like zephyr ), it is theoretically possible, but in practice.....
Who is online
Users browsing this forum: No registered users and 149 guests