Skip to content

car-hacking-village/DC32_CHV_Badge_Firmware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMake

CHV Car on a board

This project is intended to provide firmware for emulating a car on a single PCB.

Layout

/
└─── verification/
└─── firmware/
    └─── c
    └─── py
└─── tests/
└─── deps/

Verification

Files in this folder are for use by manufacturer to verify that all electrical connections are correct.

Firmware

Firmware folder contains the firmware which actually emulates the car.

Each language subfolder is dedicated to implementations for those langages. For example, the py folder contains the required integrations and code to run the emulation in python.

Tests

This should contain any unit tests or similar items.

Deps

Any source code dependencies needed to build the project

Requirments

You will need the following packages installed

gcc-arm-none-eabi
cmake

elftools

install elftools with:

pip install 'pyelftools>=0.25'

Building

NOTE: Run the following command to fetch git the dependencies.

git submodule update --init

To build run:

./build.sh

You can rebuild cleanly by running:

./build.sh clean

Flashing

WARNING: you need to remove main.py before uploading a new set of firmware. This will prevent a large number of issues involving automatic code execution.

Install ampy

pip3 install adafruit-ampy

Move to the release dir and start the install script

cd release
./install.sh

Press and hold the BootSel and Reset buttons. release the Reset button, then release the BootSel button. The script should take over from there.

cansniffer

rp3 is set up to log output in a format readable by socketcan. Run the following commands to get everything setup.

sudo slcand /dev/ttyACM0
sudo ip link set slcan0 up
cansniffer slcan0