ARM Cortex-M Semihosted "Hello World" in Rust with libcore
This is a simple experiment to see what is required to create a simple ARM Cortex-M "Hello World" program in Rust with only libcore. It was tested on an STM32F429I-DISCO board using an Arch Linux 64-bit development PC.
Dependencies
This project needs a GNU ARM Cortex-M cross-compiling toolchain for the linker, GDB, and other binary utilities. The one I used can be donwloaded from GNU Tools for ARM Embedded Processors.
Build
Build with cargo build --release.
Execution
With the STM32F429I-DISCO board connected to the host PC via USB, run openocd.sh in one terminal session and gdb.sh in another terminal session. In the GDB terminal session, type the following to deploy the binary to the board and begin execution:
monitor reset halt
load
monitor reset init
continue
You should then see "The number is x" printed repeatedly in the OpenOCD terminal session, with x increasing each time.