I ran into a speed issue with my code. So I gathered the info on all tasks and noticed that the task esp_timer is consuming about half of the available CPU time. See stats here:
Code: Select all
W (587604) AUDIOBOX: # task name core free stack run time in %%
W (587614) AUDIOBOX: 0 AudioTask 1 13856 373664 <1%
W (587614) AUDIOBOX: 1 main 0 2056 463896 <1%
W (587614) AUDIOBOX: 2 IDLE 1 936 585918953 99%
W (587634) AUDIOBOX: 3 IDLE 0 928 274725393 46%
W (587634) AUDIOBOX: 4 esp_periph 0 2316 2387659 <1%
W (587634) AUDIOBOX: 5 Tmr Svc 0 160 924679 <1%
W (587634) AUDIOBOX: 6 file 0 2176 268981 <1%
W (587634) AUDIOBOX: 7 mp3 0 3892 2513101 <1%
W (587634) AUDIOBOX: 8 filter 0 2960 1114041 <1%
W (587634) AUDIOBOX: 9 i2s 0 2640 599156 <1%
W (587634) AUDIOBOX: 10 ipc0 0 952 8576 <1%
W (587644) AUDIOBOX: 11 hciT 0 1568 504208 <1%
W (587644) AUDIOBOX: 12 BTU_TASK 0 2964 752456 <1%
W (587644) AUDIOBOX: 13 BTC_TASK 0 1508 355212 <1%
W (587644) AUDIOBOX: 14 btController 0 2016 5001571 <1%
W (587644) AUDIOBOX: 15 esp_timer 0 3324 296709377 50%
W (587644) AUDIOBOX: 16 input_key_servi 1 2472 68 <1%
In the timer callback all I do is put a message on a queue, which is later handled in a task, like this:
Code: Select all
err = xQueueSend( queue_toStateMachine, ( void * ) &outMsg, ( TickType_t ) 2 );
What can I do to reduce the load of esp_timer on the CPU?
What are the typical reasons for such load?
Thanks a lot!
cheers
JRA