██████╗ ██████╗ ██████╗ ██╗██████╗
██╔════╝██╔═══██╗██╔════╝ ██║██╔══██╗
██║ ██║ ██║██║ ███╗██║██████╔╝
██║ ██║ ██║██║ ██║██║██╔═══╝
╚██████╗╚██████╔╝╚██████╔╝██║██║
╚═════╝ ╚═════╝ ╚═════╝ ╚═╝╚═╝
MCU firmware
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.
Build status
Environment setup
Cloning repositories
$ git clone https://github.com/RIOT-OS/RIOT.git -b 2020.07
$ git clone https://github.com/cogip/mcu-firmware.git
Requirements
To install toolchain and development on ubuntu 20.04:
$ sudo apt install build-essential gcc-8 gcc-8-multilib gcc-multilib openocd python-serial
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/
Simulation target (x86_64 architecture)
Assuming the platform is cogip2019-cortex-simulation
Build
Build one application with default board
$ make -j$(nproc) -C applications/<application_name>
Build one application with an other board
$ make -j$(nproc) BOARD=<board_name> -C applications/<application_name>
Build and launch in debugger (only for native cpu architecture)
$ make -j$(nproc) BOARD=<board_name> -C applications/<application_name> all-debug
$ ddd applications/<application_name>/bin/<board_name>/<binary>.elf
Build and flash (only for real board, not native based)
Make sure JTAG programmer is plugged on target board.
$ make -j$(nproc) BOARD=<board_name> -C applications/<application_name> flash
Start ddd on a gdbserver's target
$ 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>
General build targets
Build all applications on all boards
$ make
Clean all platforms
$ make clean
Distclean all platforms
$ make distclean
Generate doc in various formats
$ make doc docman doclatex
Clean doc
$ make docclean