Issues when following the "Flash it" chapter on Windows
I found two issues when trying to follow the Flash It chapter on Windows with the latest (as of writing) versions of openocd and arm-none-eabi-gdb. This is particularily bad as issues this early on can scare away inexperienced users and because finding something when searching for the error message would have helped me, I decided to open the issue. Whether this affects all Windows users is not something I can tell.
1. openocd startup
It says I have to add a -s flag with a path to the openocd directory with \share\scripts appended in the end:
# Windows: remember that you need an extra `-s %PATH_TO_OPENOCD%\share\scripts`
This path does not exist in my case. In my openocd folder there is only %PATH_TO_OPENOCD%/share/doc inside the share folder, while there is also a %PATH_TO_OPENOCD%/scripts. However it seems that this doesn't matter, as debugging worked even without -s in the end..
2. starting gdb
It says I should be inside src/05-led-roulette and run:
<gdb> -q target/thumbv7em-none-eabihf/debug/led-roulette
However if you are inside (and not in the project root) gdb won't find the the executable: target/thumbv7em-none-eabihf/debug/led-roulette: No such file or directory. If you then against better knowledge would try to load it would obviously fail with No executable file specified.. This is quite naturally so, as the relative path is wrong.
Once I used this instead, it worked (obviously replacing gdb with the appropriate gdb command (in my case arm-none-eabi-gdb):
<gdb> -q ../../target/thumbv7em-none-eabihf/debug/led-roulette
It is the same on my windows machine. It can be the matter of cargo project structure via the book.
On the other hand, there is \f3discovery\src\05-led-roulette\target file containing the path ../../target the question is, why it is not called properly?