Skip to content

yet-another-gauge/4-20mA-Loop-Calibrator

Repository files navigation

4-20mA-Loop-Calibrator

Build Status

Getting started

Clone a repository

$ git clone [email protected]:yet-another-gauge/4-20mA-Loop-Calibrator.git
$ git submodule update --init --recursive

Build source code inside a Docker container

$ cd 4-20mA-Loop-Calibrator

$ docker build --tag=yet-another-gauge/4-20ma-lc .
$ docker run -v $PWD:/usr/src -it yet-another-gauge/4-20ma-lc /bin/bash

$ root@<hash>:/usr/src# mkdir build
$ root@<hash>:/usr/src# cd build
$ root@<hash>:/usr/src# cmake -DCMAKE_BUILD_TYPE=Debug ..
$ root@<hash>:/usr/src# make

OpenOCD and GDB

  • openocd/ST-LINK-V2-1.cfg specifies configuration to use the ST-LINK/V2-1 adapter
  • openocd/STM32-NUCLEO-F091RC.cfg contains initialization items that are specific to a STM32 NUCLEO-F091RC board
$ openocd -f openocd/ST-LINK-V2-1.cfg -f openocd/STM32-NUCLEO-F091RC.cfg
$ arm-none-eabi-gdb build/4-20mA-Loop-Calibrator.elf
...
Reading symbols from 4-20mA-Loop-Calibrator.elf...
(gdb) target extended-remote localhost:3333
Remote debugging using localhost:3333
...
(gdb) monitor reset halt
...
(gdb) set substitute-path /usr/src <absolute path to the working directory>
...
(gdb) load
...
(gdb) continue
Continuing.

Dependencies

  • LibOpenCM3 is open source ARM Cortex-M microcontroller library
  • Observer is a pure C implementation of the observer pattern