Home / Tutorials / STM32 Tutorial / Blink a LED with STM32 Nucleo
STM32 Nucleo

Blink a LED with STM32 Nucleo

On the previous tutorial, we managed to create our first program with the STM32 Nucleo board. Now we will dig deeper on the pinout and other functionalities of the board.

The ST Nucleo F103RB page on the Mbed website contains information about the Arduino header pins of the board. Here is the top-left side:


You’ll see that the pin assignments is very much like the Arduino UNO. In fact, you can use the same pin names (A0, A1, etc.) when programming in Mbed.

Here’s the top-right side:


Again, the similarities with the Arduino UNO is still there, making the Nucleo board compatible with Arduino shields.

Besides the Arduino headers, there are also Morpho headers which gives the user access to all of the pins of the STM32F10RB:



This gives us an additional 76 pins to work with, much more than the Arduino Mega!

With knowledge on the pin names, I am ready to create some more programs. I attached an LED to D5 using the Grove shield:

STM32 Nucleo with LED attached

Then I created a program that blinks the LED faster and faster:

The LED still blinks if I change the pin name from D5 to PB_4 (which is standard STM32 naming):

Here’s the video showing the LED blinking:

On the next part of this tutorial, I will show you how to include a button to control the blinking of the LED.


Next >> Input and Output

Check Also

Blink On-board LEDs on STM32F1 Discovery

In my last post, I presented how to get started with the STM32F1 Discovery microcontroller …