cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeF4 Nucleo BSP LED control bug

dlkeng
Associate III
Posted on May 21, 2014 at 03:28

In version 1.1.0 of STM32CubeF4, the BSP for the Nucleo boards has an LED control bug - the functions operate in reverse.

That is, BSP_LED_On() turns off the Nucleo LED and BSP_LED_Off() turns on the LED.

These functions are located in the file:

 

  Drivers\BSP\STM32F4xx-Nucleo\stm32f4xx_nucleo.c

#bsp #nucleo #nucleo #stm32cubef4-nucleo #bsp #led
3 REPLIES 3
Posted on May 21, 2014 at 15:42

Hi,

It seems that you are using a nucleo  Rev B board.

The developped BSP driver works well with Rev A and Rev C board, the LEDs PCB layout are different (inversed) in nucleo Rev B.

You have just to fine tune this driver to make it work with your board.

With regards.

dlkeng
Associate III
Posted on May 27, 2014 at 00:31

No, I have a Rev C board. LED2 is turned on by driving the PA5 pin high as shown in the schematic.

Below is a copy of the code from: STM32Cube_FW_F4_V1.1.0\Drivers\BSP\STM32F4xx-Nucleo\stm32f4xx_nucleo.c

162   void BSP_LED_On(Led_TypeDef Led)

163   {

164     HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_RESET);

165   }

      

174   void BSP_LED_Off(Led_TypeDef Led)

175   {

176     HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_SET);

177   }

As you can see, BSP_LED_On( ) resets the pin instead of setting it and BSP_LED_Off( ) sets the pin instead of resetting it!

Posted on May 27, 2014 at 11:41

Hi Dan,

I confirm the bug, since this driver is not 'maybe' validated using a STM32F401RE-Nucleo RevC board... because as I said the LEDs PCB layouts of old Nucleo revisions is inverted..

With regards.