I am currently exploring firmware programming to see how code interacts with hardware. For this project, my goal was to try running firmware on a real device, practice adjusting the code, and implement version control to keep track of my changes.
What is RT-Spark?
The RT-Spark is a development board powered by the STM32F407ZGT6 microcontroller. It serves as a hardware platform for learning embedded systems, giving developers direct access to the chip's features for building custom projects.
What did I do in this project?
I wrote a simple program to make the on-board LED blink, which helped me practice the fundamentals of firmware development. This story documents my entire process, showing how I configured the hardware in STM32CubeIDE and managed my project using Git and GitHub.
REQUIRED MATERIALS
Hardware
- RT-Spark Development Board
- PC/Laptop
- USB-A to USB-C Connector
Software
- STM32CUBEIDE
- STM32CUBEMX
- Git (Optional)
Programming Language/s
- C
Websites
- https://github.com/christinegallarde25/rt-spark-blink-led. (Github Repository)
- https://www.st.com/en/development-tools/stm32cubemx.html (STM32CUBEMX Download Site)
- https://www.st.com/en/development-tools/stm32cubeide.html (STM32CUBEIDE Download Site)
- https://git-scm.com/install/windows (Git Windows Download Site **Optional)
Chip Schematic
Code
HAL_GPIO_TogglePin(GPIOF,GPIO_PIN_11);
HAL_GPIO_TogglePin(GPIOF,GPIO_PIN_12);
HAL_Delay(1000);`
Step1:Installing the Required Softwares
1. Download STM32CUBEMX from Download Site: <https://www.st.com/en/development-tools/stm32cubemx.html>
2. Download STM32CUBEIDEfrom Download Site:
<https://www.st.com/en/development-tools/stm32cubeide.html>
3, Download Git from Download Site:
<https://git-scm.com/install/windows>
`
STEP2: Pin Configuration on STM32CUBEMX
1. Create a NewSTM32Project. Since the RT-Spark uses the STM32F407ZGT6 chip, Choose STM32F407ZGT6 in the MCU/MPU Selector then click on StartProject.
2. Since the RT-Spark uses Port F Pins 11 & 12 for its LED, configure these two pins as GPIO_Output.
3. Click Generate Code.
`
STEP3: Adjust the code
1. Open the saved STM32CUBEMX file in STM32CUBEIDE, then navigate to: Core>Src>main.c and insert the code inside the whileloop inside intmain(void)
The code:
HAL_GPIO_TogglePin(GPIOF,GPIO_PIN_11);
HAL_GPIO_TogglePin(GPIOF,GPIO_PIN_12);
HAL_Delay(1000);`
STEP4: Build and Flash to RT-Spark
1. Build the code.
2. Connect the RT-Spark to your PC/Laptop using the USB-A to USB-C Connector, the USB-A will be connected to the PC/Laptop and the USB-C will be connected the DBG port on the RT-Spark.
3. Flash the code into the RT-Spark.
VIDEO DEMO
`
STEP 5 (Optional): Upload Project to Git/Github
1. Create a new repository on Github.
2. Go to the project folder, and type CMD on the AddressBar.
2. Upload the project to Github
In the command prompt, enter:
git initthen:
git add .make sure to include the dot at the end, then:
git commit -m "<your commit message>"Usually in the commit message, if it's the first upload you input "First commit" sometimes followed by the project name, in this scenario e.g. ( First commit: STM32F407ZGT6 Blink LED), after this, it typically gives you an error (*if it's your first time uploading a project to a Github repository), just follow the instructions and once done just run the previous code again.
Next is:
git remote add origin "Your_Reposity_URL".gitMake sure that you add.git after your repository URL for it to work, then:
git branch -M mainthen:
git push -u origin mainAfter this, (*if it's your first time uploading a project to a Github repository) you will get a message that asks you to login to your Github account, just do it and follow the instructions for the project to be uploaded in your repository.
`
CONCLUSION
This project might seem simple, but it was a great way to get comfortable with the STM32 toolchain and version control. Now that I have the environment set up and the workflow down, I am ready to explore more complex features of the RT-Spark board. Feel free to check out my code in the GitHub repository link.



Comments