I have a timer that works when running in a task on core 0 but does not work when running in a task running on core 1.
Thanks
Timer not working on core 1
-
- Posts: 111
- Joined: Sun Jun 23, 2024 6:18 pm
Re: Timer not working on core 1
You did not mention which version of the ESP32 you are using. Anyways, is there any other tasks or interrupts that might be interfering with the timer on core 1?
Re: Timer not working on core 1
Thanks for the response.
I am using an S3. There is only a single task running on core 1 and the only thing in the task is the timer.
I am using an S3. There is only a single task running on core 1 and the only thing in the task is the timer.
-
- Posts: 1515
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Timer not working on core 1
What do you mean you have a timer "running in a task"?
Re: Timer not working on core 1
Thanks for responding.
I am using a general purpose timer. Timer 0 in Timer Group 0. The timer is set to count to 200. When it reaches 200 it sets the interrupt flag and restarts at 0. As it is counting up I poll for the interrupt flag. When the flag gets set, I clear it, then continue running the rest of the function.
This has been working in a task on core 0 but when I run that same task on core 1 it does not.
When running in the task the code is bare metal and does not use any API's. The initialization is done using the API's in app_main(). Is it possible that since the initialization is being done in app_main(), which is running on core 0 that it will not work on core 1? Both cores should have identical access to the timer registers so I don't see why that should matter.
Thanks again
I am using a general purpose timer. Timer 0 in Timer Group 0. The timer is set to count to 200. When it reaches 200 it sets the interrupt flag and restarts at 0. As it is counting up I poll for the interrupt flag. When the flag gets set, I clear it, then continue running the rest of the function.
This has been working in a task on core 0 but when I run that same task on core 1 it does not.
When running in the task the code is bare metal and does not use any API's. The initialization is done using the API's in app_main(). Is it possible that since the initialization is being done in app_main(), which is running on core 0 that it will not work on core 1? Both cores should have identical access to the timer registers so I don't see why that should matter.
Thanks again
Re: Timer not working on core 1
Yes, that is the case and it's documented.
Who is online
Users browsing this forum: Google [Bot], Urada_esp and 40 guests