Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
stm32l0xx-hal
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.
Supported Configurations
- stm32l0x1
- stm32l0x2
Build Dependencies
-
Rustup toolchain installer
Toolchain Configuration
$ rustup target add thumbv6m-none-eabi
Build Examples
$ cargo build --release --examples --features stm32l0x1,rt
Using as a Dependency
To use this crate as a dependency, add the following definition to your Cargo.toml
:
[dependencies.stm32l0xx-hal]
version = "0.1.7"
features = ["stm32l0x1", "rt"]
Example Projects: HABEXpico
Dependecies for Flashing
-
Download and install the arm-none-eabi toolchain
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads We recommend installing the precompiled binaries to '/usr/local/opt'. Add the bin folders (/bin & /arm-none-eabi/bin) to your environments variable 'PATH'.
-
Install STLink Tool (>=v1.5.1)
-
Install OpenOCD (OPTIONAL)
NOTE: OpenOCD v0.10.0 does not fully support the stm32l0 family MCU. We recommend using
gnu-mcu-eclipse/openocd
instead:https://gnu-mcu-eclipse.github.io/openocd/install/ We recommend installing the precompiled binaries to '/usr/local/opt'. Add the bin folders (i.e. - /usr/local/opt/gnu-mcu-eclipse/openocd/0.10.0-12-20190422-2015/bin) to your environments variable 'PATH'.
-
Install GDB Dashboard (OPTIONAL)
Flashing
The following instructions outline how-to on flashing the 'serial' example code. This can be extended to any other example code.
Flashing with ST-Flash:
- Flash the microcontroller using the flash script
$ ./flash.sh target/thumbv6m-none-eabi/release/examples/serial
Flashing with OpenOCD
- Flash the microcontroller using the openocd flash script
$ ./openocd_flash.sh target/thumbv6m-none-eabi/release/examples/serial
Debugging
Debugging with GDB
-
Terminal 1 - OpenOCD Session:
$ ./openocd_session.sh
-
Terminal 2 - GDB Session:
$ ./gdb_session.sh target/thumbv6m-none-eabi/release/examples/serial
Debugging with GDB Py and GDB Dashboard
-
Terminal 1 - OpenOCD Session:
$ ./openocd_session.sh
-
Terminal 2 - Dashboard:
$ tty
Note the tty session. We will use this in the following steps. (i.e. "/dev/ttys001")
-
Terminal 3 - GDB Py Session:
$ ./gdb_session.sh target/thumbv6m-none-eabi/release/examples/serial -d >>> dashboard -output /dev/ttys001
Contibutor Notes
- Revert local dependencies to external cargo and uncomment configurations before committing
License
0-Clause BSD License, see LICENSE-0BSD.txt for more details.