Issue Entering Stop Mode on CM4 of STM32H7
I have a dual core application running on an STM32H7 where I would like:
- the CM7 to tell the CM4 to enter stop mode
- have the CM4 enter stop mode
- at a later time, have the CM7 wake the CM4 from said stop mode
In the CM4 code, I'm doing this:
HAL_PWREx_ClearPendingEvent();
HAL_PWREx_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFE, PWR_D2_DOMAIN);The problem is that HAL_PWREx_EnterSTOPMode is immediately exiting. I use the HSEM library for synchronizing all communication between the CM7 and CM4. I thought that maybe I had a case where the CM7 was notifying the CM4 via the HSEM library when I didn't want it to, causing it to wake. So as a test, I added an infinite loop
while (1);after notifying the CM4 so that the CM7 wouldn't execute anything else. I know that debugging can/will wake the core. To confirm that the CM4 was getting the notification and calling the above HAL_PWREx code, I turn on an LED, delay for 5 seconds, then make the calls. After the enter function returns, I blink the LED.
How can I determine what is waking the CM4? Is my understanding of the WFE and the HSEM library to perform the waking flat out wrong?
Thanks,
C-Coder
