Hi,
I' using ESP32 as spi master for driving LCD over spi, clock freq configured as 60MHz.
Graphic library uses custom tick handler esp_register_freertos_tick_hook().
I'm loading picture from spiffs image and draw it on LCD.
After I enabled Component config -> Power Management -> Support for power management I'm facing huge delays in picture drawing. All other settings remains same.
On logic analyzer I noted taht there are delays between commands:
POWER SAVE DISABLED:
delay between commands ~56ms
POWER SAVE ENABLED:
delay between commands ~350 ms
As I see, there is special handle in spi driver for this configuration (CONFIG_PM_ENABLE):
https://github.com/espressif/esp-idf/bl ... ter.c#L190
What should I take into account if enable Power save? Why delays apear? Maybe it affects on ticks handling somehow?
Reagrds
Power Management settings cause spi delays
-
- Posts: 121
- Joined: Wed Apr 05, 2017 12:49 pm
-
- Posts: 121
- Joined: Wed Apr 05, 2017 12:49 pm
Re: Power Management settings cause spi delays
Any ideas where I should to dig?
Re: Power Management settings cause spi delays
Do you only enable CONFIG_PM_ENABLE or also some other PM related options (such as, initialize PM at startup)? Do you call esp_pm_configure to set parameters such as minimum and maximum frequency? Do you enable "FreeRTOS Tickless Idle" option?
Depending on answers to those questions it might be either that this is because of the tick interrupt being skipped (due to tickless idle) or because of some other reason.
Depending on answers to those questions it might be either that this is because of the tick interrupt being skipped (due to tickless idle) or because of some other reason.
-
- Posts: 121
- Joined: Wed Apr 05, 2017 12:49 pm
Re: Power Management settings cause spi delays
Change made in sdkconfig are below. Application code remais unchanged.
Power management: FreeRTOS: Paremeter Minimum number of ticks to enter sleep mode was set to 3 by default
Power management: FreeRTOS: Paremeter Minimum number of ticks to enter sleep mode was set to 3 by default
Re: Power Management settings cause spi delays
If tickless idle is enabled, FreeRTOS will skip ticks when these ticks do not cause tasks to unblock or timeouts to expire. The library you are using was probably written with the assumption that FreeRTOS ticks always happen at the same interval. The assumption becomes invalid if tickless idle is used. You might be able to modify the library to use a different method of getting periodic interrupts, such as Timer Group hardware timers or esp_timer library.
Who is online
Users browsing this forum: No registered users and 99 guests