diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..c4d0549 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +FloatPUMP \ No newline at end of file diff --git a/.idea/cmake.xml b/.idea/cmake.xml new file mode 100644 index 0000000..857e3e2 --- /dev/null +++ b/.idea/cmake.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/floatpump-firmware.iml b/.idea/floatpump-firmware.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/floatpump-firmware.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..79b3c94 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..cfa89e2 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build-tools/README.md b/build-tools/README.md index 297fb6c..069dbc2 100644 --- a/build-tools/README.md +++ b/build-tools/README.md @@ -1,4 +1,43 @@ -# Toolchain Setup +# FloatPUMP - Firmware Repository -## Prerequisites -- Install Docker \ No newline at end of file +This repository contains the necessary files to completely build the firmware for the FloatPUMP controller. +The toolchain used in this project is built up using **docker**. The following sections describe how to setup the jetbrains +CLion IDE to automatically use the included docker image to build the project. It also contains some description +on how to use OpenOCD to flash the controller using a **STLink-V2** Programmer. + +## Toolchain Setup +This chapter describes how to setup the CLion IDE to use the toolchain built with docker. + +### Prerequisites + - Install jetbrains CLion IDE + - Install Docker + - Open the Project by clicking _New project from version control_ + +### Build the docker image +You can build the image by yourself. Alternatively you can pull the image from the robtor.de registry. +Open a command line and enter the subdirectory build-tools. There run the follwing command to +build the docker image: + +`docker build -t dev-arm-stm32:latest .` + +As an alternative you could open the Dockerfile in this directory using CLion and build it directly out of the IDE! + +### Pulling the image +This method is currently not supported. Coming soon... + +### Configure toolchain +First enter the Settings dialog in CLion while the floatpump-firmware project is opened. +Under `Build, Execution, Deployment > Toolchain` add a new toolchain and choose the type `docker`. +Now setup everything as depicted in this screenshot: +![toolchain_settings.png](toolchain_settings.png) + +If you named the image different than dev-arm-stm32:latest, choose the correct image corresponding to your name. + +Usually now the correct CMake build targets should appear under `Build, Execution, Deployment > CMake`. + +### Configure OpenOCD +To configure OpenOCD for directly flashing and debugging out of CLion go to the BuildTargets dropdown in the +header line and click on `Edit configurations`. +There add a new configuration for `OpenOCD` and enter the following proerties: +![openocd_settings.png](openocd_settings.png) +As `Board config file` chosse the correct `floatpump.cfg` file contained in the project root dir. diff --git a/build-tools/openocd_settings.png b/build-tools/openocd_settings.png new file mode 100644 index 0000000..3568eab Binary files /dev/null and b/build-tools/openocd_settings.png differ diff --git a/build-tools/toolchain_settings.png b/build-tools/toolchain_settings.png new file mode 100644 index 0000000..81279ac Binary files /dev/null and b/build-tools/toolchain_settings.png differ