cancel
Showing results for 
Search instead for 
Did you mean: 

Issue : Sometime, the screen freezes on wakeup. The system is still running but touchgfx does not render frame anymore. Description : MCU : STM32L4R9AI with freertos and touchgfx Screen : DSI AMOLED. Drivers used : GFXMMU, LTDC, DMA2D, DSI

MDod.1
Associate

Test 1 conditions (freeze issue) :

We want to stay active for 10s and go to into sleep mode for 10s in a loop using RTC wakeup.

In the app, one task runs touchgfx and another handle the timeout to go to sleep.

The condition to go to sleep is that the timeout of 10s is elapsed and that TouchGFXHAL::endFrame() as been called to be sure that touchgfx has finished refreshing. When the endFrame is called we disable interupt (DSI, LTDC, DMA2D, GFXMMU) in the function and a flag is set to allow to go to sleep.

Before going to sleep, we execute :

   - taskENTER_CRITICAL();

   - touchgfx task is suspended

   - A DSI command is triggered to put the screen in sleep mode

   - HAL_DMA2D_DeInit, HAL_GFXMMU_DeInit, HAL_DSI_DeInit and HAL_LTDC_DeInit

   - taskEXIT_CRITICAL();

   - HAL_SuspendTick(); // Hal tick on timer 6

   - CLEAR_BIT(SysTick->CTRL, SysTick_CTRL_ENABLE_Msk); // Freertos tick on systick

   - HAL_NVIC_DisableIRQ(SysTick_IRQn);

   - A wakeup timer is set to 10s (HAL_RTCEx_SetWakeUpTimer_IT)

   - HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);

After waking up we execute :

   - HAL_ResumeTick();

   - SET_BIT(SysTick->CTRL, SysTick_CTRL_ENABLE_Msk);

   - HAL_NVIC_EnableIRQ(SysTick_IRQn);

   - MX_LTDC_Init, MX_DSIHOST_DSI_Init, MX_GFXMMU_Init, MX_DMA2D_Init

   - A DSI command is triggered to exit the screen from sleep

   - touchgfx task is resumed

   - refreshRequested flag in "TouchGFXHAL.cpp" is forced to "true".

Issue :

Sometime, the screen freezes on wakeup. The system is still running but touch gfx does not render frame anymore.

Notes / Questions :

In some cases setting refreshRequested=true at wakeup solved the freeze, it does not solve the entire problem.

Is touchgfx task the issue ? Do we need to deinit and reinit tougfx properly or flags to check/clear/set before and after wake up to avoid going to sleep in an undesired state?

Test 2 conditions (no freeze) :

During 2 days another test has been running without freeze.

We enter and exit sleep exactly the same way. The only change we have done is that we don't call Deinit/Init DSI, LTDC, GFXMMU and DMA2D before and after sleep.

It is mandatory for our app to deinit all peripherals before sleeping to reduce power conssumption.

0 REPLIES 0