esp_register_freertos_tick_hook() verus FreeRTOS vApplicationTickHook()

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: esp_register_freertos_tick_hook() verus FreeRTOS vApplicationTickHook()

Postby snahmad75 » Mon Oct 29, 2018 9:19 am

ESP_Dazz wrote: Maybe use the timer peripheral to generate sub millisecond interrupts, then modify ledc pwm in an ISR?
I did not get. can you explain more with example code.

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

Re: esp_register_freertos_tick_hook() verus FreeRTOS vApplicationTickHook()

Postby ESP_Dazz » Mon Oct 29, 2018 11:12 am

Take a look at the 64-Bit Timers chapter in the Technical Reference Manual, then take a look at the driver documentation and the Timer Group Example.

The idea is to use a hardware timer to generate a sub milli second interrupt periodically (auto reload), and using the interrupt service routine to change your ledc frequency.

grtschnk
Posts: 2
Joined: Sun May 13, 2018 12:08 am

Re: esp_register_freertos_tick_hook() verus FreeRTOS vApplicationTickHook()

Postby grtschnk » Thu Nov 01, 2018 2:07 am

Do we need to worry about the IRAM_ATTR when using esp_register_freertos_tick_hook()?

I am asking because I experience the following error: "Guru Meditation Error: Core 0 panic'ed (Cache disabled but cached memory region accessed)"

I attach a tick_hook to increment the time in a library/component. However when I try to connect to my WiFi WPA2 Enterprise network the above-mentioned crash occurs. My guess is: the ESP32 is so quite busy during the WiFi handling, and either *RAM gets quite full and/or the flash gets disabled for a brief moment, so that the tick-interrupt (is it an ISR/interrupt?) can't find the next instruction.

GDB/JTAG throws the exception at the head of my static function in main.c which I registered with esp_register_freertos_tick_hook.

I am currently looking through the documents relating to ISR, IRAM_ATTR etc., but it would help to have a bit of guidance or a starting point.

Apart from this direct issue: Is it possible that WPA2 Enterprise is still quite flaky? I cannot get my board (ESP32 Wrover Kit v3) to run stable over more than an hour. Updated to master, finally running smooth :)

Kind regards,
grtschnk

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot], karunt and 70 guests