Skip to main content
MM..1
Super User
August 31, 2020
Solved

STOPmode not wakeup when code generated CubeMX 5.6. Same code 5.4 work ok.???

  • August 31, 2020
  • 2 replies
  • 753 views

main.cpp from 5.4

 //turned off wait on

 while (1)

 {

 HAL_Delay(1);

HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);

if (HAL_GPIO_ReadPin(SW_PWR_GPIO_Port, SW_PWR_Pin) == GPIO_PIN_RESET ||

HAL_GPIO_ReadPin(TRIGER_IN_GPIO_Port, TRIGER_IN_Pin) == GPIO_PIN_RESET)

  {

   break;

  }

....

}

main.c same code from 5.6 dont wake with same exti.

MX_GPIO_Init(void) is identical.

This topic has been closed for replies.
Best answer by MM..1

Finaly solved moving MX_TouchGFX_Init(); to place after stop mode as in 5.4 code. This is strange seems this init disables irqs or?

And in CubeMX config cannot by disabled generating call to this init before user code part. When i disable it checkbox is ignored and cleared when generating code.

2 replies

MM..1
MM..1Author
Super User
September 1, 2020

Nobody?

I see only two diference first is C vs C++ second when i read list file assembler generated by compilers have big difference.

Next one diff is in 5.6 code is called MX_TouchGFX_Init();

before this while stop mode , but i mean this isnt problem source.

MM..1
MM..1AuthorBest answer
Super User
September 2, 2020

Finaly solved moving MX_TouchGFX_Init(); to place after stop mode as in 5.4 code. This is strange seems this init disables irqs or?

And in CubeMX config cannot by disabled generating call to this init before user code part. When i disable it checkbox is ignored and cleared when generating code.