This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiler version 6 code works only with micrLIB enabled

Hello, started exploring the stm32f303vct6 discovery Board.

When compiling simple code with the version 6 compiler, it does not work (but works in debug mode).

It only starts working if you enable the use of microLIB + compiler version 6. Optimization is set to -O0. Thank you for help.

///////////////////////////////////////////////////////////////////

#include "stm32f3xx.h"

void delay()
{
for(volatile int i=0; i<500000; i++){}
}


int main(void)
{

RCC->AHBENR |= RCC_AHBENR_GPIOEEN;
GPIOE->MODER = 0x55000000;
GPIOE->OTYPER = 0;
GPIOE->OSPEEDR = 0;

while(1)
{

GPIOE->ODR = 0x8000;
delay();
GPIOE->ODR = 0x4000;
delay();
GPIOE->ODR = 0x2000;
delay();
GPIOE->ODR = 0x1000;
delay();
}

}

 

0