<?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 via UART using a custom desktop application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81924/dfu-via-uart-using-a-custom-desktop-application</link><description>Hi. I would like to know how to do a DFU over UART using a custom desktop application (without using nrfutil command nor nRF Connect app). What would be the UART protocol for sending a new image via UART and what would I have to do to tell the NRF to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Nov 2021 07:55:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81924/dfu-via-uart-using-a-custom-desktop-application" /><item><title>RE: DFU via UART using a custom desktop application</title><link>https://devzone.nordicsemi.com/thread/340245?ContentTypeID=1</link><pubDate>Tue, 23 Nov 2021 07:55:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01becd3d-a70a-4662-aadb-42cd6dd32de0</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;Set the register to 0xB1.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU via UART using a custom desktop application</title><link>https://devzone.nordicsemi.com/thread/340205?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 22:36:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15fe9906-ca7b-4244-ab80-af66cef15282</guid><dc:creator>jPolo777</dc:creator><description>[quote userid="77782" url="~/f/nordic-q-a/81924/dfu-via-uart-using-a-custom-desktop-application/340037#340037"]You can enable&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#ga4e1297da5d25948277b4323a6fb87659"&gt;NRF_BL_DFU_ENTER_METHOD_GPREGRET&lt;/a&gt;&lt;span&gt;&amp;nbsp;in the sdk_config.h, and&amp;nbsp;&lt;/span&gt;write the s&lt;span&gt;pecial value in the retention register GPREGRET register&amp;nbsp;a flag (BOOTLOADER_DFU_START = 0xB1)&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;in the application and then do a soft reset (NVIC_SystemReset) to switch.&amp;nbsp;&lt;/span&gt;[/quote]
&lt;p&gt;So, If I understand well, when I want the nRF to go into DFU mode, I have to set the GPREGRET register in the nRF application (&lt;span&gt;NRF_POWER-&amp;gt;GPREGRET = 0x01&lt;/span&gt;) and then call the function NVIC_SystemReset?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU via UART using a custom desktop application</title><link>https://devzone.nordicsemi.com/thread/340037?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 11:58:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1e33d0c-11b5-4770-8b39-961dec1de623</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;See&amp;nbsp;&lt;a title="DFU mode" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader.html?cp=8_1_3_5_0_2#lib_bootloader_dfu_mode"&gt;DFU mode&lt;/a&gt;&amp;nbsp;doc that&amp;nbsp;Entering DFU mode is triggered by one of the optional sources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Button (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#ga2a0043889d40d5b09e524cc701f93fbf"&gt;NRF_BL_DFU_ENTER_METHOD_BUTTON&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;Pin reset (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#gaa89bea64482f2c4d83919922e5e84bc3"&gt;NRF_BL_DFU_ENTER_METHOD_PINRESET&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;Special value in GPREGRET register (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#ga4e1297da5d25948277b4323a6fb87659"&gt;NRF_BL_DFU_ENTER_METHOD_GPREGRET&lt;/a&gt;),&lt;/li&gt;
&lt;li&gt;Request from the application written to the settings page (&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#gab540083b75cd50e020bbd166198476c4"&gt;NRF_BL_DFU_ENTER_METHOD_BUTTONLESS&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can enable&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__bootloader__config.html#ga4e1297da5d25948277b4323a6fb87659"&gt;NRF_BL_DFU_ENTER_METHOD_GPREGRET&lt;/a&gt;&lt;span&gt;&amp;nbsp;in the sdk_config.h, and&amp;nbsp;&lt;/span&gt;write the s&lt;span&gt;pecial value in the retention register GPREGRET register&amp;nbsp;a flag (BOOTLOADER_DFU_START = 0xB1)&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;in the application and then do a soft reset (NVIC_SystemReset) to switch.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Have a look at this&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40706/fota-dfu-over-uart/158408#158408"&gt;post&lt;/a&gt;&amp;nbsp;for SPI.&amp;nbsp;&lt;span&gt;Another project that does more or less the same is from one of our FAEs&amp;#39; github:&amp;nbsp;&lt;a href="https://github.com/jimmywong2003/nrf-slim-serial-uart-dfu-host-c-code"&gt;nrf-slim-serial-uart-dfu-host-c-code&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In case you need it, you can also check the&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_dfu_transport_serial.html"&gt;bootloader&amp;#39;s serial transport documentation on infocenter&lt;/a&gt;&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>