Programming STM32F7 boards with the Arduino 2.0 IDE on Arch

Kim Il
2 min readSep 2, 2021

--

How to use the new Arduino IDE 2.0 with STM32F7 boards on Linux

Add STM32 boards support to Arduino:

In File/Preferences/Additional Boards Manger URLS add:

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

In the Board Manager select STM32 MCU based boards, and install.
Coffee, download needs some time.

Select the Board: Nucleo-144 family (mine)
Select the Board part number: STM32F767ZI (mine)

If you have a board manufactured by ST which integrate a ST-Link: Nucleo, Discovery, Eval - there is no additional step needed for upload. Use Upload Methods: Mass storage.

If the Mass storage upload does not work, you will need the STM32CubeProgrammer:

yay -S stm32cubeprog

If you have problems uploading please checkout this wiki

Open the Blink example, modify the delays and add Serial outputs for use with the Serial Monitor, click Upload. Coffee.

/* 
Blink

Blink example for an STM32F767ZI

Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO it is attached to digital pin 13, on MKR1000 on pin 6.
LED_BUILTIN is set to the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products

modified 8 May 2014 by Scott Fitzgerald
modified 2 Sep 2016 by Arturo Guadalupi
modified 8 Sep 2016 by Colby Newman
modified 9 Jul 2021 by Kim Il Yong
This example code is in the public domain.

https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/

#include <Wire.h>
#include <elapsedMillis.h>

elapsedSeconds secondsRuntime;

// the setup function runs once when you reset or power the board
void setup() {
Serial.begin(115200);
while (!Serial); // STM32F767ZI: wait for serial monitor

// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.println("Blink Uploaded with MassStorage");
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on
delay(3000); // wait for 3 seconds
digitalWrite(LED_BUILTIN, LOW); // turn the LED off
delay(500); // wait for 0.5 seconds
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on
delay(500); // wait for 0.5 seconds
digitalWrite(LED_BUILTIN, LOW); // turn the LED off
delay(500); // wait for 0.5 seconds

Serial.println(secondsRuntime); // Print seconds elapsed
}

Select the Port for the Serial monitor and set baud to 115200

Blink Uploaded with MassStorage
4
8
12

BOOM!

--

--