cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_Delay

DYann.1
Senior II

Hello,

I tried the Hal_Delay function but it's not work Do you have any idea for this error ?

0693W00000aITvBQAW.pngAnd my code still waits at this loop :

0693W00000aITvqQAG.pngThank you for your helps

Regards

26 REPLIES 26
DYann.1
Senior II

Hi,

In this function is something missing ?

0693W00000aITxvQAG.pngthere is no IRQ inside this function ?

LCE
Principal

Have you configured / activated the SysTick?

It looks like you're using CubeMX, there's a a setting somewhere you have to click, quite on top under system or so.

In source activation should be done in the baic MCU config.

LCE
Principal

Or just add this:

	/* use systick as time base source and configure 1ms tick (default clock after Reset is HSI) */
	HAL_InitTick(TICK_INT_PRIORITY);   // TICK_INT_PRIORITY = 0
	HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
	HAL_NVIC_EnableIRQ(SysTick_IRQn);
 

Hello,

I'm not familar with the code (I'm a new user), I prefer to go through Cube IDE. I suppose it's this tab I need to activate ?

0693W00000aIUMiQAO.pngAnd I select SysTick probably ?

0693W00000aIUbRQAW.pngno parameters to be configured ? What does that mean ? I specify that I have an evaluation board STM32L552E-EV.

Technically it is classified as a System Handler not an IRQ, and it also doesn't use the HALs callback abstraction.

The MCU doesn't start it automatically, and it needs a clock cycle count that relates the processor's clocking speed with the desired interrupt rate. This is often 1 KHz, but doesn't have to be.

I​t is implemented as a 24-bit down counter.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
DYann.1
Senior II

Hello Tesla,

You say : 'and it needs a clock cycle count that relates the processor's clocking speed with the desired interrupt rate'.

Can you give me more detail How I can do it ? Thank you

Karl Yamashita
Lead III

Upload your IOC file so we can check if you configured it correctly.

Tips and Tricks with TimerCallback https://www.youtube.com/@eebykarl
If you find my solution useful, please click the Accept as Solution so others see the solution.

Hello,

Sorry I don't know how to upload .IOC file but I can give you the screenshot.

0693W00000aIV2rQAG.png0693W00000aIV3aQAG.png

I try somthing and I don't know if it's work correctely. Please see in this attached.