Why no VSYNC coming out of STOP mode?
I'm trying to use STOP mode on my STM32F469I-DISCO evaluation board in a TouchGFX application. I call a function from the defaultTask that checks if the blue button is pressed, and if so, it enters STOP mode. I set up an event on the LCD_INT line from the touchscreen so that I can wake up when someone interacts with the screen. This all seems to work, but when I come out of Stop mode, the screen is no longer responding to touch. My STOP mode entry and exit code is shown below:
void checkStopMode()
{
if (GPIO_PIN_SET == HAL_GPIO_ReadPin (BLUE_BTN_GPIO_Port, BLUE_BTN_Pin))
{
//Turn off display and backlight.
HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, OTM8009A_CMD_DISPOFF, 0x00);
HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, OTM8009A_CMD_WRCTRLD, 0x00);
vTaskSuspend( TouchGFXTaskHandle ); // Suspend the TouchGFX task
HAL_PWREx_EnableFlashPowerDown();
__disable_irq(); //disable so that we don't end up in an ISR until we reconfigure the clocks after wakeup
// Clear the wakeup flag so we don't wake up right away
PWR->CR |= PWR_CR_CWUF;
HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFE);
/******************** Return from Stop Mode ************************/
/******** Wait for LCD_INT event from touch controller *************/
SystemClock_Config(); /* Reconfigure the clocks */
// Disable the powerdown of flash when entering Stop Mode.
HAL_PWREx_DisableFlashPowerDown();
__enable_irq(); // re-enable interrupts now that clocks are reconfigured
vTaskResume( TouchGFXTaskHandle ); // Resume the TouchGFX task
// Turn on the display and backlight.
HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, OTM8009A_CMD_DISPON, 0x00);
HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, OTM8009A_CMD_WRCTRLD, 0x2C);
}
}I've tried all kinds of different function calls through trial and error, but nothing works. I have a breakpoint right when I come out of STOP mode, and then I set another one in the for loop below at OSWrappers::waitForVSync().
void TouchGFXHAL::taskEntry()
{
enableLCDControllerInterrupt();
enableInterrupts();
OSWrappers::waitForVSync();
backPorchExited();
/* Enable the LCD, Send Display on DCS command to display */
HAL_DSI_ShortWrite(&hdsi, LCD_OTM8009A_ID, DSI_DCS_SHORT_PKT_WRITE_P1, OTM8009A_CMD_DISPON, 0x00);
for (;;)
{
OSWrappers::waitForVSync();
backPorchExited();
}
}It breaks there once when I resume from the breakpoint at SystemClock_Config(), but never gets out of the function. Can anyone tell me what I'm missing in my wakeup code? Been trying to get this working for most of a day now...
Also, I should mention that the defaultTask continues to run normally after wakeup.
