Jlink support for wiced sdk not working.

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

cross mob
Anonymous
Not applicable

Hi,

i saw in  a post that it is possible to port wiced sdk to stm32f4 discovery board via jlink. but when i tried it out its giving me this error

"**** 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. ****"

I am using BCM943362WCD6 platform for building my project.

i had  made changes in the " wiced sdk toolchain_common.mk" file --> JTAG = jlink

and made the necessary changes in the build string.

is there any thing else that i should be configuring for making it work ?

1 Solution
Anonymous
Not applicable

Hi

do following,

1.download libusb driver - link (http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1....)
2.extract

3.run the app "inf-wizard" in libusb-win32-bin-1.2.6.0\bin
4.select jlink
5.complete driver installation.

6.Changethe line in the file wiced_toolchain_common.mk from:

    JTAG ?= BCM9WCD1EVAL1

    to

    JTAG ?= jlink

7.add the parameter JTAG=jlink to the make target.

8.Try loading with wiced sdk, now it should work.

Regards,
Sooraj.

View solution in original post

18 Replies
JoYi_1844281
Level 6
Level 6
100 sign-ins 100 replies posted 50 likes received

How do you connect your jlink to ST MCU ?

0 Likes
Anonymous
Not applicable

the connections were  made as per this pdf .

https://www.segger.com/admin/uploads/evalBoardDocs/AN00014_ConnectingJLinkToSTM32F407Discovery.pdf

in addition to this i connected TDI pin to PA15. the same stm discovery board was tested with keil IDE and i was able to flash and debug it using the jlink, But no success with Wiced ide.

Any idea why this is happening?

0 Likes
Anonymous
Not applicable

Hi

do following,

1.download libusb driver - link (http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1....)
2.extract

3.run the app "inf-wizard" in libusb-win32-bin-1.2.6.0\bin
4.select jlink
5.complete driver installation.

6.Changethe line in the file wiced_toolchain_common.mk from:

    JTAG ?= BCM9WCD1EVAL1

    to

    JTAG ?= jlink

7.add the parameter JTAG=jlink to the make target.

8.Try loading with wiced sdk, now it should work.

Regards,
Sooraj.

Anonymous
Not applicable

thanks for your help sooraj, but it still pops up with same error. is there any need for changes to be made in the debugger configuration like remote target to openocd .? anyway i had tried out with that also. still no luck.

0 Likes
Anonymous
Not applicable

Hi,
what is the message shown in wiced sdk - build/openocd_log.txt?

0 Likes
Anonymous
Not applicable

Runtime Error: ./Tools/OpenOCD/stm32f4x-flash-app.cfg:13:

in procedure 'script'

at file "embedded:startup.tcl", line 58

in procedure 'reset' called at file "./Tools/OpenOCD/stm32f4x-flash-app.cfg", line 13

Open On-Chip Debugger 0.7.0-dev-00227-g9d47214-dirty (2013-04-16-10:43)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.sourceforge.net/doc/doxygen/bugs.html

Info : only one transport option; autoselect 'jtag'

adapter speed: 1000 kHz

adapter_nsrst_delay: 100

jtag_ntrst_delay: 100

cortex_m3 reset_config vectreset

Info : J-Link initialization started / target CPU reset initiated

Info : J-Link Lite-Cortex-M V8 compiled Jul 17 2014 11:40:12

Info : J-Link caps 0xb8ea7a3b

Info : J-Link hw version 80000

Info : J-Link hw type J-Link

Info : J-Link max mem block 10144

Info : J-Link configuration

Info : USB-Address: 0x0

Info : Kickstart power on JTAG-pin 19: 0x1

Info : Vref = 2.950 TCK = 0 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0

Info : J-Link JTAG Interface ready

Info : clock speed 1000 kHz

Error: JTAG scan chain interrogation failed: all ones

Error: Check JTAG interface, timings, target power, etc.

Error: Trying to use configured scan chain anyway...

Error: stm32f4xx.cpu: IR capture error; saw 0x0f not 0x01

Warn : Bypassing JTAG setup events due to errors

Info : Selecting JTAG transport command set.

Warn : Invalid ACK 0x7 in JTAG-DP transaction

Polling target stm32f4xx.cpu failed, GDB will be halted. Polling again in 100ms

Polling target stm32f4xx.cpu failed, GDB will be halted. Polling again in 300ms

Error: JTAG scan chain interrogation failed: all ones

Error: Check JTAG interface, timings, target power, etc.

Error: Trying to use configured scan chain anyway...

Error..

0 Likes
Anonymous
Not applicable

Hi sarath,
try connecting TRST to PB4.

0 Likes
Anonymous
Not applicable

Hi Sooraj

I have connected TRST to PB4 as you've mentioned, But still it's showing the same issue...

0 Likes

sarathtv2

<http://community.broadcom.com/people/sarathtv2?et=watches.email.thread>,

The OpenOCD not support SWD mode of JLINK,

Please wired your JLINK to Discovery board as JTAG pin not SWD pin.

2014-11-07 12:51 GMT+08:00 sarathtv2 <admin@community.broadcom.com>:

<http://community.broadcom.com/?et=watches.email.thread> Jlink

support for wiced sdk not working.

reply from sarathtv2

<http://community.broadcom.com/people/sarathtv2?et=watches.email.thread>

in WICED Wi-Fi Forums - View the full discussion

<http://community.broadcom.com/message/8961?et=watches.email.thread#8961>

0 Likes
Anonymous
Not applicable

hi jone,

i didn't  quiet under how to change it to jtag mode instead of swd mode?. in the reference manual  it is mentioned that  the pins i used   are jtag pins,

The debug pins are in AF pull-up/pull-down after reset:

• PA15: JTDI in pull-up

• PA14: JTCK/SWCLK in pull-down

• PA13: JTMS/SWDAT in pull-up

• PB4: NJTRST in pull-up

• PB3: JTDO in floating state

i have made connection as per the manual.

0 Likes
Anonymous
Not applicable

Hi sarath,
Tested on stm32f4discovery with jlink in WICED IDE,
connected VTRef,TRST,TDI,TMS,TCK,TDO,RESET to corresponding pins in discovery board,
removed CN3 jumpers,
given power to discovery board via usb.

It worked fine for me.

Regards,
Sooraj.

0 Likes
Anonymous
Not applicable

hi sooraj,

hope its not asking too much of you. but can you confirm whether  the pins i have used is same as that what you have used for jtag

  1. PA15: JTDI
  2. PA14: JTCK
  3. PA13: JTMS
  4. PB4: NJTRST
  5. PB3: JTDO 
0 Likes
Anonymous
Not applicable

yes, same ones...

0 Likes
Anonymous
Not applicable

ohhh,,,still i am not able to flash the board ...wonder why . ?

anyway thanks alot for your help.. is there any thing you think might be wrong in the way i am trying to use jlink and stm ?

0 Likes
Anonymous
Not applicable

Hi @Sooraj

Thanks for your patience and support,

I'm a college of @Sarath. We want to interface SN8000 module with stm32f4 discovery board, Initially we are developing our code in SN8000x EVK.

Just wanted to confirm the steps we are doing is correct or not

1. Installed WICED SDK 2.4.1 applied the patch file for SN8000x.

2. Edited the SN8000x file accordingly by adding support for stm32f4

3. Downloaded and installed the libusb from the link you gave

4. Edited wiced_toolchain_common.mk as

      JTAG ?= jlink 

5. Made the build string as "snip.scan-SN8000x JTAG=jlink download "

7. Build and Download the application to the stm32f4 discovery board via jlink

and we also tried Debug Configurations->Debugger->JTAG Device -> Open OCD (via pipe)

Still it's throwing the same error...

Is there any steps we've missed/we shouldn't do?

Regards

Hariprasad C R

0 Likes
Anonymous
Not applicable

Hi,

check your openocd_log.txt , it may be related to  jtag speed,
In SN8200 (STM32F4DIS-WIFI)
I had to change adapter_khz 6000 to adapter_khz 1000 in stm32f1x.cfg,stm3f1x_gdb_jtag.cfg & stm32f1x-flash-app.cfg files to get it working.
Regards,
Sooraj

0 Likes
Anonymous
Not applicable

Hi soorajrk

This is working fine in SDK 2.4.1 , but when I try to do the same steps in SDK 3.1.0 its throwing the same errors?

Do I have to do something extra for SDK 3.1.0 ?

0 Likes
Anonymous
Not applicable

soorajrk

Thank you for your help. I got it working finally ..  

0 Likes