Rust bindings for Semtech 12xx LoRa radios
You can use cargo to build:
cargo build [--release]
The configuration in .cargo/config
is configured to build only for the thumbv6m-none-eabi
platform currently.
The code in the example directory is for the STM32L0 Discovery kit, which features the STM32L072CZ.
To upload the code, start a debug server using either JLink (Note: you can reprogram the ST-Link on the discovery kit to act like a JLink Server; you will lose the virtual UART over USB provided by the ST-Link):
JLinkGDBServer -device STM32L072CZ -speed 4000 -if swd -AutoConnect -1 -port 3333
or OpenOCD server (Note: if you are using the OpenOCD server, you will want to update .cargo/config:runner
to use openocd.gdb
instead of jlink.gdb
):
openocd -f ./openocd.cfg
run the example:
cargo run --example stm32l0x2 [--release]
Run tests:
cargo test --target x86_64-unknown-linux-gnu --tests
Here's a quick list of things to get your started with a build system on Ubuntu
sudo apt-get install g++-multilib libc6-dev-i386 gcc-arm-none-eabi libnewlib-arm-none-eabi cmake llvm-dev
llvm-config missing
On Ubuntu 20, for example, do:
sudo apt install llvm-dev
fatal error: 'gnu/stubs-32.h' file not found
32-bit libc dev missing. On Ubuntu 20, for example, do:
sudo apt install libc6-dev-i386