Description
Some background
Currently, getting anything more complex than examples/rust-hello-world running is undocumented, and really hard without advanced knowledge of how the RIOT build-system works.
I personally have only limited experience with Rust, Cargo and RIOT. In the following, I will list some difficulties I encountered.
Areas that require documentation
Creating a RIOT Rust module or RIOT wrapper
Setting up out-of-tree builds
Using RIOT C-modules that are neither in riot-wrappers nor in riot-sys
Mismatched riot-sys exports:
Getting some sweet language support
Description
Some background
Currently, getting anything more complex than
examples/rust-hello-worldrunning is undocumented, and really hard without advanced knowledge of how the RIOT build-system works.I personally have only limited experience with Rust, Cargo and RIOT. In the following, I will list some difficulties I encountered.
Areas that require documentation
Creating a RIOT Rust module or RIOT wrapper
riot-wrapperscrateSetting up out-of-tree builds
Using RIOT C-modules that are neither in
riot-wrappersnor inriot-sysriot-headers.h.riot-headers.hbe extended?.cargoregistry works, but this is no clean solutionriot-wrappersandriot-sysfrom git, modifying them, and then pointing to them inCargo.tomlkinda works. Even if I check-out to the exact version stated in the.cargoregistry, I get some warnings (e.g.gnrc_netif_dev_is_6lo redeclared with a different signature) -- this solution cannot be right eitherMismatched riot-sys exports:
riot_sys::mutex_lock()andriot_sys::inline::mutex_lock()work withriot_sys::inline::mutex_tand will not compile when supplied withriot_sys::mutex. But usingriot_sys::inline::mutex_twill then not work with e.g.riot_sys::ztimer_mutex_lock(). What is the workaround in this case?Getting some sweet language support
.cargo/config.tomlsee discussion belowmy experience with vscode: the C bindings generated byriot-sysin./targetare not seen by rust-analyzer. This perhaps boils down to the fact that this is no pure cargo build.would be nice to have a proper integration in at least one code editor- seems that rust-analyzer can be configured independently