AnsweredAssumed Answered

LED don't light on Nucleo STM32F411RE

Question asked by Benoît Bousquet on Oct 14, 2017
Latest reply on Oct 18, 2017 by Benoît Bousquet

Hi, I'm getting started with the Nucleo STM32F411RE, and the LED don't light !

 

Here is my main.c :

 

//*****************************************************************************
//
//! \file main.c
//! \brief main application
//! \version 1.0.0.0
//! \date $Creat_time$
//! \author $Creat_author$
//! \copy
//!
//! Copyright (c) 2014 CooCox.  All rights reserved.
//
//! \addtogroup project
//! @{
//! \addtogroup main
//! @{
//*****************************************************************************

 


#include <stm32f4xx.h>
#include <system_stm32f4xx.h>
#include <stm32f4xx_rcc.h>
#include <stm32f4xx_gpio.h>

 


void Init(void);

 

void Init(void)
{
    RCC_DeInit();
    GPIO_InitTypeDef GPIO_InitStructure_Led;

 

 

      RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);

 

    GPIO_InitStructure_Led.GPIO_Pin = GPIO_Pin_5;
    GPIO_InitStructure_Led.GPIO_Mode = GPIO_Mode_OUT;
    GPIO_InitStructure_Led.GPIO_OType = GPIO_OType_PP;
    GPIO_InitStructure_Led.GPIO_PuPd = GPIO_PuPd_NOPULL;
    GPIO_InitStructure_Led.GPIO_Speed = GPIO_Speed_50MHz;

 

    GPIO_Init(GPIOA, &GPIO_InitStructure_Led);

}

 

int main(void)
{
    Init();
    //GPIO_WriteBit(GPIOA, GPIO_Pin_5, Bit_SET);
    GPIO_SetBits(GPIOA, GPIO_Pin_5);
    while(1)
    {

    }
}
//! @}
//! @}

 

 

The build is successful, and I can flash the .bin file via ST-Link Utility. But it doesn't work. The LED stays off.

 

There is no clue which could lead me to a solution, because all the compiling and flashing processing works fine.

 

Is there something missing in the code ? Something I forgot to configure ?

 

Thanks for your help !

Outcomes