WORK IN PROGRESS
stm32l0xx-hal is a Hardware Abstraction Layer (HAL) for the STMicro STM32L0xx family of microcontrollers.
This crate relies on Adam Greig's stm32l0 crate to provide appropriate register definitions and implements a partial set of the embedded-hal traits.
Based on the stm32l1xx-hal crate by Vitaly Domnikov and the stm32f4xx-hal crate by Daniel Egger.
- stm32l0x1
-
Rustup toolchain installer
$ rustup target add thumbv6m-none-eabi
$ cargo build --release --examples --features stm32l0x1,rt
-
Download and install the arm-none-eabi gcc toolchain
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads We recommend installing the precompiled binaries to '/usr/local'. Add the bin folders (/bin & /arm-none-eabi/bin) to your environments variable 'PATH'.
-
Install STLink Tool
-
Install OpenOCD
-
Install GDB Dashboard (OPTIONAL)
The following is a how-to on flashing the 'serial' example code. This can be extended to any other example code.
-
Generate the hex file
$ arm-none-eabi-objcopy -O ihex target/thumbv6m-none-eabi/release/examples/serial serial.hex
-
Flash the microcontroller
$ st-flash --format ihex write serial.hex
- Revert local dependencies to external cargo and uncomment configurations before committing
0-Clause BSD License, see LICENSE-0BSD.txt for more details.