<?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>DFU over serial uart about nrf52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66474/dfu-over-serial-uart-about-nrf52840</link><description>I found there was a example in &amp;quot;nRF5_SDK_15.2.0_9412b96\examples\dfu\secure_bootloader\pca10056_uart\arm5_no_packs&amp;quot; . 
 Is there a applicaion example that when it recv a specific data like &amp;quot;AT+UPDATE&amp;quot; from uart, it can switch to bootloader and start to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Sep 2020 07:19:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66474/dfu-over-serial-uart-about-nrf52840" /><item><title>RE: DFU over serial uart about nrf52840</title><link>https://devzone.nordicsemi.com/thread/272181?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 07:19:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ec26573-5f44-4d64-bd83-892ece7a4b71</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It should be pretty straight forward to implement this mechanism in the application. The code may looks something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define BOOTLOADER_DFU_GPREGRET_MASK            (0xF8)      /**&amp;lt; Mask for GPGPREGRET bits used for the magic pattern written to GPREGRET register to signal between main app and DFU. */
#define BOOTLOADER_DFU_GPREGRET                 (0xB0)      /**&amp;lt; Magic pattern written to GPREGRET register to signal between main app and DFU. The 3 lower bits are assumed to be used for signalling purposes.*/
#define BOOTLOADER_DFU_START_BIT_MASK           (0x01)      /**&amp;lt; Bit mask to signal from main application to enter DFU mode using a buttonless service. */

#define BOOTLOADER_DFU_START    (BOOTLOADER_DFU_GPREGRET | BOOTLOADER_DFU_START_BIT_MASK)      /**&amp;lt; Magic number to signal that bootloader should enter DFU mode because of signal from Buttonless DFU in main app.*/


/* Call this when the custom AT command has been received */
void dfu_mode_enter(void)
{
    
    err_code = sd_power_gpregret_clr(0, 0xffffffff);
    VERIFY_SUCCESS(err_code);
    
    /* Bootloader will check this GPREGRET register on startup to 
       determine if it should enter DFU mode or not */
    err_code = sd_power_gpregret_set(0, BOOTLOADER_DFU_START);
    VERIFY_SUCCESS(err_code);
    
    NVIC_SystemReset();
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>