cancel
Showing results for 
Search instead for 
Did you mean: 

Hello! How could I reinit TouchGFX?

RAkma
Associate II

Hello! I try to make powersaving mode for my device. So i should power off all chips on my board. I use TouchGFX with external RAM and QSPI and CMSIS OS v2. How could I reinit TouchGFX? I posted my code below. All is working, when powerups, but after calling function EnterSleepMode()->WakeUp() display enables, but there is no image. What's wrong with it?

void WakeUp()

{

  power_state = power_ON;

  TouchGFXTaskHandle = osThreadNew(StartTouchGFXTask, NULL, &TouchGFXTask_attributes);

}

void EnterSleepMode()

{

  power_state = power_SLEEP;

  POWER_TIM->Instance->CR1 &= ~TIM_CR1_CEN;

  PWMLCD_BLEN_STOP();

  LTDC_LCD_POWEROFF;

  osThreadTerminate(TouchGFXTaskHandle);

  HAL_LTDC_DeInit(&hltdc);

  HAL_SDRAM_DeInit(&hsdram1);

  HAL_QSPI_DeInit(&hqspi);

  HAL_DMA2D_DeInit(&hdma2d);

  SleepGPIOConfig();

  PS_POWER_3V3_1_OFF;

  PS_POWER_3V3_2_OFF;

}

void StartTouchGFXTask(void *argument)

{

 /* USER CODE BEGIN StartTouchGFXTask */

  PS_POWER_3V3_1_ON;

  PS_POWER_3V3_2_ON;

  MX_GPIO_Init();

  MX_FMC_Init();

  MX_LTDC_Init();

  MX_QUADSPI_Init();

  MX_DMA2D_Init();

  MX_TouchGFX_Init();

  SCREEN_INIT();

  ms_for_LCD_EN = HAL_GetTick();

  MX_TouchGFX_Process();

  /* Infinite loop */

  for(;;)

  {

     osDelay(1);

  }

}

0 REPLIES 0