How to setup build environment for Monimod
Monimod uses LLVM cross-compiler with additional COAST passes for additional software triplication. What you will need to compile Monimod firmware:
- COAST: https://github.com/byuccl/coast.git
- LLVM-7
- CLANG-7
- LLD-7
- newlib-3.1.0
- Compiler-RT
Alternatively you can use a docker image containing the whole environment pre-configured:
- Clone repository: https://gitlab.cern.ch/cgentsos/hdl-ci-dockerfiles/-/tree/master/
- Select docker image for Monimod microcontroller:
cd ARMv6m_GCC_Clang_COAST
- Build docker image:
docker build -t arm-clang-coast .
How to compile Monimod firmware
-
Clone the Monimod repository:
git clone https://ohwr.org/project/diot-monimod.git
cd diot-monimod
-
Start by compiling the bootloader using previously built docker image:
cd bootloader/build
./docker_build.sh
-
Then compile the main firmware using the docker image with desired Makefile parameters (e.g. select one of the Monimod variants VER=<FANT/RTSB/RATO> for FanTray/Rad-Tol System Board/RaToPUS):
cd ../../main_fw/build
./docker_build.sh VER=FANT
Programming Monimod
Monimod can be programmed over JTAG using Segger J-Link EDU Mini USB dongle. Once you have the JLink software installed, please execute the following command to program your firmware binary to Monimod (requires sudo):
sudo
JLinkExe -device atsamd21g18 -if swd -speed 1000 -CommanderScript flash_fw.jlink
This will flash Monimod with its bootloader and main_fw binaries. Alternatively, if you wish to update only the main_fw.bin on a previously flashed Monimod, use flash_main_fw.jlink
command script.