How to Set Up an STM32 Nucleo Board
Share
An STM32 Nucleo board is a friendlier way into the STM32 world than a bare Blue Pill, because it carries an ST-Link debugger built right onto the board. You only need one USB cable to power, program, and debug. If you would rather have the matching sensors and a tested sketch arrive together, Compoden's AI build assistant turns a described project into a parts list, wiring, and code, then ships the kit. This guide covers the manual setup so you know what each step does.
Understand the board layout
The Nucleo-64 F401RE splits into two halves joined by a break-away tab. The top section is the ST-Link programmer with its mini or micro USB port; the bottom section is the STM32 target with Arduino-style headers and ST morpho headers. The USB port marked "ST-Link" is the one you connect to your computer.
Install the STM32 board package
Open the Arduino IDE, go to File then Preferences, and add this URL to "Additional boards manager URLs": https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json. Open Tools, Board, Boards Manager, search "STM32 MCU based boards", and install the STMicroelectronics package (Arduino_Core_STM32). This installs the compiler and the upload tools.
Install ST-Link drivers
Install STM32CubeProgrammer from the ST website; it bundles the ST-Link USB driver on Windows. Plug the Nucleo into USB. A small drive named NODE_xxxx may appear, which is the mass-storage flashing feature. The board is now powered and the green LD1 power LED should be lit.
Select the board and port
In Tools, set Board to "Nucleo-64", then set "Board part number" to your exact model, for example "Nucleo F401RE". Set Upload method to "STM32CubeProgrammer (SWD)". Under Port, select the COM port that appeared when you plugged in the board; this is used for the serial monitor, not for flashing over SWD.
Upload a test program
Open File, Examples, Basics, Blink. The Nucleo core already maps the onboard green LED to LED_BUILTIN, so no pin edit is needed. Click Upload. The IDE compiles, then flashes the target through the onboard ST-Link. The user LED (LD2) should blink once per second. To confirm serial works, upload a sketch that prints to Serial at 115200 baud and open the Serial Monitor.
If it does not upload
If the IDE reports it cannot find the ST-Link, close any STM32CubeIDE or CubeProgrammer window that may be holding the connection, then retry. Use a known-good data USB cable; charge-only cables are a frequent cause of silent failure. If the board firmware is old, CubeProgrammer will offer an ST-Link firmware upgrade, which is safe to accept.
Build it with Compoden's AI
Describe your project to Compoden's AI build assistant, for example a temperature monitor or a stepper test rig, and it recommends the right Nucleo model and supporting parts, lays out the header connections, and writes starter code that targets the Nucleo core and LED_BUILTIN. The kit ships to you in India ready to assemble, so the first thing you do is run your idea, not chase driver issues.
Tell Compoden's AI assistant what you want to build and get a Nucleo kit prepared for it. You can also browse the Nucleo-64 F401RE or the wider catalog.
FAQ
Do I need a separate ST-Link with a Nucleo? No. The Nucleo has an ST-Link debugger built onto the top section, so a single USB cable handles power, programming, and debugging.
Which USB port do I plug into? Use the port labelled "ST-Link" or "USB ST-Link". The other connector on some boards is a user USB for the target MCU and is not used for flashing.
Can I cut off the ST-Link section? You can break it away to use the target standalone, but most people keep it attached because it is the easiest way to program and debug.