diff --git a/.gdbinit b/.gdbinit index 3717d35b54e3a7177198f1c916b8fa8d1aa37873..cd6527a9e41f16dbad956b9cb001688c3dff9b06 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 987bbffe211e78dfca1170d0142b3e2b55a06701..92a832c891207fcfd439c946c46d1a0a784a384f 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: ```