cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 Nucleo Led doesn't blink

Posted on March 02, 2015 at 14:58

What is the right configuration for LED2 in STM32F0 Nucleo board?

I tried the example IO_Toggle

void

blink_led_init()

{

  // Enable GPIO Peripheral clock

  RCC_AHBPeriphClockCmd(BLINK_RCC_MASKx(BLINK_PORT_NUMBER), ENABLE);

  GPIO_InitTypeDef GPIO_InitStructure;

  // Configure pin in output push/pull mode

  GPIO_InitStructure.GPIO_Pin = BLINK_PIN_MASK(BLINK_PIN_NUMBER);

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

  GPIO_Init(BLINK_GPIOx(BLINK_PORT_NUMBER), &GPIO_InitStructure);

  // Start with led turned off

  blink_led_off();

}

but led doesn't blink

Where am I wrong?
1 REPLY 1
Posted on March 02, 2015 at 17:19

Yeah, a lot of defines and code missing, makes both static and dynamic analysis hard...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..