-
Notifications
You must be signed in to change notification settings - Fork 1
STM32 arduino config
-
Download and install the Arduino 1.8.x IDE (https://www.arduino.cc/en/software).
-
Open Arduino and navigate to File > Preferences. Add the following URL to the "Additional Board Manager URLs" field:
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
. Restart the Arduino application. -
Open Tools > Board > Boards Manager. Search for "stm32" and install the "STM32 MCU based boards" package.
-
Download and install the STM32CubeProgrammer (https://www.st.com/en/development-tools/stm32cubeprog.html). If you're on Windows, make sure you install the 64 bit version.
Pro tip: if you don't want to create an ST account, use one from BugMeNot to login.
-
Configure the Arduino IDE to connect to the appropriate board
a. Select Tools > Board > STM32 Board Groups > Generic STM32F1 Series
b. Configure the rest of the Tools parameters to match the screenshot below. If you are using the blackpill, change the "Board part number" to "BlackPill F103C8".
-
Wire up the STLink to the STM32. Ensure that your wiring is correct, as incorrect wiring can destroy the device. Also, make sure only one power source is connected to the STM32 at a time.
-
Click the "Upload" button to compile and upload your code to the STM32. This can take a while when using non-genuine STM32s.
If you want to write your Arduino code in a different IDE (ex. VSCode, CLion, etc.), you can select File > Preferences > Use external editor. This will disable the edit functionality of the Arduino IDE. To upload, you will need to save the file in your IDE of choice and then switch to the Arduino IDE and click "Upload".