Timer not working on core 1

srjasz
Posts: 43
Joined: Wed Apr 03, 2024 4:29 pm

Timer not working on core 1

Postby srjasz » Tue Jul 09, 2024 2:23 pm

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

aliarifat794
Posts: 111
Joined: Sun Jun 23, 2024 6:18 pm

Re: Timer not working on core 1

Postby aliarifat794 » Tue Jul 09, 2024 5:35 pm

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?

srjasz
Posts: 43
Joined: Wed Apr 03, 2024 4:29 pm

Re: Timer not working on core 1

Postby srjasz » Wed Jul 10, 2024 8:11 pm

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.

MicroController
Posts: 1515
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Timer not working on core 1

Postby MicroController » Thu Jul 11, 2024 7:35 am

What do you mean you have a timer "running in a task"?

srjasz
Posts: 43
Joined: Wed Apr 03, 2024 4:29 pm

Re: Timer not working on core 1

Postby srjasz » Thu Jul 11, 2024 2:38 pm

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

eriksl
Posts: 111
Joined: Thu Dec 14, 2023 3:23 pm
Location: Netherlands

Re: Timer not working on core 1

Postby eriksl » Sat Jul 27, 2024 8:26 am

Yes, that is the case and it's documented.

Who is online

Users browsing this forum: No registered users and 51 guests