A port of Open Source Car Control written in Rust.
OxCC
runs on the NUCLEO-F767ZI STM32F767ZI board.
It is built around the traits and patterns provided by the embedded-hal project and community: see the BSP crate, the HAL crate, and the device crate.
Apart from the change in MCU/board, OxCC
combines all of the OSCC modules (throttle, brake, steering, CAN gateway) into a single application.
A new layout and schematic is currently in the works, check out the rough pinout to get started.
-
CAN
OxCC
uses the stm's on-board bxCAN controller. For a transceiver I've been using the SN65HVD230 from Waveshare.
- rust (nightly)
- svd2rust
- openocd (for debugging)
- gdb-arm-none-eabi (for debugging)
- binutils-arm-none-eabi (uses
objcopy
for device deployment) - stlink (for device deployment)
The default Cargo configuration will build for the Kia Soul EV
vehicle
with the panic-over-abort
strategy.
See the [features]
section of the Cargo.toml to change configurations.
- Install system package dependencies:
sudo apt-get install openocd sudo apt-get install gdb-arm-none-eabi sudo apt-get install binutils-arm-none-eabi
- Install
stlink
from source: guide - Install Rust nightly and additional components:
curl https://sh.rustup.rs -sSf | sh rustup install nightly rustup component add rust-src rustup component add rustfmt-preview --toolchain nightly rustup target add thumbv7em-none-eabihf
- Install
svd2rust
:cargo install svd2rust
- Build
OxCC
firmware:cargo build
Deploy the firmware Using st-flash
(provided by stlink
):
# Convert ELF to ihex format
arm-none-eabi-objcopy \
-O ihex \
target/thumbv7em-none-eabihf/release/oxcc \
target/thumbv7em-none-eabihf/release/oxcc.hex
# Upload to flash
st-flash \
--format ihex \
write \
target/thumbv7em-none-eabihf/release/oxcc.hex
In one terminal, start openocd
:
openocd -f board/stm32f7discovery.cfg
In the OxCC
terminal, use the runner to start a gdb
session:
cargo run
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.