CubeMx settings causes HAL delay to be faster then usual STM32F407 descovery

Status
Not open for further replies.

yefj

Advanced Member level 4
Joined
Sep 12, 2019
Messages
1,213
Helped
1
Reputation
2
Reaction score
3
Trophy points
38
Activity points
7,278
Hello, I am using CUBEMX to define the clock of the periphery but when i used the HAL delay function i got the HAL_ delay be 100 times smaller.
In the manual 1000 input is 1 second in HAL delay.
How do i see the effect of the diagram bellow on the HAL DELAY function?
I read about systick maybe affecting it.i am having trouble to link the CUBEMX diagram bellow and systic and delay of HAL_delay.
Can i have a logical link between those elements?
Thanks.

HAL API STM32
https://www.st.com/content/ccc/reso...df/jcr:content/translations/en.DM00105879.pdf

STM32F407 Reference manual:

Code:
/* USER CODE BEGIN 3 */
        HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_15);
        HAL_Delay(50000);
        HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_15);
        HAL_Delay(50000);
        
        HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_14);
        HAL_Delay(5000);
        HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_14);
        HAL_Delay(50000);
        
        HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_13);
        HAL_Delay(50000);
        HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_13);
        HAL_Delay(50000);
        
        HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_12);
        HAL_Delay(50000);
        HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_12);
        HAL_Delay(50000);

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…