In this lab exercise for BCA143 (Firmware Programming), I looked into how to combine C code with ARM assembly subroutines. The goal was to carry out basic text processing, string copying, and capitalization directly on the STM32F407ZGT6 (RT-Thread RT-Spark) development board.
The project uses a mixed-language approach:C Main Entry: Handles the high-level initialization and defines the character arrays.
Assembly Subroutines: * my_strcpy: Manually goes through memory addresses using LDRB (Load Register Byte) and STRB (Store Register Byte). It increments pointers until it reaches a null terminator.
- my_capitalize: Performs ASCII math. It checks if a character is in the lower-case range (a-z) and subtracts 32. This routine converts text to uppercase at the hardware level.
- The main part of this lab was following the ARM register use conventions. I learned how to do things.
- I learned how to pass information to functions using the ARM registers R0-R3.
- I figured out how to use the Link Register for getting to the right place when a function is done.
- I saw how the Program Counter tracks what the processor is doing at that moment using the debugger in the STM32CubeIDE.





Comments