https://github.com/thenewwazoo/chibios-rust
ChibiOS for Rust
https://github.com/thenewwazoo/chibios-rust
arm chibios chibios-rtos rtos rust rust-embedded
Last synced: about 1 year ago
JSON representation
ChibiOS for Rust
- Host: GitHub
- URL: https://github.com/thenewwazoo/chibios-rust
- Owner: thenewwazoo
- License: mit
- Created: 2017-08-05T04:17:21.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-08-25T15:58:59.000Z (almost 7 years ago)
- Last Synced: 2025-04-05T02:21:56.203Z (over 1 year ago)
- Topics: arm, chibios, chibios-rtos, rtos, rust, rust-embedded
- Language: C
- Homepage:
- Size: 38.1 KB
- Stars: 18
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ChibiOS is pretty cool. Rust is pretty cool.
This is an attempt to get ChibiOS useful via Rust. Or maybe it's to make Rust useful on ChibiOS.
Setup
-----
```bash
$ rustup override set nightly
$ cargo install xargo
$ brew install llvm # per https://rust-lang-nursery.github.io/rust-bindgen/requirements.html
```
Update the `memory.x` file to reflect the layout of your hardware.
Build
-----
Selecing your desired hardware is kind of an ugly process at the moment, and not very well
fleshed-out. ChibiOS requires a few flags to specify the port (i.e. CPU type), which we need
to pass in to the build script. As such, each CPU will need to get its own feature which will
gate compilation of `libchibios.a`, manage `bindgen`, as well as set handlers in `main.rs`.
See [`Cargo.toml`](Cargo.toml) to dive into it. If you're not adding your own chip, the following
are currently supported:
* `stm32f407xg`
* `stm32f051x8`
Pass them to Cargo using the `--features` flag, e.g.
```bash
$ xargo build --target thumbv7m-none-eabi --features stm32f407xg
```
Use
---
I like openocd and gdb.
```bash
$ openocd -f board/stm32f0discovery.cfg -c '$_TARGETNAME configure -rtos auto' -c 'gdb_port 3333' # or whatever
```