helium / stm32-lora-disco-rs

Unofficial Rust Board Support Crate for B-L072Z-LRWAN1
8 stars 4 forks source link

stm32-lora-disco-rs

About

This is an unofficial Board Support Crate (BSC) for using the STMicroelectronics B-L072Z-LRWAN1 Discovery with the Rust programming language.

It is currently in its early stages. Documentation is sparse and features are basic. Pull requests welcome!

Usage

ST-Link & OpenOCD

The easiest way to flash code to the LoRa Discovery board is to use the on-board ST-Link and OpenOCD

Compiling the most recent version of OpenOCD is helpful, as support for this part has improved and most distributions provide a rather old version of OpenOCD.

To start the debug server, from this project directory, do: openocd -f ./openocd.cfg

JLink & JLinkServer

If you have a preference for JLink, you can actually turn the ST-Link into a JLink debugger.

Download the JLink server utility if you don't have it.

To run JLink server: JLinkGDBServer -device STM32L072CZ -speed 4000 -if swd -AutoConnect -1 -port 3333

Open .cargo/config and uncomment the runner that matches your preferred configuration (comment all other ones). Then you can flash an example program like this:

cargo run --example longfi