This project demonstrates how to create a simple LED blinking application using STM32CubeIDE on the RT-Thread RT-Spark Development Board powered by the STM32F407ZGT6 microcontroller. The goal of this activity is to help beginners understand basic STM32 development, GPIO configuration, and firmware flashing.
ObjectivesThe objective of this laboratory activity is to introduce students to the basic workflow of STM32 firmware development using the RT-Thread RT-Spark Development Board. This activity aims to guide beginners through the installation of STM32CubeIDE and STM32CubeMX on a Windows operating system, the creation of a new STM32 project using the STM32F407ZGT6 microcontroller, and the configuration of GPIO pins for LED control. It also focuses on writing a simple LED blinking program using STM32 HAL functions, building and flashing the firmware to the development board, and documenting the completed project by uploading the source code to GitHub and publishing a project on Hackster.io.
- RT-Thread RT-Spark Development Board (STM32F407ZGT6)
- USB cable
- Windows PC
- STM32CubeIDE
- STM32CubeMX
- Git and GitHub
- Hackster.io
The RT-Thread RT-Spark Development Board uses the STM32F407ZGT6 microcontroller and includes onboard LEDs connected to GPIO pins PF11 and PF12. By configuring these pins as GPIO outputs and toggling them in the main loop, a visible LED blinking effect is achieved.
Step-by-Step ProcedureInstalling the Development ToolsSTM32CubeIDE and STM32CubeMX were installed on a Windows system using the official installers from STMicroelectronics. Default installation settings were used.
Creating the STM32 ProjectA new STM32 project was created using STM32CubeMX by selecting the STM32F407ZGT6 microcontroller. The project was generated and opened in STM32CubeIDE.
Pins PF11 and PF12 were configured as GPIO output pins to control the onboard LEDs.
The following code was added inside the infinite loop in main.c:
HAL_GPIO_TogglePin(GPIOF, GPIO_PIN_11);
HAL_GPIO_TogglePin(GPIOF, GPIO_PIN_12);
HAL_Delay(500);
This causes the LEDs to toggle every 500 milliseconds.
The project was built successfully in STM32CubeIDE and flashed to the RT-Spark board using the default ST-Link configuration.
After flashing the firmware, the onboard LEDs blinked at a steady interval. Changing the delay value affected the blink speed, confirming correct program execution.
The complete source code for this project is available on GitHub:
https://github.com/rheavencbl/rt-spark-blink-led
Conclusion
This project demonstrates a basic STM32 LED blinking application using STM32CubeIDE. It serves as a foundation for learning more advanced STM32 development concepts in future projects.
AcknowledgmentThis laboratory activity was completed as part of an academic requirement under the guidance of Paul Rodolf P. Castor, M.Sc.


Comments