Skip to content

A hello world project written in Rust for the STM32F3 MCU.

License

Notifications You must be signed in to change notification settings

phreaknik/stm32f3-rust-hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stm32f3-rust-hello-world

A serial loop-back project to use as a template for the Rust RTFM framework on the STM32F3 mcu. This project was developed using the STM32F3 Discovery Board, using the tutorials at blog.japaric.io for guidance.

This project is and embedded project, meaning rust-std is not applicable on our system. To build this project without rust-std, use Xargo instead of Rust's native Cargo.

Usage

Build:

$ xargo build

Connect to the STM32 with openocd over ST-Link:

$ openocd -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg

Attach a GDB debug session::

Note, this application uses semi-hosting to print "Hello, World!" to the console. To allow this, semi-hosting should be enabled in your GDB session, as shown below.

$ arm-none-eabi-gdb
>>> target remote :3333
>>> monitor arm semihosting enable
>>> load
>>> tb main
>>> step

You can now step through the program with GDB, or just run the program to see it pring "Hello, World!".

For convenience to anyone using VS Code, these steps have been added as custom tasks / launch config for VS Code.

License

Licensed under the MIT open source license.

About

A hello world project written in Rust for the STM32F3 MCU.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages