Skip to content
Shop

STM32 MCU: Arduino IDE Setup

Set up with your favorite AI

Gemini & other AI

Copy the setup prompt into your AI. Work through each step together, from checking your kit to getting it running.

Open Gemini

Copy the prompt, then paste it into Gemini’s message box.

View prompt

  • STM32 MCU leaf (AP03 / STM32L452REI6)
  • Basic Kit
  • A Windows, macOS, or Linux computer

Install STM32CubeProg to upload programs to the MCU.1 The linked download information is in Japanese.

  1. Open the Arduino software download page.
  2. Under Downloads, select the installer for your operating system.
  3. Follow the installer instructions. See the installation walkthrough (Japanese) for more detail.

Older versions are available from Previous IDE Releases.

Connect Leafony to your computer using a USB cable.

Configuration of the microcontroller board

Section titled “Configuration of the microcontroller board”
  1. Install the board package distributed by Leafony STM32. Open File → Preferences and add the following to Additional Boards Manager URLs.2

https://github.com/Leafony/BoardManagerFiles/raw/master/Leafony_STM32_v3/package_leafony_stm_index.json

  1. Open Tools → Board → Boards Manager.
  2. Search for Leafony and install it. Installation may take several minutes. The Leafony_STM32_v3 package distributes version 1.9.2-R00 (checked September 15, 2026).

  1. Select Tools → Board → Leafony STM32.

  1. Select Tools → Board part number → Leafony STM32 MCU. The default clock is 80 MHz; a 16 MHz board option is also provided for lower-power operation.

  1. Select the connected port under Tools → Serial Port. If no port is available, see Serial port not found.

Checking the operation of the microcontroller board

Section titled “Checking the operation of the microcontroller board”
  1. Set the STM32 MCU program switch to Program, then press the reset switch.

  1. Follow the temperature and humidity sensor example to upload the program. Uploading may take some time. A successful upload displays Start operation achieved successfully. If that message is absent, the program will not run correctly.3

  1. When uploading finishes, return the program switch to Run. The LED turns off.
  2. Press the reset switch to start the program. Check that temperature and humidity values appear.

With this Leafony board definition, specify pins by Name or Port.

Some leaves require additional libraries. Follow the library installation instructions.

The timer-interrupt library MsTimer2.h is for AVR MCU and cannot be used with STM32 MCU. Use HardwareTimer as described below.

See the HardwareTimer documentation for details. This is an example of initialization:

HardwareTimer *timer2 = new HardwareTimer (TIM2);
timer2->setOverflow(LOOP_INTERVAL, MICROSEC_FORMAT); // 125ms
timer2->attachInterrupt(intTimer);
timer2->resume();

Interrupt routine:

void intTimer(void){
bInterval = true;
 
 
}

See the FAQ for troubleshooting.

  1. Historical testing recorded Windows 64-bit with versions 2.12.0, 2.6.0, and 2.4.0. Version 2.5.0 did not work in that testing.

  2. The Boards Manager URL changed when the package was updated from Leafony_STM32 to Leafony_STM32_v3. See the Leafony board package README.

  3. If uploading is attempted without setting the switch to Program, the IDE may still display Writing to the board is complete, while the output below contains Timeout error occured while waiting for acknowledgement. The program will not run correctly.