2020-12-30 01:09 AM
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:
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
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:
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:
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
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
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
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
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.
Solved! Go to Solution.
2021-01-10 06:14 PM
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
2021-01-08 12:01 AM
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
2021-01-10 06:14 PM
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