Skip to main content

Subsection 1.2.1 Part 1: The Nucleo Board

In this course we use the STM32 Nucleo-64 board, which surrounds the STM32C031C6 microcontroller with everything needed to program and power it from a laptop: a USB interface, voltage regulators, Arduino-compatible headers, and a few buttons and LEDs. The chip we are programming is the STM32C031C6; the Nucleo board is what gives us access to it. Figure 1.2.2 shows the board and a close-up of the microcontroller.
Figure 1.2.2. The STM32 Nucleo-64 board (left) and a close-up of the microcontroller area (right). The orange arrow identifies the STM32C031C6 microcontroller; the pink circles show how its physical pins connect to the Arduino-compatible header pins, the sockets where you plug in jumper wires.
Figure 1.2.3 shows the board layout from above. Running along the left and right edges, flanked by a double-row of pins each, are two rows of Arduino-compatible header pins: these are where you plug in jumper wires to connect LEDs, buttons, and sensors. The small green user LED is at the very top of the board, just to the left of the right Arduino header; the black reset button is just to the left of it. Flanking the Arduino headers on the outer left and right edges are two additional connectors called Morpho connectors that expose more pins. We will not use those. The USB-B Mini connector on the top edge carries both power and the programming/debugging link to your laptop.
Figure 1.2.3. Annotated top view of the STM32 Nucleo-64 board. Key components are labeled by color: USB interface and reset button (black), power LED and user LED (green), user button (blue), crystal oscillators (purple), power/ground and analog headers (red), digital I/O header (red arrow, right), Morpho connectors (pink), and the STM32C031C6 microcontroller (orange).
The STM32C031C6 has 48 physical pins (Figure 1.2.4), organized into three GPIO ports named A, B, and C, with up to 16 pins each. A pin is identified by its port letter and bit number: PA5 means Port A, bit 5; PB10 means Port B, bit 10. The on-board LED is wired to PA5, also labeled D13 on the Arduino header. The two names come from two different conventions. The headers on our Nucleo board are Arduino-compatible, so they carry Arduino labels, but we will not be programming in the Arduino language and so we will not use the Arduino pin numbers in our programs. We’ll address pins by their port (A, B or C) and their bit number within that port, because a physical pin number depends on the chip’s package while the port and bit names stay the same, and the STM32C031C6’s own documentation uses PA5, PB3 and so on throughout. Figure 1.2.5 shows the full pin map with the D13 = PA5 connection highlighted.
Figure 1.2.4. Pin diagram of the STM32C031C6 (48-pin LQFP, or low-profile quad flat package). The chip has 48 pins organized into three GPIO ports (A, B, and C), each with up to 16 pins. PA5 (bottom row, highlighted in red) is the on-board LED pin.
Figure 1.2.5. Color-coded Nucleo-64 pin map. Each header pin is shown with its Arduino label (center columns) and corresponding STM32C031C6 port/bit name (outer columns), color-coded by function. The red box and arrow highlight D13 = PA5 (Port A, bit 5), the on-board LED pin.