GP_timer not working properly

Baldhead
Posts: 456
Joined: Sun Mar 31, 2019 5:16 am

Re: GP_timer not working properly

Postby Baldhead » Tue Oct 22, 2024 11:40 pm

Hi @MicroController,

I did some modifications in my code and all is working ok, but the message:
"E (669) gptimer: gptimer_start(399): timer is not enabled yet"
in idf monitor now appears, all the time i call "gptimer_start(timer_handle)".
I called "gptimer_enable(timer_handle);" at gp_timer initialization.

Little piece of my state machine code inside isr:

Code: Select all

    gptimer_set_raw_count(timer_handle, 0);           
                        
    static gptimer_alarm_config_t gptimer_alarm;
    gptimer_alarm.alarm_count = 4167;  // this value can change at run time 
    gptimer_alarm.flags.auto_reload_on_alarm = false;            
    gptimer_set_alarm_action(timer_handle, &gptimer_alarm);

    gptimer_start(timer_handle);  // Start GPTimer (internal counter starts counting).
I put static in "gptimer_alarm_config_t" because in documentation say that:

Code: Select all

If CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is enabled, this function will be placed in the IRAM by linker, makes it possible to execute even when the Flash Cache is disabled. In this case, please also ensure the gptimer_alarm_config_t instance is placed in the static data section instead of in the read-only data section. e.g.: static gptimer_alarm_config_t alarm_config = { ... };
I enabled CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM.
I tried removing static, just to test, but nothing changed in relation to this problem.

Some suggestion on why this message( "E (669) gptimer: gptimer_start(399): timer is not enabled yet" ) is appearing ?

Who is online

Users browsing this forum: No registered users and 62 guests