Unable to LTDC ReConfigure/Reinit after LTDC Deinit
I am trying to reinitialize the LTDC-TFT LCD controller in a task when I press a button.
I am using the STM32H735G-DK kit, which has a TFT LCD. I have created a project using TouchGFX, and it seems the display gets initialized and loaded with images from the TouchGFX init and TouchGFX task.
Firstly, I want to achieve the re-initialization of the LTDC-TFT LCD on the STM32H735G-DK.
when i try re initializing the LTDC, it got freeze, not sure how to unfreeze it, display goes blank unable to restore back all the images which has been loaded after a reset
I am working on the low-power modes of the STM32H735G-DK and want to make sure the display goes off when I put the controller in sleep/stop mode and wakes up along with other peripherals after an external wake-up signal.

Above image which states LTDC has the 4 power modes, one of it is STOP mode
if LTDC Got freeze in STOP mode, how to unfreeze it?
can we make it work in stop mode? if yes how can we reconfigure the LTDC?
Here is what I have tried:
void test_task(void)
{
for(;;)
{
if (Button_Pressed ==1)
{
Button_Pressed=0;
printf("Entering sleep mode...\n");
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
SystemClock_Config();
vDisplay_Reinit();
printf("\n\r Exiting sleep mode\n\r");
}
}
}
void vDisplay_Reinit(void)
{
HAL_LTDC_MspDeInit(&hltdc);
HAL_DMA2D_MspDeInit(&hdma2d);
osDelay(10);
HAL_Init();
MX_GPIO_Init();
MX_DMA2D_Init();
MX_LTDC_Init();
MX_OCTOSPI1_Init();
MX_OCTOSPI2_Init();
MX_LIBJPEG_Init();
MX_TouchGFX_Init();
TouchGFX_Task(NULL);
}
I am able to turn the LTDC display ON & OFF using the following code:
void DisplayONOFF(void)
{
__HAL_LTDC_DISABLE(&hltdc);
/* Assert display enable LCD_DISP pin */
HAL_GPIO_WritePin(LCD_DISP_GPIO_Port, LCD_DISP_Pin, GPIO_PIN_RESET);
/* Assert backlight LCD_BL_CTRL pin */
HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_Port, LCD_BL_CTRL_Pin, GPIO_PIN_RESET);
osDelay(10);
__HAL_LTDC_ENABLE(&hltdc);
// Reset Control Pins
/* Assert display enable LCD_DISP pin */
HAL_GPIO_WritePin(LCD_DISP_GPIO_Port, LCD_DISP_Pin, GPIO_PIN_SET);
/* Assert backlight LCD_BL_CTRL pin */
HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_Port, LCD_BL_CTRL_Pin, GPIO_PIN_SET);
osDelay(10);
}
Reference Links:
STM32H7-LTDC: STM32H7-Peripheral-LCD_TFT_Controller (LTDC)
STM32H7-LTDC_AppNote: app_note
