- This topic has 1 reply, 1 voice, and was last updated 5 years, 10 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Mastering STM32 book support forum › Running OpenOCD in macOS
Tagged: openocd
I installed the whole toolchain following the book and was able to compile and run the Hello, World! program on my STM32 board. Only one thing did not work, OpenOCD, which fortunately was not necessary for the Hello, World! program.
The symptoms are similar as reported by another user:
That user solved the problem by re-installing everything, but since I have everything else working, there should be a simpler solution.
When I run the test script (Note I’m using a Discovery board, not a Nucleo board),
$ cd ~/STM32Toolchain/openocd/scripts
$ ../bin/openocd -f board/stm32f4discovery.cfg
I get the following error:
…
Error: open failed
in procedure ‘init’
in procedure ‘ocd_bouncer’
A dialog window appears and then disappears quickly saying that OpenOCD is not allowed to make connections.
I checked the Firewall settings in the Security & Privacy panel, but OpenOCD is already set to “Allow incoming connections”.
Any suggestions? I’m just starting with STM32 and like the book thus far. I don’t know how important OpenOCD is for the whole development process, but I would like to use it.
For reference, I’m running macOS 11.14 (Mojave). Everything else is exactly as recommended in the book.
The solution turned out to be rather simple. It required a small change to the first line of the stm32f4discovery.cfg file.
The original line was the following:
source [find interface/stlink-v2.cfg]
I was using a Discovery board with a newer version of ST-LINK, so it required the following line:
source [find interface/stlink-v2-1.cfg]
The clue came from comparing the macOS System Report with the 60-openocd.rules file.
The Mac saw the Discovery board as follows:
STM32 STLink:
Product ID: 0x374b
Vendor ID: 0x0483 (STMicroelectronics)
This matched the definition of STLink v2-1 in the 60-openocd.rules file:
# STLink v2-1
ATTRS{idVendor}==”0483″, ATTRS{idProduct}==”374b”, MODE=”666″
So, while macOS doesn’t use udev and the *.rules file, the latter was still helpful in diagnosing the problem.