██████╗ ██████╗ ██████╗ ██╗██████╗
██╔════╝██╔═══██╗██╔════╝ ██║██╔══██╗
██║ ██║ ██║██║ ███╗██║██████╔╝
██║ ██║ ██║██║ ██║██║██╔═══╝
╚██████╗╚██████╔╝╚██████╔╝██║██║
╚═════╝ ╚═════╝ ╚═════╝ ╚═╝╚═╝
This repository contains firmware source code of Cogip robot for Eurobot, French robotic contest. Its firmware intends to run on stm32f4xx MCU family and rely on RIOT-OS.
As this firmware and RIOT-OS are both evolving, two git repositories lives next to each other, and both are required to generate the firwmare binaries.
$ git clone https://github.com/cogip/RIOT.git -b cogip_master
$ git clone https://github.com/cogip/mcu-firmware.git
To install toolchain and development on ubuntu 20.04:
$ sudo apt install build-essential gcc-multilib g++-multilib openocd
Minimal gcc version: 8.1
To manually install arm-none-eabi toolchain:
$ mkdir ~/toolchain/
$ cd ~/toolchain/
$ wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2018q4/gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2
$ tar xf gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2
Edit ~/.bashrc file and add $HOME/toolchain/gcc-arm-none-eabi-8-2018-q4-major/bin/ to $PATH variable:
PATH=${PATH}:$HOME/toolchain/gcc-arm-none-eabi-8-2018-q4-major/bin/
Quilt is a tool to manage large sets of patches by keeping track of the changes each patch makes. It is used to apply patches on RIOT-OS
$ sudo apt install quilt
Cqfd wraps commands to run them inside the Docker container using your host current user. It can be configured with some pre defined commands called flavors and it can produce release artifacts.
To install cqfd:
git clone [email protected]:savoirfairelinux/cqfd.git
cd cqfd/
sudo make install
For more information: cqfd repository
$ sudo apt install python3-pip python3-venv
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r mcu-firmware/requirements.txt
Prior to any build, apply RIOT-OS patches
make riot-patches
Assuming the platform is pf_test and the application is app_test
$ make -j$(nproc) -C applications/<application_name>
$ make -j$(nproc) BOARD=<board_name> -C applications/<application_name>
This command has to be done once per project:
$ cqfd init
$ cqfd -b app_test-native
$ make -j$(nproc) BOARD=<board_name> -C applications/<application_name> all-debug
$ ddd applications/<application_name>/bin/<board_name>/<binary>.elf
Make sure JTAG programmer is plugged on target board.
$ make -j$(nproc) BOARD=<board_name> -C applications/<application_name> flash
$ make DBG=ddd DBG_FLAGS='--debugger "${GDB} ${DBG_DEFAULT_FLAGS}"' debug
Then, inside DDD application, in gdb prompt, type
target remote localhost:3333
To debug specific function, type
list <functionname>
$ make
$ make clean
$ make distclean
$ make doc docman doclatex
$ make docclean
$ make check-codingrules