Page 1 of 1

Using new timer of GPTimer

Posted: Tue Mar 21, 2023 2:13 pm
by kot_schrodingera
Hello!

I migrated from 4.4 to 5.0.1
I'm trying run example for gptimer and getting message:
D (332) gptimer: new group (0) @0x3ffb6c64
D (336) gptimer: new gptimer (0,0) at 0x3ffb6bb8, resolution=1000000Hz
I (343) system: Enable timer
I (346) system: Start timer, stop it at alarm event
I (1352) system: Timer stopped, count=1000002
I (1352) system: Set count value
I (1352) system: Get count value
I (1354) system: Timer count value=lu
I (1358) system: Disable timer
I (1362) system: Enable timer
I (1365) system: Start timer, auto-reload at alarm event
Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0).

Setting breakpoint at 0x00000000 and returning...


If I turn off autoreload, then example is work correct.

What can I do?

Best regards
Alex

Re: Using new timer of GPTimer

Posted: Wed Mar 22, 2023 1:13 am
by ESP_Sprite
Hard to say without the code, but you're likely trying to do something in an ISR that you shouldn't do in an ISR. (Specifically, you can't call functions that block in any way, shape or form, which includes most of the more complex ESP-IDF API calls.)

Re: Using new timer of GPTimer

Posted: Wed Mar 22, 2023 5:55 am
by kot_schrodingera
No, I found problem.
I'm using c++ and if I rename main.cpp to main.c than all work.

Re: Using new timer of GPTimer

Posted: Wed Mar 22, 2023 6:03 am
by kot_schrodingera
I'm sorry, I'm stupid man.

gptimer_alarm_config_t struct in c++ initialize like

Code: Select all

gptimer_alarm_config_t alarm_config2 = {
        1000000, // period = 1s
        0,
        true,
    };
- it's correct code, and I mix 1000000 and 0.

Thanks