Skip to content
Free US shipping on orders $35+
Order by 3pm ET — ships same-day from the US
Free US shipping on orders $35+
Skip to main content

STM32 Black Pill Arduino IDE: Upload via DFU Bootloader | ShillehTek

April 18, 2026

STM32 Black Pill Arduino IDE: Upload via DFU Bootloader | ShillehTek
Project

Set up Arduino IDE for the STM32F411 Black Pill and upload a blink sketch via DFU using STM32CubeProgrammer for a fast, no-programmer workflow from ShillehTek.

30 hr Beginner to Intermediate1 parts

Project Overview

Programming the STM32 Black Pill with Arduino IDE: In this guide, you will set up and program the STM32F411 Black Pill development board using the Arduino IDE and the built-in DFU bootloader to upload a simple LED blink sketch.

The Black Pill is an upgraded version of the classic Blue Pill, featuring a more capable Cortex-M4F ARM processor with built-in DFU bootloader support.

  • Time: 30 minutes to 1 hour
  • Skill level: Beginner to Intermediate
  • What you will build: A complete Arduino IDE setup for STM32 Black Pill programming, verified with a simple LED blink sketch uploaded via DFU bootloader.
STM32F411 Black Pill development board used for Arduino IDE DFU programming
The STM32F411 Black Pill - a compact and powerful ARM Cortex-M4F development board.

Parts List

From ShillehTek

External

  • USB-C cable - to connect the Black Pill to your computer for programming and power
  • Computer with Windows OS and Arduino IDE installed

Note: This tutorial focuses on the STM32F411CE variant. If you have the STM32F401CC version, the steps are nearly identical - just select "BlackPill F401CC" instead of "BlackPill F411CE" when choosing the board part number. Both variants support the DFU bootloader covered here.

Step-by-Step Guide

Step 1 - Download and Install Arduino IDE

Goal: Get the Arduino IDE installed on your computer so you can write and upload code to the Black Pill.

What to do: Head over to the official Arduino website at arduino.cc/en/Main/Software and download the latest version of the Arduino IDE for your operating system. Follow the installation instructions for your platform - Windows users can find a guide at arduino.cc/en/Guide/Windows and Mac users at arduino.cc/en/Guide/MacOSX.

Expected result: Arduino IDE is installed and ready to launch on your computer.

Step 2 - Install the STM32 Board Package in Arduino IDE

Goal: Add STM32 board support to the Arduino IDE so it recognizes the Black Pill.

What to do: Open the Arduino IDE and navigate to File > Preferences. In the Additional Board Manager URLs field, paste the following URL:

https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json

If you already have other URLs in that field, separate them with a comma.

Arduino IDE Preferences dialog showing the Additional Board Manager URLs field for STM32 support
Add the STM32 board manager URL in the Arduino IDE Preferences window.

Next, go to Tools > Board > Boards Manager. Search for "STM32" and install the latest version of the STM32 MCU based boards package. This download is several hundred megabytes, so it may take a few minutes.

Arduino Boards Manager showing STM32 search results for installing STM32 MCU based boards
Search for STM32 in the Boards Manager to find the official board package.
Arduino Boards Manager installing the STM32 MCU based boards package
Click Install and wait for the package to finish downloading.

Once installation is complete, close and reopen the Arduino IDE to apply the changes.

Expected result: The STM32 board package is installed and you can see STM32 options under the Tools > Board menu.

Step 3 - Install STM32CubeProgrammer

Goal: Install the STM32CubeProgrammer tool, which is required for uploading code via the DFU bootloader.

What to do: Download STM32CubeProgrammer from the official ST website at st.com/en/development-tools/stm32cubeprog.html. Install it on your computer following the default settings.

ST website page for downloading STM32CubeProgrammer used for DFU uploads
Download STM32CubeProgrammer from the ST Microelectronics website.

Launch it once after installation to verify it works, then close it. The Arduino IDE will call it automatically during uploads.

STM32CubeProgrammer main interface window opened to verify installation
The STM32CubeProgrammer interface - you only need to verify it launches correctly.

Expected result: STM32CubeProgrammer is installed and launches without errors.

Step 4 - Configure the Arduino IDE for Black Pill

Goal: Set all the correct board and upload options in the Arduino IDE Tools menu.

What to do: In the Arduino IDE, configure the following settings under the Tools menu:

  • Board: Go to Tools > Board > STM32 boards and select Generic STM32F4 series
Arduino IDE board selection showing Generic STM32F4 series for STM32 Black Pill
Select Generic STM32F4 series from the board menu.
  • Board Part Number: Select BlackPill F411CE (or BlackPill F401CC if using the F401 variant)
Arduino IDE Tools menu showing Board Part Number set to BlackPill F411CE
Choose BlackPill F411CE as the board part number.
  • USB Support: Select CDC (generic \"Serial\" supersede U(S)ART)
Arduino IDE Tools menu showing USB Support set to CDC generic Serial mode
Enable CDC Serial support under USB Support.
  • Upload Method: Select STM32CubeProgrammer (DFU)
Arduino IDE Tools menu showing Upload Method set to STM32CubeProgrammer DFU for STM32 Black Pill
Set the upload method to STM32CubeProgrammer (DFU).

Your final Tools configuration should look like this:

Complete Arduino IDE Tools configuration for STM32F411 Black Pill DFU upload
Complete Tools menu configuration for the STM32F411 Black Pill.

Expected result: All Tools menu settings are properly configured for uploading to the Black Pill via DFU.

Step 5 - Enter DFU Bootloader Mode and Upload a Sketch

Goal: Put the Black Pill into bootloader mode and upload a test blink sketch.

What to do: Connect the STM32 Black Pill to your computer using a USB cable. To enter DFU bootloader mode, use the onboard BOOT0 and NRST buttons with this sequence:

  1. Press and hold the BOOT0 button
  2. While still holding BOOT0, press and release the NRST (reset) button to power cycle the processor
  3. Release the BOOT0 button
STM32 Black Pill board showing BOOT0 and NRST buttons used to enter DFU bootloader mode
The BOOT0 and NRST buttons on the Black Pill used to enter DFU bootloader mode.

Now create a new sketch in the Arduino IDE and paste the following code. This simple program blinks the onboard LED connected to pin PC13 at a fast 0.1-second interval:

/* Blink onboard LED at 0.1 second interval */

void setup() {
  // initialize digital pin PC13 as an output
  pinMode(PC13, OUTPUT);  // LED connected to pin PC13
}

void loop() {
  digitalWrite(PC13, HIGH);   // turn the LED on
  delay(100);                 // wait for 100ms
  digitalWrite(PC13, LOW);    // turn the LED off
  delay(100);                 // wait for 100ms
}

Click the Upload button in the Arduino IDE. The code will compile and then upload to the Black Pill through the DFU bootloader. You should see a successful upload confirmation in the output console.

Arduino IDE output showing successful compilation and DFU upload to STM32F411 Black Pill
Successful compilation and upload of the blink sketch to the Black Pill.

Expected result: The blue onboard LED on the Black Pill blinks rapidly at 0.1-second intervals, confirming the upload was successful.

Conclusion

In this tutorial, you set up the Arduino IDE to work with the STM32F411 Black Pill development board using the DFU bootloader. You installed the STM32 board package, configured STM32CubeProgrammer, and successfully uploaded a blink sketch without needing an external programmer.

Want the exact parts used in this build? Grab them from ShillehTek.com. If you want help customizing this project or building something for your product, check out our IoT consulting services.

Credits: Photos and images are credited to SGBotic. Their original guide served as a reference for this version.