Basic project setup #1

Merged
an.tsouchlos merged 7 commits from feature/project_setup into master 2024-11-01 23:49:57 +00:00
3 changed files with 33 additions and 1 deletions
Showing only changes of commit 903a1af075 - Show all commits

View File

@ -1,6 +1,12 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))'] [target.'cfg(all(target_arch = "arm", target_os = "none"))']
# replace nRF82810_xxAA with your chip as listed in `probe-rs chip list` # replace nRF82810_xxAA with your chip as listed in `probe-rs chip list`
runner = "probe-rs run --chip nRF52810_xxAA" runner = "probe-rs run --chip nRF52810_xxAA"
#runner = "probe-rs download --chip nRF52810_xxAA"
[alias]
rr = "run --release"
f = "flash --chip nRF52810_xxAA --reset-halt"
fr = "flash --chip nRF52810_xxAA --release --reset-halt"
[build] [build]
target = "thumbv7em-none-eabi" target = "thumbv7em-none-eabi"

4
Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM rust:latest
RUN rustup target add thumbv7em-none-eabi
RUN curl --proto '=https' --tlsv1.2 -LsSf https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.sh | sh

View File

@ -1,3 +1,25 @@
# CommonSense_SW # CommonSense_SW
Firmware for the CommonSense project. Firmware for the CommonSense project.
## Compiling and running
1. Build the docker image
```bash
$ docker build . -t commonsense
```
2. Build the firmware
```bash
$ docker run --rm -v $PWD:$PWD -w $PWD -u $(id -u):$(id -g) commonsense cargo build --release
```
3. Flash / run the firmware
```bash
$ docker run --privileged -v /dev/bus/usb/:/dev/bus/usb --rm -v $PWD:$PWD -w $PWD -u $(id -u):$(id -g) commonsense cargo fr
$ # OR
$ docker run --privileged -v /dev/bus/usb/:/dev/bus/usb --rm -v $PWD:$PWD -w $PWD -u $(id -u):$(id -g) commonsense cargo run --release
```
## Notes
- If flashing fails after being successful the first time, take a look at this:
https://users.rust-lang.org/t/probe-rs-fails-to-work-after-first-time-use-successful/103234