Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


You are viewing a reply to Delays not working  

Delays not working STM32F446RE

I am using STM32F446RE (nucleo board) and Keil uVision5.33..0

following is the snippet:

  1. include
  2. include “Board_LED.h”

int32_t custom_delay()
{
uint32_t unTimeDelay = 0;
uint32_t unTimeDelayCounter = 50000;
for(unTimeDelay = 0; unTimeDelay != unTimeDelayCounter; unTimeDelay++);
return 1;
}

int main (void)
{
uint32_t unLEDIndex = 0;
int32_t nFunctionReturn = 0;
nFunctionReturn = LED_Initialize();
while(1)
{
nFunctionReturn = LED_Off(unLEDIndex);
nFunctionReturn = custom_delay();
nFunctionReturn = LED_On(unLEDIndex);
}
return 0;
}
The delay above is not working.

France

What do you mean by “not working”?

Looking at your code, anyway, even if you run the core at only 16MHz (the default at reset), a 50000 loop, if correctly optimized by the compiler, may run for only 5 to 10 ms, meaning the blinking will be totally invisible.

Try first by increasing a lot the loop delay (from 50,000 to 5,000,000 for example, or even more if you run at 480MHz) and see what happens.

Bernard (Ac6)

BTW, this forum is for users of System Workbench for STM32, not of Keil µVision...