<?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>unlocking NRF52480</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87635/unlocking-nrf52480</link><description>Dear all, 
 I have pca10059 nrf52480 dongle which I accidentally erased and I could not upload any elf file to run moreover it was not blinking red anymore, no presence in system. 
 I managed to restore the bootloader with this procedure: 
 https://devzone</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Aug 2022 17:10:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87635/unlocking-nrf52480" /><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/383528?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2022 17:10:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b38d09d5-dc76-4dbd-a814-e8ce30b6ded4</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Dear sir,&lt;/p&gt;
&lt;p&gt;I am enclosing photo of my setup.Actually,I resoldered the SWD wiring and now OpenOCD can find the CPU but after nrf52_recover command,I stll cannot flash the original bootloader.&lt;/p&gt;
&lt;p&gt;Te command to start OpenOCD is:&lt;/p&gt;
&lt;p&gt;openocd -f rpi_as_debugger.cfg -c &amp;quot;transport select swd&amp;quot; -c &amp;quot;adapter speed 100&amp;quot; -f target/nrf52.cfg&lt;/p&gt;
&lt;p&gt;I am also enclosing photo of openocd right after startup,but I still cannot write any new flash image.Grounds are the same,the dongle is connected to usb hub which is powered from Raspberry USB port.With such a configuration,I used to flash new images and debug my code as well,therefore I assume the congfiguration is correct.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/20220826_5F00_190747.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/20220826_5F00_190543.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/367347?ContentTypeID=1</link><pubDate>Wed, 11 May 2022 09:07:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0d9e7e2-74fc-4c2d-a0d1-34fafd80ffe7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Oh. I thought you were. I am not at all familiar with OpenOCD, and it is not a tool that we support from Nordic&amp;#39;s side. If you have erased the bootloader, you need a debugger/programmer to program it back in.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have a programmer, you can use nRF Command Line Tools and the command &amp;quot;nrfjprog --recover&amp;quot; to disable the APPROTECT. If you do not program the bootloader back in, you can&amp;#39;t use the dongle with nRF Connect for Desktop, but you can still program applications directly (if you have a working programmer). If you don&amp;#39;t have a programmer, an nRF DK will also work as an external programmer, if you have the correct cables to connect the programming pins on the dongle to the debug out port from the DK. Search for &amp;quot;program external device DK&amp;quot; here on DevZone for more details.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/367187?ContentTypeID=1</link><pubDate>Tue, 10 May 2022 12:58:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e11c9fa-c79b-4c19-976e-cc3721383c5d</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Actually,I was not able to program the dongle via OpenOCD,therefore I was able to successfully prpgram the dongle via nrfutil and debug via OpenOCD.But I still do not know how to program it via OpenOCD correctly,I know the commands to flash elf file,but ut simply does not run.,yet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/366968?ContentTypeID=1</link><pubDate>Mon, 09 May 2022 13:36:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2ee99f8-2c38-408b-ad77-dedf68d22d5c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;It sounds like there was a different bootloader.hex file flashed on the dongle before you erased it. One that turned off the APPROTECT.&amp;nbsp;I guess the bootloader file from the first link doesn&amp;#39;t have this patch.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, the dongle is not really a development board, as it doesn&amp;#39;t have a debugger. This is why it has a bootloader in the first place. The bootloader is a way to update the FW on the dongle without a debugger.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have a programmer that you can use on the dongle, I suggest you just erase the bootloader, and debug without the bootloader being present. Then, when you are happy with your application, you can flash the bootloader back in together with the application (and softdevice/MBR) if you want to keep the possibility to update FW without a debugger/programmer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another option would be to build your own bootloader. The bootloader on the dongle is heavily based on the nRF5 SDK\examples\dfu\open_bootloader\pca10059_usb\ and then you can apply the fix from here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect"&gt;https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(&amp;quot;fix&amp;quot;, as in disabling the approtect in your bootloader code, e.g. in main.c).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Debugging is usually easier when a bootloader is not present either way, so I suggest you just add it when you are done developing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/366880?ContentTypeID=1</link><pubDate>Mon, 09 May 2022 09:48:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c88132f3-6e79-46e6-a20e-743393056c27</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Dear sir, I am a complete newbie in microcontrollers.I just needed to unlock it to have debugging capability of the dongle via SWD.&lt;/p&gt;
&lt;p&gt;Before the accident,I could debug the code easily,now I have to add these unlocking lines of code beforecmy code runs.I am fine with that anyway.I was just curious whether ir is possible to unlock the device without those lines of code.I had an idea to dump factory firmware from my another dongle which is unlocked from factory a flash the locked dongle,but I am wondering why this procedure does not work as the devices are identical,but hardware versions are different.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/366842?ContentTypeID=1</link><pubDate>Mon, 09 May 2022 07:34:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75bc40b4-e710-4225-87c0-3240a71fb38e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;There was a HW update for the nRF52 series where the APPROTECT is enabled instead of disabled by default, and this needs to be disabled from UICR and from the SW. I am not sure whether there exists any precompiled bootloader that takes this into account.&lt;/p&gt;
&lt;p&gt;That being said. Do you really need to disable the APPROTECT? The point of the bootloader is that you can program it over USB, and skip the bootloader, right? If you have a debugger (your OpenOCD), then why do you need the bootloader in the first place?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/366809?ContentTypeID=1</link><pubDate>Sat, 07 May 2022 20:22:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ec2b8fb-1fc2-40e1-b5aa-ca47714686e2</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Dumping and flashing the image from one dongle to another another did not help, is the dumped image somehow checking the serial number of the board or version? Why I cannot dump image from one dongle and flash it to another dongle? I have to point out that even though both boards are nrf52480 one is version 2.1 and the other 1.2, maybe that is the reason I cannot just swap factory installed images between these two dongles.&lt;/p&gt;
&lt;p&gt;Is there any ftp or repository where can I download firmwares?&lt;/p&gt;
&lt;p&gt;Anyway, I think I found the solution according to all these hints:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/85671/trying-to-disable-approtect-for-debugging"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/85671/trying-to-disable-approtect-for-debugging&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66907/how-to-change-a-uicr-register-value-when-approtect-is-enabled-on-the-nrf52"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/66907/how-to-change-a-uicr-register-value-when-approtect-is-enabled-on-the-nrf52&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect"&gt;https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It seems like AP protect must be disabled. But seems like running nrf52_recover in OpenOCD unlocks the device temporarily and as long as you keep the dongle powered or you ONLY reset the dongle it stays unlocked.Seems like reset does not effect the locking mechanism, but if you unplug the dongle from power and plug in back, it automatically locks the dongle again. nrf52_recover really unlocks the device, but it probably does not write HwDisabled (0x5A) to UICR.APPROTECT, for the dongle to stay unlocked even after power down. Moreover if you flash original pca10059 firmware, it sets UICR.APPROTECT (0x10001208) to 0x00 at startup, because the dongle is locked in both cases with or without flashing the image:&lt;/p&gt;
&lt;p&gt;1) after nrf52_recover (becoming unlocked) and power down/up (becoming locked&amp;nbsp; again)&lt;/p&gt;
&lt;p&gt;2) after nrf52_recover (becoming unlocked) and then init, halt, nrf5 mass_erase, program write_image nordic_firmware.hex verify, power down/up (becoming locked again)&lt;/p&gt;
&lt;p&gt;From this I assume the factory firmware locks the dongle for the SWD debug to be accessible (which does not correspond to the fact that after I purchased the dongle and first flashed zephyr blinky example and tried to debug it via Raspberry SWD OpenOCD and Eclipse remote debugger, I could debug it without any problems that means it was unlocked. Is it possible that my dongle had factory firmware which did not enable locking at startup?&lt;/p&gt;
&lt;p&gt;Anyway, the solution/workaround to disable locking after power down was to place code snippet mentioned at the end of this conversation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/85671/trying-to-disable-approtect-for-debuggin"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/85671/trying-to-disable-approtect-for-debuggin&lt;/a&gt;g&lt;/p&gt;
&lt;p&gt;Anyway, my question is, is it possible to somehow modify the UICR.APPROTECT register or to get firmware where UICR.APPROTECT is set to 00 or do you have any other way how to start up the dongle unlocked without having the unlocking code snipped attached to my blinky code?I am complete newbie in micro controllers as well as Nordic devices.&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: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/366781?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 17:49:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d7d860b-3a4c-44a5-9675-2f9dc5232f98</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Thank you for your reply, could you please tell me whether APPROTECT is enabled by default?&lt;/p&gt;
&lt;p&gt;The thing is, I can recover the nrf52, it unlock the device and erases all. But once I flash the official bootloader again, it became locked again and you see the enclosed printout of OpenOCD, it is after flashing the firmware. The dongle works, I can flash applications, but it is locked. Even without any application, only with bootloader flashed (the dongle is blinking with red LED diode), it already is locked, at least according to OpenOCD.&lt;/p&gt;
&lt;p&gt;My goal is to, unlock the device, reflash the bootloader and than unlock it again without erasing it and reflashing the bootloader, since I think reflashing of bootloader makes it locked again.&lt;/p&gt;
&lt;p&gt;When I received the dongle, it looked like it was unlocked from factory, so I want to revert it to the same state as it was when I purchased it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/366731?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 12:56:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90500aa4-faac-4120-a5a8-225bf25a5642</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The OpenOCD is not really a tool that we support, and I am not in any way familiar with it. But looking at the log, it may look like APPROTECT is enabled. In that case, you need to recover the nRF52 (which will also delete the flash again).&lt;/p&gt;
&lt;p&gt;So I guess that if you want to use this programmer tool, you need to program your application directly, or create your own bootloader which doesn&amp;#39;t enable the approtect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For the dongle, and programming it using programmers in general (although not specifying the OpenOCD), I can recommend this blog post:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please see the section: &amp;quot;Using an external debugger&amp;quot; in particular.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/366670?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 10:17:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42377a90-a74a-4919-a368-1dbe365844ea</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Is it related to this?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect"&gt;devzone.nordicsemi.com/.../working-with-the-nrf52-series-improved-approtect&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unlocking NRF52480</title><link>https://devzone.nordicsemi.com/thread/366657?ContentTypeID=1</link><pubDate>Fri, 06 May 2022 09:44:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a73da8e9-90b0-41ef-9a7e-2b3c254d14ca</guid><dc:creator>Ivo H</dc:creator><description>&lt;p&gt;Is it related to this?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect"&gt;devzone.nordicsemi.com/.../working-with-the-nrf52-series-improved-approtect&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regarding this info from OpenOCD printout:&lt;/p&gt;
&lt;p&gt;SWD DPIDR 0x2ba01477&lt;/p&gt;
&lt;p&gt;Is it related to the fact I read somewhere that the chip is running in low power mode and I have to set up some appropriate registers?&lt;/p&gt;
&lt;p&gt;I assumed that when flashing Nordic official bootloader via openOCD I return the entire firmware of nrf52480 dongle to factory settings.&lt;/p&gt;
&lt;p&gt;Do I have to update something more than a bootloader?Is it necessary to update some more firmware and is it possible that when erasing everything and flashing the Nordic bootloader the up-to-date bootloader hex file has a routine which automatically locks the dongle cpu preventing it from being debugged?&lt;/p&gt;
&lt;p&gt;If I make a backup of another dongle with older firmware and reflash my broken dongle with this older backup?Would it prevent if from locking?I assume that all the default settings for the hardware to run are stored somewhere in chip memory therefore erasing and reflashing must definitely resolve the issue or does it mean that by reflashing bootloader some chunk of the internal memory is untouched and the settings for the hardware to run are untouched when flashing new bootloader?&lt;/p&gt;
&lt;p&gt;If so,is there any firmware to flash apart from the bootloader hex file?I only found the bootloader hex file,anything else.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>