The dependencies of this repository are managed through the conan package manager. Make sure you have the following tools installed and on your PATH.
Tool | Version |
---|---|
ARM GCC (arm-none-eabi-gcc --version) | 13.3 |
CMake (cmake --version) | 3.30.1 |
Ninja (ninja --version) | 1.12.1 |
Conan (conan -v) | 2.5.0 |
OpenOCD (openocd -v) | 0.12.0 |
git clone git@github.com:PeakSat/OBC_Software.git
cd obc-eqm-software
- (If you haven't already) create a conan profile for your system:
conan profile detect
- Download all dependencies and build the project through conan:
conan install . --output-folder=cmake-build-debug --build="*" -u -pr conan-arm-profile
- Download all submodules:
conan source .
- Add CMake flags:
cmake -G Ninja -B cmake-build-debug/build/Debug -DCMAKE_TOOLCHAIN_FILE="cmake-build-debug/build/Debug/generators/conan_toolchain.cmake" -DCMAKE_CXX_COMPILER="arm-none-eabi-g++" -DCMAKE_C_COMPILER="arm-none-eabi-gcc" -DCMAKE_BUILD_TYPE=Debug .
- Build the project:
cd cmake-build-debug/build/Debug ninja
After Building the software the resulting binary should be at cmake-build-debug/build/Debug/OBC_software.elf
Upload the software using the following command.
openocd -f "atmel_samv71_xplained_ultra.cfg" -c "program cmake-build-debug/build/Debug/OBC_software.elf reset"
OpenOCD automatically opens a debug server to which you can connect using GDB if needed, as follows:
arm-none-eabi-gdb /path/to/compiled/binary_with_symbols.elf
Within GDB, run the following command to connect:
target extended-remote localhost:3333
This repository uses pre-commit
to automatically detect and fix code style inconsistencies. To set it up:
pip install pre-commit
pre-commit install # This should be executed inside this repository
# Execute the following in order to test the installation
pre-commit run
Note: For Linux users it is recommended for pre-commit to be installed inside a virtual environment.
Note: For Windows users, if the above installation does not work, you can try to run the commands by pre-fixing python -m
. Also some installations specify the pre-commit
package as pre_commit