2018-09-27 05:55 AM
Hi there,
I have a custom board with a STM32F746IGT and I'm using the PA2 pin as the wake up source. It's also the sleep source and maybe that is the issue.
With all the electronics around it, the system is consuming about 160mA. I can see that it goes into deep sleep because it makes most of the electronics around go to sleep and then puts himself to sleep as well and the consumption drops to about 50mA (which I know is still alot, but that's not the point).
The point is that after generating a rising edge on the PA2 pin, the consumption jumps to 80mA but the code isn't running. Or, at least, that's what I'm figuring out. Here's a sample of the code:
if(shutdownFlag == 1){
// enter deep sleep mode
// ADS Stop and sleep
STOP();
STANDBY();
// Bluetooth sleep
BTsleep();
// LEDs turn off
setLEDsleep();
HAL_GPIO_DeInit(GPIOA,GPIO_PIN_2);
HAL_Delay(2000);
// Disable all used wakeup sources: Pin6(PA2)
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN6);
// Clear the related wakeup pin flag
__HAL_PWR_CLEAR_WAKEUP_FLAG(PWR_WAKEUP_PIN_FLAG2);
// Re-enable all used wakeup sources: Pin6(PA2)
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_HIGH);
// MCU deep sleep
HAL_PWR_EnterSTANDBYMode();
WAKEUP();
HAL_Delay(1);
startContAcq();
printf("SET\n");
if(configureLEDStrip() == 0){
while(1);
}
// Indication that the device is ready to be paired with
setBlink(BLUE,500);
shutdownFlag = 0;
}
This is assuming that when the MCU wakes up, it starts where he fell asleep. And no, that while(1) is not where the code is stuck, because even with it commented it still does nothing. Any clues on what am I missing ? The code for the standby mode was taken from the examples of the STM32Cube HAL library.
Best regards,
Luis
2018-10-02 07:29 AM
Anyone ? Still stuck here
2018-10-03 06:36 AM
Bump