AnsweredAssumed Answered

STM32F411RE cmsis led don't turn off

Question asked by mendyk.lukasz on Apr 10, 2016
Latest reply on Apr 11, 2016 by mendyk.lukasz
Hi,
I've got problem with code. LED on my board STM32F411RE don't turn off when I'm using cmsis library but in HAL or StdPeriph it works.

#include "stm32f4xx.h"
#include "core_cm4.h"

int main(void)
{
    //configure output
    RCC->AHB1ENR = RCC_AHB1ENR_GPIOAEN;
    __DSB();
    
    GPIOA -> MODER |= GPIO_MODER_MODER5_0; //as output
    GPIOA -> ODR |= GPIO_ODR_ODR_5; //set high
    GPIOA -> ODR &=~ GPIO_ODR_ODR_5;
        while(1){}
}

When I'm using "GPIOA -> ODR ^=GPIO_ODR_ODR_5;" led is still on.
Best regards,
Łukasz

Outcomes