OpenOCD failure on OS X - jlink - WICED-SDK-3.4.0

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiTo_1583836
Level 5
Level 5
50 likes received 25 likes received 10 likes received

I have an issue with the OpenOCD running on OS X 10.11.1 (El Capitan). My setup includes a jlink JTAG debugger as well as the Broadcom EVB including the BCM43341 (BCM943341WCD1).

The command that I run under Make Project is the following:

demo.MYPROJECT-BCM943341WCD1-debug JTAG=jlink debug

The result of this command is very similar to some other posts. I do see after the build summary the following error printed three times:

**** OpenOCD failed - ensure you have installed the driver from the drivers directory, and that the debugger is not running **** In Linux this may be due to USB access permissions. In a virtual machine it may be due to USB passthrough settings. Check in the task list that another OpenOCD process is not running. Check that you have the correct target and JTAG device plugged in. ****

If I change the Make Project command as follow: demo.MYPROJECT-BCM943341WCD1-debug JTAG=jlink debug VERBOSE=1

to be able to extract one of the commands that creates the issue. I found the following command:

./tools/OpenOCD//OSX/openocd-all-brcm-libftdi --enable-ftdi -f ./tools/OpenOCD/jlink.cfg -f ./tools/OpenOCD/stm32f4x.cfg -f ./tools/OpenOCD/stm32f4x-flash-app.cfg -c "verify_image_checksum build/demo.MYPROJECT-BCM943341WCD1-debug/binary/demo.MYPROJECT-BCM943341WCD1-debug.stripped.elf" -c shutdown

I ran the same command including: --debug=3 so OpenOCD will add more logs. I found this here:

Info : 253 2158 jlink.c:573 jlink_init(): J-Link JTAG Interface ready

Debug: 254 2158 jlink.c:705 jlink_reset(): trst: 0, srst: 0

Debug: 255 2162 log.c:422 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (2162). This may cause trouble with GDB connections.

Debug: 257 2163 core.c:1591 adapter_khz_to_speed(): convert khz to interface specific speed value

Debug: 258 2163 core.c:1594 adapter_khz_to_speed(): have interface set up

Debug: 259 2164 core.c:1591 adapter_khz_to_speed(): convert khz to interface specific speed value

Debug: 260 2164 core.c:1594 adapter_khz_to_speed(): have interface set up

Info : 261 2164 core.c:1386 adapter_init(): clock speed 1000 kHz

Debug: 262 2164 openocd.c:137 handle_init_command(): Debug Adapter init complete

Debug: 263 2164 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport init

Debug: 264 2164 command.c:145 script_debug(): command - ocd_transport ocd_transport init

Debug: 266 2164 transport.c:240 handle_transport_init(): handle_transport_init

Debug: 267 2164 jlink.c:705 jlink_reset(): trst: 0, srst: 0

Debug: 268 2164 core.c:730 jtag_add_reset(): SRST line released

Debug: 269 2164 core.c:754 jtag_add_reset(): TRST line released

Debug: 270 2164 core.c:328 jtag_call_event_callbacks(): jtag event: TAP reset

Debug: 271 2379 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag_reset 1 1

Debug: 272 2379 command.c:145 script_debug(): command - jtag_reset ocd_jtag_reset 1 1

Error: 274 2379 core.c:676 jtag_add_reset(): BUG: can't assert SRST

Debug: 275 2379 command.c:628 run_command(): Command failed with error code -4

Debug: 276 2379 command.c:628 run_command(): Command failed with error code -4

User : 277 2379 command.c:689 command_run_line(): in procedure 'init' called at file "./tools/OpenOCD/stm32f4x-flash-app.cfg", line 10

in procedure 'ocd_bouncer'

Debug: 278 2379 command.c:628 run_command(): Command failed with error code -4

User : 279 2379 command.c:689 command_run_line():

I will follow the post here (Re: OS X version of WICED SDK 3.1.1 posted ) with an Olimex debugger this time and see if I can get it working. The understanding is that the OpenOCD is conflicting with the native FTDI driver.

Please comment this post if you find a way to get the Jlink running on OS X.

0 Likes
7 Replies
JoYi_1844281
Level 6
Level 6
100 sign-ins 100 replies posted 50 likes received

Try add following line into jilink.cfg

reset_config trst_and_srst srst_push_pull srst_nogate connect_deassert_srst

I don't know it work or not on OSX! but you could try!

Thanks Jone, I updated the jlink.cfg file based on your recommendation, result is the same.

0 Likes
JoYi_1844281
Level 6
Level 6
100 sign-ins 100 replies posted 50 likes received

up load your Openocd.log in the build directory!

make sure your J-LINK is already work with Segger J-LINK S/W under OSX !

0 Likes

Hi Jone,

I do use the J-Link with another platform for JTAG flashing and it works OK on the same OSX machine. I am not quite sure to understand what do you mean by "up load your Openocd.log in the build directory" could you please explain what do you mean exactly?

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

For me, the JLINK never worked with the BCM943341 based modules on OS X. I use Olimex_ARM-USB-OCD-H.

Usually, with SRST, it is pulled low to reset the module. In case of ISM43341 (Inventek's variation of BCM43341), the SRST is open collector to the RESET_N line of the module which is pin 34.

So once the JTAG is done writing to the boot loader/dct/application entries in your internal flash sections, it pulls the SRST to low, which since its wired to the RESET_N line of the module, causes the module to reset.

Please make sure SRST_N and RESET_N line are open collector together.

Also for OS X (Yosemite), please do the following .. If you have the latest version of OS X, most likely it should work without making changes shown below:

(1) Install macports

(2) update macports with packages (sudo port self-update)  ... Accept Xcode tools instal etc

(3) install OpenOCD using port (sudo port install openocd)

(4) Check for the existence of any prior FTDI drivers

ls -l /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist

(5) Move the Driver Install directory to a backup folder

sudo mv /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents ~/backup

(6) Reboot the mac

(7) If conflicts still exists: unload Apple's USB FTDI drive as

sudo kextunload -p -b com.apple.driver.AppleUSBFTDI

I am attaching my OpenOCD config file for the Olimex. Hope it helps.

0 Likes

Thanks for the help and detailed explanation. I ordered last week the Olimex and will try what you recommended. I also found another thread online about the same topic. Looks like we will have no luck with J-Link on OS X. I will report the result as soon as possible.

0 Likes

There are one file call openocd.log in the build directory!

upload it ! or copy and paste here

0 Likes