ESP32-C3 timer peripheral problems? (no, user error)

jkingdon
Posts: 20
Joined: Wed Jun 15, 2016 2:51 pm

ESP32-C3 timer peripheral problems? (no, user error)

Postby jkingdon » Tue Dec 07, 2021 10:46 pm

Update: so this is definitely a user code problem (i.e. me), not a hardware or esp-idf problem. I added some debug pin wiggling to the timer library and I can see that it's still generating interrupts when my app goes down. I chased back up to my isr callback function and it's still getting to there, so the problem is with me putting a message on the queue and receiving it into the task at the other end. More debugging tomorrow.

Original:
Has anyone run into problems with the timer peripheral on C3? I'm trying to track down a problem with my app which is driven from a timer and (unlikely as it sounds) it looks like the timer just stops generating interrupts. Once it stops I haven't been able to find a way in software
to restart it, even a full timer_deinit/ timer_init sequence isn't enough.

I'll keep digging into the problem, but I thought it was worth seeing if anyone else has already hit this (google didn't turn up anything).

jkingdon
Posts: 20
Joined: Wed Jun 15, 2016 2:51 pm

Re: ESP32-C3 timer peripheral problems? (no, user error)

Postby jkingdon » Wed Dec 08, 2021 11:44 pm

To close this out, the root cause was unsafe access to spi_device_polling_transmit() from multiple tasks, eventually causing that function to hang and block the task driven from the timer interrupts. I miss-interpreted the lack of activity from that task as it not getting triggered when in fact it had just disappeared into an infinite loop.

James

Who is online

Users browsing this forum: No registered users and 148 guests