cancel
Showing results for 
Search instead for 
Did you mean: 

Delay functions (HAL_Delay,DWT_Delay,for loop.... ) doesn't work on my STM32f429 board, is this caused by hardware ?

Bastian Toulelan
Associate II
11 REPLIES 11
S.Ma
Principal

There are some posts about generated code about HAL_Delay being different from CubeMX 5+. Similar issue here?

T J
Lead

some projects you have to enable systick, is it running ?

void initSysTick() {
   int ticks = 0x6000;      // 32MHz 1mS count
   SysTick->LOAD = (uint32_t)(ticks - 1UL);     /* set reload register */
   NVIC_SetPriority(SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
 
   SysTick->VAL  = 0UL;       /* Load the SysTick Counter Value */
   SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
                    SysTick_CTRL_TICKINT_Msk  |
                    SysTick_CTRL_ENABLE_Msk;        /* Enable SysTick IRQ and SysTick Timer */
}

i tested led blinking on my stm32f429 board , the LED turn on but didn't blinking but now when i tested it on my friend's board with the same code it worked !!! so i think it is caused by Hardware.

Put a break point in the systick interrupt, see if its running..

i tried it now but still doesn't work

yes it is running

Did you ever see the LED light up ? it could be broken.. it is a school lab right ?

Yes , it lights up but doesn't blinking

It could be a code 9,
are you in a school lab session now ?

can you single step in the code ?
make a break point where the led toggles,
it won’t be executed,
so look through code backwards from there,
find out which test is failing.