Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


DELAYS DON`T WORK AS EXPECTED

Brazil

I would like to make a led connected to pin 6 flash, using this code:

while(1)
{
GPIO_WriteBit(GPIOA, GPIO_Pin_6, Bit_RESET);
delay();
GPIO_WriteBit(GPIOA, GPIO_Pin_6, Bit_SET);
delay();
}

To generate the required delay for blinking, I wrote the following function:

void delay(void)
{
uint32_t delay = 0;
while(delay < 5000000)
{
++delay;
}
}

This should generate enough delay for me to see the LED flash. The problem is that it didn’t matter what value I wrote in the delay variable, the led just didn’t blink. It was as if the compiler did not execute the delay function.
So I decided to create a new project within SW4STM32 and simply copied and pasted the code into the new project. Then the LED finally started to flash.
Does anyone have any idea why this could be happening?

Hi

I might be mistaken but i think that depending of the project optimization level and debugging options, the while/for loop that doing no operation might be skipped to optimize build and exec time which means, delay=0 before the “while” and delay=5000000 after the “while” but no iteration are done.

Regards,
Kevin