<?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>custom serial wire debug</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7272/custom-serial-wire-debug</link><description>Hi,
As question &amp;quot;custom serial wire debug&amp;quot; date Jan 14 &amp;#39;14, I&amp;#39;m also interested in programming the chip from an other embedded chip (would fit our production process verry well). 
 Do you have information about how to do this? 
 After looking at data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 May 2015 15:58:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7272/custom-serial-wire-debug" /><item><title>RE: custom serial wire debug</title><link>https://devzone.nordicsemi.com/thread/25705?ContentTypeID=1</link><pubDate>Wed, 27 May 2015 15:58:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:229d7457-3729-4f1c-a6c1-dca3c7caf2b2</guid><dc:creator>Jon (jono)</dc:creator><description>&lt;p&gt;Thanks!!
I&amp;#39;ll write my own code then.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom serial wire debug</title><link>https://devzone.nordicsemi.com/thread/25707?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 23:18:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b8e4e1b-b718-4135-adc1-6df975e53b9f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Well the bits I know are correct are&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On the nrf51 DK the SWD pins are connected to the on-board Atmel chip (ATSAM3U2CA) which drives them and emulates the SWD protocol&lt;/li&gt;
&lt;li&gt;That Atmel chip runs JLink-OB from Segger (or it can run an mbed stack instead but by default it&amp;#39;s segger) all controlled by USB, also implemented on that chip.&lt;/li&gt;
&lt;li&gt;That&amp;#39;s all driven by a higher-level library from the host. As the Segger protocol is only very sparsely documented and they provide a cross platform JLinkDLL library which implements it (for a fee) I know of nobody commercially using Segger who doesn&amp;#39;t use the library and I would be 99.9% sure Nordic does too. It&amp;#39;s a no-brainer if you are a Segger shop, JLinkDLL is really easy to use, especially for the minimal stuff nrfstudio needs to do.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom serial wire debug</title><link>https://devzone.nordicsemi.com/thread/25706?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 14:03:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80e47af6-c8e1-4677-bca1-6269ef33f281</guid><dc:creator>Jon (jono)</dc:creator><description>&lt;p&gt;Hm, ok, If this is correct, it&amp;#39;s seems not even to be Nordic:s code going down to target, and I canno&amp;#39;t steel that...
Seems that the remaining options then is to do it myself, one way or the other...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom serial wire debug</title><link>https://devzone.nordicsemi.com/thread/25704?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 13:53:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e40a76e8-d3ee-403f-8d61-1d90649304a0</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;It&amp;#39;s not Nordic&amp;#39;s code doing the programming from the nRF51 DK, it&amp;#39;s the on-board Segger chip which is programmed with Segger&amp;#39;s JLink software, that&amp;#39;s what&amp;#39;s talking SWD to the nrf51 and is connected out of the board via USB. In all likelihood Nordic just uses JLinkDLL, which is Segger&amp;#39;s wrapper library for the whole thing, which provides you simple high-level functions to write to registers, read and write files etc. I didn&amp;#39;t know JLinkDLL wrote to RAM, but I guess it might, I&amp;#39;ll have to look one day. Possible that Nordic&amp;#39;s nrfstudio uploads a bootloader to RAM and then runs it, Crossworks does that (or did before Segger provided a generic flash loader), but I didn&amp;#39;t think so, you don&amp;#39;t really have to, JLinkDLL provides all this in 2 dozen c functions.&lt;/p&gt;
&lt;p&gt;If you have an SWD emulator library for the big ARM CPU you may be able to make use of that, but you&amp;#39;ll have to do the pretty low-level work yourself. Again depends a bit what libraries exist already for the CPU you&amp;#39;re using.&lt;/p&gt;
&lt;p&gt;Nordic has a bootloader/DFU module. You have to get it on the chip in the first place but you can then talk to that over UART if you like, with a very simple protocol. That doesn&amp;#39;t help you get the initial image on however.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom serial wire debug</title><link>https://devzone.nordicsemi.com/thread/25703?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 13:29:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20a61fc8-7e00-494a-bde9-70a176c47d9b</guid><dc:creator>Jon (jono)</dc:creator><description>&lt;p&gt;I already have a big ARM CPU that I want to program the nRF51822 from. This big cpu is controlled in production as is. I don&amp;#39;t want to add more hardware, but rather use that CPU for programming.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not looking for hardware options&lt;/p&gt;
&lt;p&gt;I have 4 options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Premade ram-algorithms from nordic that I may use (i can see the binaries downloaded in my DW-decoder hooked to the nRF51 DK, (but may I use these? How do they work?)&lt;/li&gt;
&lt;li&gt;Access the flash manually (seems to be used for erase, see comment below, probably slow for writing)&lt;/li&gt;
&lt;li&gt;Write algorithms myself (will take time, prefer if nordic has pre-made)&lt;/li&gt;
&lt;li&gt;Abandon concept - makes production more complicated&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Snip from &lt;strong&gt;erase&lt;/strong&gt; on &amp;quot;nRF51 DK&amp;quot;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;2,653111750,Bus,D76,W(AP-0xC) ACK DATA:0x00000001 Addr=0xC AP=0x0 DRW A=0x4001E50C
2,654162875,Bus,D76,R(DP-RDBUFF) ACK DATA:0x00000000 Addr=0xC AP=0x0 DRW A=0x4001E400
2,655145500,Bus,D76,R(DP-RDBUFF) ACK DATA:0x00000000 Addr=0xC AP=0x0 DRW A=0x4001E400
2,656137000,Bus,D76,R(DP-RDBUFF) ACK DATA:0x00000000 Addr=0xC AP=0x0 DRW A=0x4001E400
...
2,695150625,Bus,D76,R(DP-RDBUFF) ACK DATA:0x00000000 Addr=0xC AP=0x0 DRW A=0x4001E400
2,696154000,Bus,D76,R(DP-RDBUFF) ACK DATA:0x00000001 Addr=0xC AP=0x0 DRW A=0x4001E400
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom serial wire debug</title><link>https://devzone.nordicsemi.com/thread/25702?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 12:13:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f21e0c13-048d-46bd-8f34-dfed3bef5e6c</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Have a look at the &lt;a href="http://embeddedsoftdev.blogspot.ca/p/idap-link.html"&gt;IDAP-M module from this blog page&lt;/a&gt;.  It&amp;#39;s a CMSIS-DAP Jtag on a 15x16 mm module.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom serial wire debug</title><link>https://devzone.nordicsemi.com/thread/25701?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 12:09:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e30cd092-9534-49a5-93c5-b5087ee05a68</guid><dc:creator>Jon (jono)</dc:creator><description>&lt;p&gt;interface = DW (SWDIO &amp;amp;&amp;amp; SWDCLK)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: custom serial wire debug</title><link>https://devzone.nordicsemi.com/thread/25700?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 12:08:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b080dd5-c9cb-4ce9-95ac-786509eba591</guid><dc:creator>Jon (jono)</dc:creator><description>&lt;p&gt;Chip == nrf51822&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>