cancel
Showing results for 
Search instead for 
Did you mean: 

Using CubeIDE code breaks with HAL_Delay() at uwTick on HAL_GetTick

Bajoras
Associate II

I'm using a custom board with a STM32L431RCT6 MCU and I need to activate the Ultra Low Power modes on it. I'm trying to use HAL_Delay before HAL_PWR_EnterSTANDBYMODE() and that's where the code breaks. Does anyone have any sugestion on how to fix the problem?
I'm a beginner using CubeIDE and using microcontrollers in general.

1 ACCEPTED SOLUTION

Accepted Solutions
Souhaib MAZHOUD
ST Employee

Hi @Bajoras 

Thank you for posting.

Try to configure WakeUP4 Pin (you can configure it with STM32CubeMX : System Core>SYS>Mode) before you run HAL_PWR_EnterSTANDBYMode(); 

Thank you.

Souhaib

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
TDK
Guru

Sounds like you might be disabling SysTick before entering standby, in which case HAL_Delay won't work. You should still disable SysTick, but you can't use HAL_Delay after that point.

If you feel a post has answered your question, please click "Accept as Solution".
Souhaib MAZHOUD
ST Employee

Hi @Bajoras 

Thank you for posting.

Try to configure WakeUP4 Pin (you can configure it with STM32CubeMX : System Core>SYS>Mode) before you run HAL_PWR_EnterSTANDBYMode(); 

Thank you.

Souhaib

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello, thank you for the fast response! It works, I just needed to activate WakeUP4 Pin, but why does it work doing just that? I didn't include anything related to the WakeUP4 Pin in my code, just checking it in the .ioc file did the trick. Can someone explain it to me, please?

Bajoras
Associate II

I found out later that I didn't really need the WakeUP4Pin and the code was actually breaking within the HAL_PWR_EnterSTANDBYMODE(), I needed to reallocate the vector table by uncommenting the line 126 at "system_stm32l4xx.c". Thanks for the responses