cancel
Showing results for 
Search instead for 
Did you mean: 

Light up your LED in 30 seconds with 3 methods!

Davis
Associate

Light up the LED in 30 seconds with 3 methods.

1. Install IDE

Step 0. Prepare Hardware

The hardware used in this experience is ST's development board NUCLEO-F411RE, and the development board number is MB1136. If you don’t have this board, you can use other development boards instead, and modify the LED and USART pin configuration according to the actual hardware conditions.

hardware list:

  • NUCLEO-F411RE board
  • Mini-USB cable

Step 1 Install

RT-Thread Studio is a newly emerging embedded integrated development environment. It already joins ST Partner Ecosystem. After trial, it was found that it has relatively complete development, compilation, and debugging functions, complete support for STM32 series chips, and complete support for ST-Link J-Link DAP-Link debugger. Here to share the experience of using it.

The latest version of RT-Thread Studio is 2.0.0, which supports Windows 10 x64 operating system. The download link of RT-Thread Studio is

https://realthread-ide.rt-thread.org/Global/RT-Thread-Studio-setup-x86_64-latest.exe

After successful login, you can see the welcome page of the software

0693W000006H9DbQAK.png 

Step 2 Install PlatformIO Package

Close the welcome page, you can see the project manager and C/C++ development view, here we install some necessary resource packages to support the development of STM32 F411, the installation steps:

  1. Click the SDK manager icon
  2. Select PlatformIO 5.0.3.12 version
  3. Click the Install Package button to execute the installation

0693W000006H9DMQA0.png 

2. Light up the LED with Arduino Framework

Step 0 Create stm32f411re Arduino project

Click the Create Project button in the upper left corner of the IDE to create a new project. Here we choose to create General Project and choose to use the PlatformIO platform. The steps are as follows:

  • Create General Project
  • Select Base On PlatformIO
  • Search f411re
  • Select Nucleo_f411re board and Arduino framework

0693W000006H9DvQAK.png0693W000006H9DlQAK.png 

Step 1 Add LED Blink Code

The created nucleo_stm32f411re_arduino project is an empty project. Add the blinking code of the LED in src/main.cpp to realize the blinking of the LED.

#include <Arduino.h>
void setup() {
// write your initialization code here
    pinMode(LED_GREEN, OUTPUT);      // set LED_GREEN pin as output mode
    Serial.begin(115200);            // set Serial baudrate to 115200 bps
}
 
void loop() {
// write your code here
    digitalWrite(LED_GREEN, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(100);                      // wait for 100 millisecond
    digitalWrite(LED_GREEN, LOW);    // turn the LED off by making the voltage LOW
    delay(100);                      // wait for 100 millisecond
    Serial.print("hello world!\r\n");
}

Step 2 Build nucleo_stm32f411re_arduino project

After adding the LED blinking code in main.cpp and saving it, click the small hammer build icon to compile the project

0693W000006H9EFQA0.png 

Step 3 Download

Link the Mini USB cable to the development board, click the download button on the toolbar, and then the program can be downloaded

0693W000006H9EKQA0.png 

After the download is complete, you can see that the green LED starts to blink, the IDE integrates a serial port terminal, open the serial port terminal, connect to the serial port, you can see the "hello world" message

0693W000006H9EUQA0.png 

Step 4 Debug

RT-Thread Studio supports online simulation. Click the debug button on the toolbar to enter the debugging interface. The debugging simulation supports single-step, suspend and other debugging operations

0693W000006H9EeQAK.png 

0693W000006H9EjQAK.png 

The Community doesn't allow to post more than 10 photos, so please check out the other 2 methods on My Dev Channel: https://dev.to/davis87842333/the-easiest-way-to-light-up-the-stm32-board-from-zero-36o0

Share your methods below, and let's share.

1 ACCEPTED SOLUTION

Accepted Solutions
Davis
Associate

in fact, any chip from STM32 series can print "hello world" with just one click on RT-Thread Studio, you need not write any code

0693W000006I8H5QAK.png

View solution in original post

2 REPLIES 2
Imen.D
ST Employee

Hello @Davis​ ,

Welcome to the STM32 Community :smiling_face_with_smiling_eyes:

Thank you for sharing the interesting methods with all the steps in details. It is much appreciated!

This will be useful for Community users.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Davis
Associate

in fact, any chip from STM32 series can print "hello world" with just one click on RT-Thread Studio, you need not write any code

0693W000006I8H5QAK.png