<?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>App does not work via DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1980/app-does-not-work-via-dfu</link><description>I have a nRF51822 device which has softdevice and bootloader.
And I&amp;#39;m trying upload my app with following steps: 
 
 make .bin file with gcc 
 Push the DFU button, and entering DFU mode. (Seen as DfuTarg) 
 Upload bin file via iOS nRF Loader. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Apr 2014 07:58:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1980/app-does-not-work-via-dfu" /><item><title>RE: App does not work via DFU</title><link>https://devzone.nordicsemi.com/thread/8498?ContentTypeID=1</link><pubDate>Tue, 08 Apr 2014 07:58:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db5bcea1-bc53-4b6d-9f5d-749cdec07157</guid><dc:creator>Ken Matsui</dc:creator><description>&lt;p&gt;Thank you so much for your detail comment, Joe.
I understood your workaround to setup UICR.&lt;/p&gt;
&lt;p&gt;Actually, I could flash and run my bootloader and app with Nordic Windows tools. So, I will try it with pure-gcc environment in MacOSX.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App does not work via DFU</title><link>https://devzone.nordicsemi.com/thread/8497?ContentTypeID=1</link><pubDate>Fri, 04 Apr 2014 13:19:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da02958d-46de-4143-ade9-03253290ca3e</guid><dc:creator>Joe Merten</dc:creator><description>&lt;p&gt;Your 10001000 memory dump just shows you the Uicr register.
You sould&lt;/p&gt;
&lt;p&gt;After &amp;quot;make erase-all&amp;quot; it should be all FF.
After &amp;quot;make flash-softdevice&amp;quot; we see the &amp;quot;00 40 01 00&amp;quot; and the &amp;quot;49 00&amp;quot;.
&amp;gt; mem 10001000 20
&amp;gt; 10001000 = 00 40 01 00 FF FF FF FF FF FF FF FF FF FF FF FF
&amp;gt; 10001010 = 49 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF&lt;/p&gt;
&lt;p&gt;Now, you have to write the address of your bootloader code to 10001014, so that you got e.g.:
&amp;gt; mem 10001000 20
&amp;gt; 10001000 = 00 40 01 00 FF FF FF FF FF FF FF FF FF FF FF FF
&amp;gt; 10001010 = 49 00 FF FF 00 A0 03 00 FF FF FF FF FF FF FF FF&lt;/p&gt;
&lt;p&gt;My workaround to set up UICR for my needs is a patch in pure-gcc Makefile.posix where I add the following to the target flash-softdevice.jlink:
printf &amp;quot;\x00\xA0\x03\x00&amp;quot; &amp;gt;$(OUTPUT_PATH)uicr_bl.bin
loadbin &amp;amp;quot;$(OUTPUT_PATH)uicr_bl.bin&amp;amp;quot; 0x10001014\n
The &amp;quot;loadbin...&amp;quot; part has to be inserted into the printf line, e.g before &amp;quot;r\ng\nexit\n&amp;quot;.&lt;/p&gt;
&lt;p&gt;Finally it looks like this:&lt;/p&gt;
&lt;p&gt;flash-softdevice.jlink:
# UICR of our bootloader located at 0003A000
printf &amp;quot;\x00\xA0\x03\x00&amp;quot; &amp;gt;$(OUTPUT_PATH)uicr_bl.bin
# Write to NVMC to enable write. Write mainpart, write UICR. Assumes device is erased.
printf &amp;quot;w4 4001e504 1\n
loadbin &amp;amp;quot;$(SOFTDEVICE_OUTPUT:.hex=_mainpart.bin)&amp;amp;quot; 0\n
loadbin &amp;amp;quot;$(SOFTDEVICE_OUTPUT:.hex=_uicr.bin)&amp;amp;quot; 0x10001000\n
loadbin &amp;amp;quot;$(OUTPUT_PATH)uicr_bl.bin&amp;amp;quot; 0x10001014\n
r\n
g\n
exit\n&amp;quot; &amp;gt; flash-softdevice.jlink&lt;/p&gt;
&lt;p&gt;Well I know, that it is a little hacky to write the bootloader related UICR part during &amp;quot;make flash-softdevice&amp;quot;.
This should be better performed when flashing the bootloader itself and should automatically choose the bootloaders address.
But that needs a bit more work inside the makefiles.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App does not work via DFU</title><link>https://devzone.nordicsemi.com/thread/8496?ContentTypeID=1</link><pubDate>Sun, 30 Mar 2014 21:41:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ae08db7-30b6-4c5c-9e31-e802d6230adf</guid><dc:creator>Ken Matsui</dc:creator><description>&lt;p&gt;The flash.jlink script seems trying to flash correct address, though.&lt;/p&gt;
&lt;p&gt;r
loadbin _build/ble_bootloader_s110.bin 0003a000
r
g
exit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App does not work via DFU</title><link>https://devzone.nordicsemi.com/thread/8495?ContentTypeID=1</link><pubDate>Sun, 30 Mar 2014 21:31:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55076941-c9fa-4981-8f18-9ee343d9a08d</guid><dc:creator>Ken Matsui</dc:creator><description>&lt;p&gt;Hi Joe,&lt;/p&gt;
&lt;p&gt;I was able to connect to the custom board with JLink LITE.
And, I&amp;#39;m trying to rewrite soft device/bootloader built with pure-gcc (following your tutorial, thank you)&lt;/p&gt;
&lt;p&gt;But the bootloader code did not locate in the flash sector &amp;quot;3A000h&amp;quot;.
&amp;gt; J-Link&amp;gt;mem 10001000 20
&amp;gt; 10001000 = 00 40 01 00 FF FF FF FF FF FF FF FF FF FF FF FF
&amp;gt; 10001010 = 49 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using your makefile and &amp;quot;LINKER_SCRIPT := ../gcc_nrf51_s110_bootloader.ld&amp;quot; from BleblGcc-V2.
I&amp;#39;d appreciate it if you could give some advice for flashing bootloader with pure-gcc.
Thanks in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App does not work via DFU</title><link>https://devzone.nordicsemi.com/thread/8494?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2014 12:13:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d0fb71d-22b4-4db6-82d3-a609d7ad4ff0</guid><dc:creator>Ken Matsui</dc:creator><description>&lt;p&gt;It&amp;#39;s a custom hardware with nRF51822. And there is no JTAG adaptor yet...&lt;/p&gt;
&lt;p&gt;So, I was not able to DFU-OTA and I&amp;#39;m making JTAG adaptor jig right now.
Will try to check &amp;quot;mem 10001000 20&amp;quot; and &amp;quot;mem 3FC00 10&amp;quot;.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App does not work via DFU</title><link>https://devzone.nordicsemi.com/thread/8493?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2014 12:06:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e486fe5c-062f-4cca-96a6-1b5201c0a682</guid><dc:creator>Joe Merten</dc:creator><description>&lt;p&gt;What hardware are you working on, is it a Nordic dev-board (which) or a custom hardware with nRF51822?
Hoping that you own a Jtag adapter, could you provide a dump of &amp;quot;mem 10001000 20&amp;quot; and &amp;quot;mem 3FC00 10&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App does not work via DFU</title><link>https://devzone.nordicsemi.com/thread/8492?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2014 11:44:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33036674-c656-44a4-a11f-673a18b42d79</guid><dc:creator>Ken Matsui</dc:creator><description>&lt;p&gt;Thank you for your advice! Actually, I bought this device from another supplier. I&amp;#39;m not sure how SoftDeivce and bootloader was flashed, but I think it was flashed by nRFgo Studio. (And I&amp;#39;m trying to upload bin file which built with gcc &amp;amp; Mac)&lt;/p&gt;
&lt;p&gt;So, the causes of this issues is that the way of flashing/building SoftDevice/bootloader/App was not unified?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App does not work via DFU</title><link>https://devzone.nordicsemi.com/thread/8491?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2014 11:24:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bb3b4d6-8739-40eb-8be4-3fdbc1671020</guid><dc:creator>Joe Merten</dc:creator><description>&lt;p&gt;The UICR must be set up correctly.
You may check that with your Jtag adapter.
If using S110 SoftDevice it looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ JLinkExe -Device nrf51822 -If SWD
...
J-Link&amp;gt;mem 10001000 20
10001000= 00 40 01 00 FF FF FF FF FF FF FF FF FF FF FF FF
10001010= 49 00 FF FF 00 A0 03 00 FF FF FF FF FF FF FF FF

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&amp;quot;00 40 01 00&amp;quot; is the beginning of your application code = 14000h.&lt;/li&gt;
&lt;li&gt;&amp;quot;00 A0 03 00&amp;quot; is the beginning of the bootloader code = 3A000h. (3A000h is not the standard value here, you may see a 3C800h instead)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Normally, the UICR should set up correctly, but it may depend on the way you flashed your SoftDevice and/or your bootloader (did you used Windows nRFgo Studio or Segger JLinkExe from Linux Command line ...?).&lt;/p&gt;
&lt;p&gt;The UICR is used by the SoftDevice for e.g.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Starting the bootloader at poweron&lt;/li&gt;
&lt;li&gt;Switching the interrupt redirections to the application when the bootloader starts it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You may also check the bootloaders persistent data which is located in the last flash sector (3FC000h):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ JLinkExe -Device nrf51822 -If SWD
...
J-Link&amp;gt;mem 3FC00 10
0003FC00= 01 00 00 00 F5 61 00 00 FF 00 00 00 DC 0A 00 00

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Check bootloader_settings_t (in bootloader_types.h of the bootloader example) for the meaning of the values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App does not work via DFU</title><link>https://devzone.nordicsemi.com/thread/8490?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2014 11:11:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b7f7ea3-de93-4f6b-aea7-ad4449d68152</guid><dc:creator>Joe Merten</dc:creator><description>&lt;p&gt;What means »My app does not run«?
Is the bootloader still running (still seeing the &amp;quot;DfuTarg&amp;quot; via Ble)?
What bootloader are you using (e.g. bootloader example from Nordic Sdk 5.2, compiled with gcc 4.8 or Keil ...)?
If using nRFgo hardware (Starter Kit) which Led&amp;#39;s are on?
Does your app running right when flashing via Jtag?
Startaddress of your app 0x14000?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>