Embed a rust static library alongside C code on a nRF52-DK (nRF52832).
Project template is based on "ble app blinky" example from nRF5 SDK.
At each compile from Segger Embedded Studio, pre-build.sh script is run. It will:
- compile rust library, which will:
- use rust-bindgen to generate a Rust bindings to C functions (bindings.rs)
- compile a rust static library (.a)
- use cbindgen to generate C bindings to Rust functions (rust_embedded_lib.h file)
- debugger seems to work for rust code, but we have to specify where to find .rs files, not found automatically by the IDE.
- can call Rust function from C code, passing and returning basic type.
- can call C function from Rust code.
- test interacting with peripheral
- try unofficial nrf HAL from https://github.com/nrf-rs/nrf-hal
- cargo
- cbindgen
- rust-bindgen
- segger embedded studio