Getting Started with Programming the STM32F103C8 BluePill Using Arduino IDE

Introduction

This tutorial will guide you through setting up your STM32F103C8 BluePill microcontroller with the Arduino IDE. By the end of this tutorial, you'll have your BluePill board blinking its onboard LED.

Requirements

Step-by-Step Instructions

1. Install STM32 Boards in Arduino IDE

  1. Open the Arduino IDE.
  2. Go to File > Preferences.
  3. Arduino IDE Preferences
  4. In the Settings tab, find the Additional Boards Manager URLs field.
  5. Click the icon next to the field and paste the following URL:
  6. https://dan.drown.org/stm32duino/package_STM32duino_index.json
    Additional Boards Manager URLs
  7. Click OK to save the settings.

2. Install STM32F1 Boards

  1. Go to Tools > Board > Boards Manager.
  2. Boards Manager
  3. In the search bar, type STM32F1.
  4. Find STM32F1xx/GD32F1xx and click Install.
  5. Install STM32F1

3. Configure the BluePill for Programming

  1. Locate the jumpers near the reset button on the BluePill board.
  2. BluePill Jumpers
  3. Set BOOT0 to 1 (programming mode).
  4. Set BOOT1 to 0.
  5. Jumper Settings

4. Select the Board and Settings in Arduino IDE

  1. Go to Tools > Board and select STM32F1xx/GD32F1xx Boards > Generic STM32F103C Series.
  2. Select Board
  3. Under Tools, configure the following settings:
  4. Board Settings Board Settings_

5. Write Your First Sketch

Copy and paste the following Blink sketch into the Arduino IDE:

void setup() {
    pinMode(PC13, OUTPUT);
}

void loop() {
    delay(1000);
    digitalWrite(PC13, HIGH);
    delay(1000);
    digitalWrite(PC13, LOW);
}

Disclaimer: The provided code is for educational purposes only. The author is not responsible for any damage to your hardware or software.

6. Upload the Sketch

  1. Click the Upload button in the Arduino IDE.
  2. Upload Button
  3. Once the upload is complete, the onboard LED should start blinking.

7. Configure the BluePill for Running Mode

  1. Unplug the ST-LINKV2 or FTDI programmer.
  2. Set BOOT0 to 0 (running mode).
  3. Set BOOT1 to 0.
  4. Running Mode Jumper Settings

Conclusion

You have successfully programmed your STM32F103C8 BluePill using the Arduino IDE. The onboard LED should now be blinking, indicating that your setup is correct and your code is running.

Tutorial by RICHARD FOR TECHYRICH.COM

Happy coding!

Video Tutorial