Can't exit Stopmode using Threadx and NetxDuo on STM32 microcontroller
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-26 7:11 AM
- used borad: NUCLEO - H563ZI
this is what i do to start StopMode (this code is the NetxDuo thread function):
static VOID nx_app_thread_entry (ULONG thread_input) { /* USER CODE BEGIN Nx_App_Thread_Entry 0 */ HAL_SuspendTick(); HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); /* USER CODE END Nx_App_Thread_Entry 0 */ }
and this is how i setup the controller:
I tried what's shown in the figure, i was expecting the execution to continue after pressing the button. If it worked i would have start to work on the Ethernet wake up.
if more information are needed i will provide them as soon as i can.
Solved! Go to Solution.
- Labels:
-
STM32H5 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-27 4:29 AM
Hello @CostaMH ,
I think that you are missing some steps to be able to enter and exit stop mode in a safe way, so my recommendations are to follow the example implemented in Repository\STM32Cube_FW_U5_V1.4.0\Projects\NUCLEO-U5A5ZJ-Q\Applications\ThreadX\Tx_LowPower and adapt it to the stm32H563.
- In fact, you need to do the following steps before entering:
- Enable Power Clock
- Switch to SMPS
- Configuration of the LPM read mode
- Set all GPIO in analog state to reduce power consumption except GPIOC to keep user button interrupt enabled
- Disable AHB APB Peripheral Clock
on exit you should:
- Enable AHB APB Peripheral Clock
- Reconfigure the system clock
- reinitialize the GPIO
another Tips in trying to visualize the signals CSLEEP and CSTOP pins to know the state of your device and if it really entered a stop mode.
here is the snippet describing the state of this pins from STM32H523/33xx, STM32H562/63xx, and STM32H573xx Arm<Sup>®</Sup>-based 32-bit MCUs - Reference manual
BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-27 4:29 AM
Hello @CostaMH ,
I think that you are missing some steps to be able to enter and exit stop mode in a safe way, so my recommendations are to follow the example implemented in Repository\STM32Cube_FW_U5_V1.4.0\Projects\NUCLEO-U5A5ZJ-Q\Applications\ThreadX\Tx_LowPower and adapt it to the stm32H563.
- In fact, you need to do the following steps before entering:
- Enable Power Clock
- Switch to SMPS
- Configuration of the LPM read mode
- Set all GPIO in analog state to reduce power consumption except GPIOC to keep user button interrupt enabled
- Disable AHB APB Peripheral Clock
on exit you should:
- Enable AHB APB Peripheral Clock
- Reconfigure the system clock
- reinitialize the GPIO
another Tips in trying to visualize the signals CSLEEP and CSTOP pins to know the state of your device and if it really entered a stop mode.
here is the snippet describing the state of this pins from STM32H523/33xx, STM32H562/63xx, and STM32H573xx Arm<Sup>®</Sup>-based 32-bit MCUs - Reference manual
BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-27 7:32 AM
Hi, sorry to bother you again. Our problem has changed. It seems that if we use NetxDuo, our board doesn't enter sleep mode anymore; it just bypasses the HAL_PWR_EnterSTOPMode function without stopping. This happens only when we use NetxDuo. Do you have any idea why this happens?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-27 10:02 AM
Hello @CostaMH ,
try implementing the steps as described and as found in the example and give us the status of CSLEEP and CSTOP pins if it is not working as expected.
know on what is happening the behavior is not clear so we need to get results after following those steps to be able to analyze it would help if you can share you code to have a look at it.
BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-28 11:37 AM
Hello @CostaMH ,
Yes, it is possible, for visibility purposes I will be closing the following request and open a new one with the new question.
BR
