<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29029/programming-nrf52-with-openocd</link><description>Hi, I have a BMD-300 (nRF52) module that I&amp;#39;m attempting to program with OpenOCD and an ST-link from Linux (it worked great for nRF51 so I was trying to keep the same tools). 
 $OPENOCD/src/openocd -s $OPENOCD/tcl -f interface/stlink-v2.cfg -f target</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Jun 2018 13:22:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29029/programming-nrf52-with-openocd" /><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/136380?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 13:22:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a6dc9df-47a3-4ef6-9f0c-7e25bad988fd</guid><dc:creator>dimka-rs</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="batchfile"&gt;    $(OPENOCD)/src/openocd -s $(OPENOCD)/tcl -f interface/stlink.cfg -f target/nrf52.cfg -c init -c &amp;quot;reset init&amp;quot; -c halt -c &amp;quot;nrf5 mass_e    rase&amp;quot; -c &amp;quot;program $&amp;lt; verify&amp;quot; -c reset -c exit&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/127576?ContentTypeID=1</link><pubDate>Tue, 10 Apr 2018 09:33:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ce33edc-3bb5-455e-8e0f-f081475cb087</guid><dc:creator>chbereh</dc:creator><description>&lt;p&gt;Can you tell how the .cfg and openocd command looks like?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/126175?ContentTypeID=1</link><pubDate>Tue, 27 Mar 2018 21:04:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:476dc849-f6d9-42bf-b088-6e3a0fe5761f</guid><dc:creator>Matt Pfenninger</dc:creator><description>&lt;p&gt;FYI - As of 3/27/2018, it looks like&amp;nbsp;nrf52 support&amp;nbsp;has been moved into the main openocd trunk (merged with nrf51 support as the &amp;#39;nrf5&amp;#39; command set).&amp;nbsp; I&amp;nbsp;was just&amp;nbsp;able to program an nrf52832 (Rigado) device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/114900?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2018 12:15:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10eee7fb-78fd-4e82-869f-b5fd2fc69390</guid><dc:creator>drahnr</dc:creator><description>&lt;p&gt;Is that patch still relevant? I get the same issue regarding nrf52 not being a valid command&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/114902?ContentTypeID=1</link><pubDate>Thu, 13 Jul 2017 05:51:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1afba162-d794-4a27-93b4-8447c4ec424c</guid><dc:creator>amartin</dc:creator><description>&lt;p&gt;This problem has probably been solved already, but for those peaple who will stumble here while struggling with their own version of the same, don&amp;#39;t forget to check whether the instance of &amp;quot;openocd&amp;quot; you are using is really the one you have patched and installed. &amp;quot;which openocd&amp;quot; might prove useful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/114901?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2016 09:21:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30211e1d-b9e5-463d-a273-5af342c1dc3b</guid><dc:creator>Shriram</dc:creator><description>&lt;p&gt;Hello,
I&amp;#39;ve applied patch manually for nrf52 as suggested by ubicore, I&amp;#39;ve applied patch to these following files
src/flash/nor/Makefile.am				1	
src/flash/nor/drivers.c				2	
src/flash/nor/nrf52.c				1056	
tcl/target/nrf52.cfg&lt;/p&gt;
&lt;p&gt;but still it is showing error&lt;/p&gt;
&lt;p&gt;ac2@ac2:~/openocd_new$ openocd -s /home/ac2/openocd_new/tools/scripts/ -f board_nrf52.cfg -c init -c &amp;quot;reset init&amp;quot; -c halt -c &amp;quot;nrf52 mass_erase&amp;quot; -c &amp;quot;program /home/ac2/test_nrf52/nRF5_SDK_12.1.0_0d23e2a/examples/peripheral/blinky/pca10031/blank/armgcc/_build/nrf51422_xxac.out verify&amp;quot; -c reset -c exit
Open On-Chip Debugger 0.10.0-dev-00419-gbcaf775-dirty (2016-11-29-13:32)
Licensed under GNU GPL v2
For bug reports, read
&lt;a href="http://openocd.org/doc/doxygen/bugs.html"&gt;openocd.org/.../bugs.html&lt;/a&gt;
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 10000 kHz
Info : Unable to match requested speed 10000 kHz, using 4000 kHz
Info : Unable to match requested speed 10000 kHz, using 4000 kHz
Info : clock speed 4000 kHz
Info : STLINK v2 JTAG v21 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.248372
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
nrf52.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x000008e4 msp: 0x20000400
&lt;strong&gt;invalid command name &amp;quot;nrf52&amp;quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Can you help me figure out now which steps I am missing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/114899?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2016 07:33:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d4fe743-0736-4f6a-832a-2a602f97be99</guid><dc:creator>Abhishek</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Even I am facing similar issue. As suggested by ubicore I checked that patch related to nrf52 target is correctly applied. Following is the error,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;MS-7817:~/workarea/Projects/ble_door_lock/open/openocd-code$ openocd -s /home/ac1/workarea/Projects/ble_door_lock/open/openocd-code/ -f board_nrf52.cfg -c init -c &amp;quot;reset init&amp;quot; -c halt -c &amp;quot;nrf52 mass_erase&amp;quot; -c &amp;quot;program blinky_pca10031.hex verify&amp;quot; -c reset -c exit
Open On-Chip Debugger 0.10.0-dev-00419-gbcaf775-dirty (2016-11-30-17:06)
Licensed under GNU GPL v2
For bug reports, read
	&lt;a href="http://openocd.org/doc/doxygen/bugs.html"&gt;openocd.org/.../bugs.html&lt;/a&gt;
Error: The specified debug interface was not found (hla)
The following debug interfaces are available:
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;PS: But it does not show any interfaces under &amp;#39;following interfaces are available&amp;#39;. Although we have installed,
STlink &amp;#39;&lt;a href="https://github.com/texane/stlink/blob/master/doc/compiling.md&amp;#39;"&gt;github.com/.../compiling.md&amp;#39;&lt;/a&gt;, since we are using ST LinkV2 progammer for programming nrf52 module&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/114898?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2016 11:54:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88b0888e-5a7a-479f-bf6f-eb531f52d775</guid><dc:creator>ubicore</dc:creator><description>&lt;p&gt;Possible that the patch (which that add nrf52 target) has not been correctly applied...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/114897?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2016 11:19:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81467aea-c5ce-4f6d-9ca9-0132a76ec83b</guid><dc:creator>Shriram</dc:creator><description>&lt;p&gt;Hello,
I have followed the steps you have posted,
But when I flash my nrf52832 board I find following errors:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Preparing: _build/nrf51422_xxac.hex
Flashing: _build/nrf51422_xxac.hex
/home/ac2/test_nrf52/openocd-code/src/openocd -s /home/ac2/test_nrf52/openocd-code/tcl -f /home/ac2/test_nrf52/openocd-code/board_nrf52.cfg  -c init -c &amp;quot;reset init&amp;quot; -c halt -c &amp;quot;nrf52 mass_erase&amp;quot; -c &amp;quot;program _build/nrf51422_xxac.hex verify&amp;quot; -c reset -c exit
Open On-Chip Debugger 0.10.0-dev-00419-gbcaf775-dirty (2016-11-29-13:32)
Licensed under GNU GPL v2
For bug reports, read
	&lt;a href="http://openocd.org/doc/doxygen/bugs.html"&gt;openocd.org/.../bugs.html&lt;/a&gt;
Error: flash driver &amp;#39;nrf52&amp;#39; not found

Makefile:182: recipe for target &amp;#39;flash&amp;#39; failed
make: *** [flash] Error 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Can you help me figure out which steps I am missing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/114896?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2016 14:58:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bd525ec-f2c4-4031-b0c0-067a7a7c54d3</guid><dc:creator>ubicore</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I work from a few day with openOCD to program and debug on nRF52. For this I&amp;#39;m using a patched version of openocd.&lt;/p&gt;
&lt;p&gt;1 - Clone openocd from git from &lt;a href="https://sourceforge.net/p/openocd/code/ci/master/tree/"&gt;sourceforge.net/.../&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone git://git.code.sf.net/p/openocd/code openocd-code
cd openocd-code
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;2 - Apply patch for nrf52 : &lt;a href="http://openocd.zylin.com/#/c/3215/"&gt;openocd.zylin.com/&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git pull &lt;a href="http://openocd.zylin.com/openocd"&gt;openocd.zylin.com/openocd&lt;/a&gt; refs/changes/15/3215/2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If need merge conflict manually&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gedit src/flash/nor/drivers.c
gedit src/flash/nor/Makefile.am
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;3 - Build OpenOCD (change prefix)  :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./bootstrap # (when building from the git repository)
./configure \
    --prefix=/Your-path/openocd-git_install \
    --enable-aice \
    --enable-amtjtagaccel \
    --enable-armjtagew \
    --enable-cmsis-dap \
    --enable-dummy \
    --enable-ftdi \
    --enable-gw16012 \
    --enable-jlink \
    --enable-jtag_vpi \
    --enable-opendous \
    --enable-openjtag_ftdi \
    --enable-osbdm \
    --enable-legacy-ft2232_libftdi \
    --enable-parport \
    --disable-parport-ppdev \
    --enable-parport-giveio \
    --enable-presto_libftdi \
    --enable-remote-bitbang \
    --enable-rlink \
    --enable-stlink \
    --enable-ti-icdi \
    --enable-ulink \
    --enable-usb-blaster-2 \
    --enable-usb_blaster_libftdi \
    --enable-usbprog \
    --enable-vsllink

make
make install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;4 - Create a new board_nrf52.cfg config file with :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;source [find interface/jlink.cfg]
transport select swd
source [find target/nrf52.cfg]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;5 - Debug !&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;openocd -s /Your-path/openocd-git_install/share/openocd/scripts/ -f board_nrf52.cfg -c init -c &amp;quot;reset init&amp;quot; -c halt -c &amp;quot;nrf52 mass_erase&amp;quot; -c &amp;quot;program _build/nrf52832_xxaa.out verify&amp;quot; -c reset -c exit
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming nRF52 with OpenOCD</title><link>https://devzone.nordicsemi.com/thread/114895?ContentTypeID=1</link><pubDate>Fri, 13 May 2016 09:18:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4206db00-5d8c-417e-9a14-aafa224d4358</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;This seems to be because Rigado set the memory protection bit.&lt;/p&gt;
&lt;p&gt;Thanks to Rigado&amp;#39;s support, it seems you can do &lt;code&gt;nrfjtool --recover&lt;/code&gt; to remove this (or you can manually poke the relevant registers).&lt;/p&gt;
&lt;p&gt;As it happens you can program an nRF52 from the nRF52DK by connecting it up to P20. The devkit switches over automatically (no jumpers needed). &lt;code&gt;nrfjtool&lt;/code&gt; is also available for Linux now, so there&amp;#39;s very little reason (IMO) to have to use OpenOCD now.&lt;/p&gt;
&lt;p&gt;Of course it still doesn&amp;#39;t work for me after all that, but I&amp;#39;ve created a new issue for that as it appears that OpenOCD &lt;em&gt;would&lt;/em&gt; have worked, if it weren&amp;#39;t for the memory protection bit being set.&lt;/p&gt;
&lt;p&gt;New issue:
&lt;a href="https://devzone.nordicsemi.com/question/79535/could-not-power-up-debug-power-domain-with-nrfjproj-on-nrf52/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>