2024-11-25 03:48 AM - edited 2024-11-26 04:26 AM
GOAL:
Currently I am trying to get to know the low power capabilities with the STM32H757I-Eval Board. Therefore I want to write a simple program. I want to use only the Cortex-M4 for this. The program running on m4 should state with an uart message (M4 Context PB14 and PB15) that the Stop Mode is entered. After that I want to exit the low power mode, without some interaction with m7, with PC13 which mode is set to GPIO_MODE_IT_FALLING with interrupt priority 2.
I used an empty project for this and started from scratch configuration wise. After configuration of LED1 (Pk3), Button(PC13), uart1. I generated the code.
Problem:
When entering stop mode with PWR_STOPENTRY_WFI the program does not react to interrupts from button and probably stays in LPM. BUT if I stop with the debugger I get to some lines of the Reset_Handler in startup_stm32h757xx.s.
I tried it as well with PWR_STOPENTRY_WFE and the mode for pc13 configured to GPIO_MODE_EVT_FALLING.
Here DStop will not be entered.
I found some examples for the stm32 family, but none of them worked for me.
I configured the project with STM32CubeIDE. Interrupts are enabled for the button:
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 2, 0);
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
Pk3 is used to indicate withe the led what state the board is.
The section of my code regarding LPM is:
//send msg that stop mode will be entered
HAL_UART_Transmit(&huart1, msg1, sizeof(msg1), 100);
// prepare for stop mode
HAL_SuspendTick();
HAL_PWREx_ClearPendingEvent();
//enter stop mode
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
HAL_ResumeTick();
Is there something else I should check or where could be the error? Maybe some configuration errors regarding the domains?