(Connecting STlink with nRF51822)
(Connecting STlink with nRF51822)
Line 20: Line 20:
  
 
==Connecting STlink with nRF51822==  
 
==Connecting STlink with nRF51822==  
 +
==v==
  
 
'''Do the following connections'''
 
'''Do the following connections'''

Revision as of 15:15, 30 September 2015

Sandeep (talk) and Vaibhav Katkar (talk) 17:43, 10 September 2015 (IST)


Getting STlink v1 working with openOCD is a pain. The USB driver implementation has flaws. The PC picks different drivers for the same device depending on its mood! Initially I got it working on my computer and to check I asked Vaibhav to try on his computer. He too wanted to use it to debug the LPC1114 MCU that he is working on for a last few weeks. It did not work, even after following the exact same steps. So we debugged and found out what the issue was.

Configuring Open OCD

  1. Download OpenOCD zip file and extract its contents in any directory. There are two bin folders "bin" and "bin-x64" inside this directory. Depending on the version of the OS utilize the OpenOCD version.

Setting OpenOCD path

  1. Right click on This PC and select properties. this will open "System" window, in system window click on Advanced System
    Settings
    , it will open system properties. Now click on Environment Variables.
    In this window select Path under System variables and click on Edit button as shown below

Path1.png


  1. Give the path of bin file in openocd as C:\openocd\bin-x64, if you are usin 64-bit OS or C:\openocd\bin, if you are using 32-bit OS and click OK


Path2.png

Connecting STlink with nRF51822

v

Do the following connections

  1. Remove links on CN3 connector of STlink
  2. Power up NRF board from STlink
  3. Do the connections of CN2 connector as shown in diagram

K.png

Using Open OCD

Open OCD as debugger

Open OCD as programmer/flasher

References

K.png

A.png

B.png

C.png

E.png

F.png

G.png

H.png

I.png