I get all the way to ./configure , which appears to work, but I notice that only the SEGGER J-Link Programmer has been setup. Does anyone know what command to enter to setup the ST-Link?
I then continued to make, but I get the following error:
discovery_tcp.c:305:9: error: implicit declaration of function ‘select’ is
invalid in C99 [-Werror,-Wimplicit-function-declaration]
ret = select(sock + 1, &rfds, NULL, NULL, &timeout);
^
1 error generated.
make[4]: *** [libjaylink_la-discovery_tcp.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Does anyone know what may have gone wrong? Thanks in advance!
Sorry to hear you’re having a hard time. It’s hard to tell from the single error what might have gone wrong with your build.
The recommendation to build openocd from source was due to the fact that homebrew’s formula is too outdated to work with the daisy.
What you may be able to try instead (I can give this a try in the next day or so when I get to a mac) is installing via xpack as this is how eclipse recommends installing it now. It does require node/npm, but looks like a fairly simple install once that’s set up.
If this does work as an alternative source we can add it to the wiki instead of recommending openocd be built from source.
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-12:31)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1800 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.184707
Info : stm32h7x.cpu0: hardware has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32h7x.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
So I think this means it’s working?
So next question - how do I use it?! What do you recommend? I’m looking into the Cortex Debug extension for VSCode, but not really sure how to set it all up.
Alternatively, other free options you can use are Eclipse with some extensions, or STM32CubeIDE. I’m sure there are others as well, but those are the two I can think of off the top of my head.
I’ve also used VisualStudio with the VisualGDB extension, but this is Windows only, and also not free.
If your openocd is installed so that it’s within your PATH environment variable (i.e. you can type openocd from a fresh terminal) then it shouldn’t matter.
Otherwise there may be a way to set the openocd installation directory from launch.json
I can reinstall from xpack tomorrow and try this out as well.
I see, no I don’t think it is. I tried in a fresh terminal and openocd command was not found, I need to type in the entire path of the install for it to work.
Gotcha. If you go to your system Environment Variables and edit the PATH variable to have the directory of the openocd.exe then you should be able to get it working.
Perfect, that worked! I’m able to step through the file in the debugger now. I’ll have a play and see if it’s all working as expected, but it appears to be. Thanks for all your help!
Edit: for anyone also trying this on mac - I used the command: sudo nano /etc/paths from terminal to set a new location for the $PATH variable (pointing at my openOCD install).