Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

embedded-rust-experiments

In order to get a bit more of a feeling what rust is like on embedded devices, I did a couple of small experiments like blink, ..., etc. For these experiments I used the stm32F401 plus a couple of elecrical components like LEDs, potentiometers and resistors. In order to make the interaction with the hardware of this board a bit simpler, I make use of the stm32f4xx-hal crate, which simplifies a lot of this logic.

Each of the experiments can be found in their own dedicated file / folder. In order to run a specific one, make sure that it is being called in main.rs and comment the other ones out.

After connecting to the stm32 using a StLink, the project can be run using cargo build and cargo run. The run command will automaticaly fires up GDB and sets up the connection to OpenOCD.

Below you can find a short description of the experiments and the breadboard setup I used.

blink

This experiment blinks a number of LED's one by one.

adc_read

Reading the number of mV on pin 5 and printing it to the console.

blink_w_speed_control

Same as the blink experiment, but now the speed at which the LED's blink can be adjusted using a potentiometer.

spi_dac

Outputing a saw wave using the MCP4922 DAC. Make sure that the VRef is wired, otherwise the output will contain noise.

rtic_blink

Use the RTIC framework to schedule the blinking of the onboard LED using tasks and interrupts.

rtic_spi_dac

Use the RTIC framework to have a DAC output a triangle wave. Unfortunately it was not possible to reach a proper audio rate (44kHz+).

About

Some small experiments to explore the embedded side of Rust

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages