From a7b5561e1a5f38dd18910089b1462729cda91b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= <henrik@tjaders.com> Date: Thu, 2 Jan 2020 19:12:42 +0100 Subject: [PATCH] Installation instructions, including dependencies --- .gdbinit | 2 +- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/.gdbinit b/.gdbinit index 3717d35..cd6527a 100644 --- a/.gdbinit +++ b/.gdbinit @@ -19,7 +19,7 @@ end # Need to find the IP of the docker host # Check your gateway: $ ip route -target extended 172.17.0.1:3333 +target extended :3333 monitor reset init set remote hardware-breakpoint-limit 6 set remote hardware-watchpoint-limit 4 diff --git a/README.md b/README.md index 987bbff..92a832c 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,23 @@ The build system handles the switching between "analysis" and "execution" stages # Installation +## Dependencies + +* Rust compiler, recommended via rustup +* stlink (for udev rules for stm32) +* openocd +* base-devel +* arm-none-eabi-gcc +* arm-none-eabi-gdb +* arm-none-eabi-binutils +* llvm +* clang +* KLEE 2 + + yay -S rustup stlink openocd base-devel arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-binutils llvm clang + + + yay klee Get the actual program (from your regular computer, not the container): @@ -23,6 +40,27 @@ cd d7020e_srp git checkout klee ``` +## ITM + +``` +cargo install itm +``` + +Start the ITM tracing tool + +(Only needed the first time) +``` +mkfifo /tmp/swo.log +``` +Start the parser: +``` +itmdump -Ff /tmp/swo.log +``` + +Notice, the itmdump tool must be started BEFORE the openocd session (see Debug) in order to capture the ITM trace. + +## OpenOCD + Start OpenOCD on the host, connect it to your microcontroller. ``` @@ -31,6 +69,20 @@ openocd -f st_nucleo_f4_itm.cfg The st_nucleo_f4_itm.cfg file is located in the git repo. +### Troubleshooting: + +Make sure your user is member of uucp (Arch) dailup or serial etc, depending on distro. Access to the serial port is required. + +## Configure GDB + +Add the following to `~/.gdbinit` + +``` +set auto-load safe-path / +``` + +## Running + To run the suite of tools: ``` -- GitLab