Firmware for the CommonSense project.
Go to file
Andreas Tsouchlos 05dd72f55c Basic project setup (#1)
Reviewed-on: #1
Co-authored-by: Andreas Tsouchlos <an.tsouchlos@gmail.com>
Co-committed-by: Andreas Tsouchlos <an.tsouchlos@gmail.com>
2024-11-01 23:49:53 +00:00
.cargo Basic project setup (#1) 2024-11-01 23:49:53 +00:00
src Basic project setup (#1) 2024-11-01 23:49:53 +00:00
.gitignore Basic project setup (#1) 2024-11-01 23:49:53 +00:00
build.rs Basic project setup (#1) 2024-11-01 23:49:53 +00:00
Cargo.lock Basic project setup (#1) 2024-11-01 23:49:53 +00:00
Cargo.toml Basic project setup (#1) 2024-11-01 23:49:53 +00:00
Dockerfile Basic project setup (#1) 2024-11-01 23:49:53 +00:00
LICENSE Initial commit 2023-08-24 19:13:43 +00:00
memory.x Basic project setup (#1) 2024-11-01 23:49:53 +00:00
README.md Basic project setup (#1) 2024-11-01 23:49:53 +00:00
s132_nrf52_7.3.0_softdevice.hex Basic project setup (#1) 2024-11-01 23:49:53 +00:00

CommonSense

Firmware for the CommonSense project.

Compile and Run

The firmware depends on the S132 softdevice. Before running the firmware, the softdevice has to flashed to the chip.

Flashing the Softdevice

  1. Erase the chip
    $ probe-rs erase --chip nRF52832_xxAA
    
  2. Flash the softdevice
    $ probe-rs download --verify --binary-format hex --chip nRF52832_xxAA s132_nrf52_7.3.0_softdevice.hex
    

Compile and Run

  1. Install the required tools. Consult Dockerfile for specifics
  2. Build the firmware
    $ cargo build --release
    
  3. Flash / run the firmware
    $ cargo fr
    $ # OR
    $ cargo run --release
    

Compile and Run using Docker

  1. Build the docker image
    $ docker build . -t commonsense
    
  2. Build the firmware
    $ docker run --rm -v $PWD:$PWD -w $PWD -u $(id -u):$(id -g) commonsense cargo build --release
    
  3. Flash / run the firmware
    $ 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