<?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>nRF51822 flash programming over SWD</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12260/nrf51822-flash-programming-over-swd</link><description>Hi, I would like to program nRF51822 flash over SWD interface. I have another micro LPC1100 series that has the flash image for RF51822 and connected to nRF51822 over SWDIO and SWCLK pins.
What are the steps to achieve so? Could anyone please share the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Mar 2016 17:01:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12260/nrf51822-flash-programming-over-swd" /><item><title>RE: nRF51822 flash programming over SWD</title><link>https://devzone.nordicsemi.com/thread/46371?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 17:01:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7e98777-78ab-4990-bf23-aeade1d5429c</guid><dc:creator>harryB</dc:creator><description>&lt;p&gt;Hi RK,
Thank you very much for quick reply.
I just downloaded the CMSIS-DAP Beta 0.01 from the &lt;a href="https://silver.arm.com/browse/CMSISDAP"&gt;link text&lt;/a&gt; this is the source you are talking about? If you intend to refer different code base please let me know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 flash programming over SWD</title><link>https://devzone.nordicsemi.com/thread/46370?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 16:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b213a902-b917-4390-b425-014ef1c911f2</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Yep that&amp;#39;s pretty much it. I would then really suggest you start with the CMSIS-DAP code, it&amp;#39;s two parts, a bit-banger on one side to talk SWD and a thin veneer intended to attach to a USB interface to get the commands. You just need to separate out the interface piece and drive it directly. That&amp;#39;s not the most-efficient way to do it, but it&amp;#39;s code which works, the interface is pretty clean, you just call the functions and you have a comms channel.&lt;/p&gt;
&lt;p&gt;I wouldn&amp;#39;t bother too much about MEM-AP or anything else, just get the startup sequence sent and use the rest of CMSIS-DAP as written. Effectively you&amp;#39;re calling a sequence of the CMSIS-DAP functions, and there are only a couple of 10s of them, that&amp;#39;s the fastest to market I can think of.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 flash programming over SWD</title><link>https://devzone.nordicsemi.com/thread/46369?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 16:04:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0cd1fe6-f7f8-4add-b3ed-e7c50d6a11f6</guid><dc:creator>harryB</dc:creator><description>&lt;p&gt;Hi RK,&lt;/p&gt;
&lt;p&gt;Thanks, unfortunately, we don&amp;#39;t plan to use any commercial programmer or have pre-flashed boot loader on the nRF51822.&lt;/p&gt;
&lt;p&gt;If I interpret it correctly the sequence would be&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;initialize SWD connection between
LPC100 and nrf51822  by bit banging
the SWDIO/SWCLK signals (50 clock
cycles, reading IDCODE register and
getting ack)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;send commands from
LPC1100 to nRF51822 to halt //Do I
need to do it under MEM-AP or any
other register of nRFP8122 or DP?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Write routine on LPC1100 to erase
flash of nRF51822 and send those to
nRF51822 //Do I need to connect to
MEM-AP  and send those command to
memory, how does the nRF51822 knows
that it needs to erase the flash?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Write a routine on LPC1100 to
upload the data to nRF51822// Do I
need to connect to MEM-AP?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Write a routine on LPC1100 to reset the
nRF51822 to reset after the upload?
//how do I do it under SWD control?&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This are the top level sequence (what I think) which will turn into sub section of each. If you can provide any pointers that would be appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 flash programming over SWD</title><link>https://devzone.nordicsemi.com/thread/46368?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2016 23:33:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d1d45a8-3b5f-4b4b-bf5d-44f46c9e3e7e</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;That&amp;#39;s not very easy. You&amp;#39;d need a complete, well at least a partial, implementation of the SWD protocol on the LPC1100, enough to bit bang the SWD interface on the nrf51 into responding, halting and uploading data.&lt;/p&gt;
&lt;p&gt;Then you&amp;#39;d need to write more code on the LPC1100 to drive the SWD code and do the upload, which means understanding the SWD protocol.&lt;/p&gt;
&lt;p&gt;CMSIS-DAP has a free source implementation of a bit banger for SWD, it&amp;#39;s designed for use with USB but the underlying code could be used.&lt;/p&gt;
&lt;p&gt;This is a very hard way to do it. You&amp;#39;d be better off putting a bootloader on the nrf51 and using one of the serial bootloader implementations to talk to it. That means however programming the chip once with some kind of commercial programmer (or buying modules which have bootloaders on them).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>