<?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>nRF52840 : update from a LTEM modem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94234/nrf52840-update-from-a-ltem-modem</link><description>Hello, 
 My device is already implementing DFU over BLE and all is working fine. But now, I want to add the update over LTEM (Quectel BG77). 
 I want to proceed like this : 
 (&amp;#39;ko&amp;quot; means kilobyte (KB)) 
 Step 1 =&amp;gt; First, the current application on my</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Dec 2022 15:38:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94234/nrf52840-update-from-a-ltem-modem" /><item><title>RE: nRF52840 : update from a LTEM modem</title><link>https://devzone.nordicsemi.com/thread/398600?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2022 15:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11bb9b8a-384a-4c8a-9768-6bf5529c7d9e</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;Ok that&amp;#39;s great, thank you very much !&lt;/p&gt;
&lt;p&gt;I have just noticed that I&amp;#39;m&amp;nbsp;also able to update the bootloader with the same method !&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;So, everything looks good,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thank you again for the help&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 : update from a LTEM modem</title><link>https://devzone.nordicsemi.com/thread/398452?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2022 07:52:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e3965d5-f0b6-429f-b9c0-fd3deed8542b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Aurélien,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m glad to hear it&amp;#39;s working now. I&amp;nbsp;don&amp;#39;t see any obvious problems with the&amp;nbsp;approach you have described.&lt;/span&gt;&lt;/p&gt;
[quote user="Aurel"]Since I added nrf_dfu_settings.h in my code, my application is now linking some code into&amp;nbsp;the bootloader memory segments (in particular the dfu settings structure in the end of the flash) but I guess it does not bother the ZIP generation[/quote]
&lt;p&gt;&lt;span&gt;This is fine. The application hex will include address references to the bootloader settings page, but it won&amp;#39;t include data&amp;nbsp;outside&amp;nbsp;of its memory range in flash.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 : update from a LTEM modem</title><link>https://devzone.nordicsemi.com/thread/398127?ContentTypeID=1</link><pubDate>Tue, 29 Nov 2022 13:35:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b04b4d7f-7219-4970-9286-0d6ac053a23a</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;I have good news. Indeed, it seems it is working now :)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I started with copying the .bin into bank 1 (i&amp;#39;m using&amp;nbsp;nrf_dfu_bank1_start_addr() to get the start address)&lt;/p&gt;
&lt;p&gt;Then, once i retrieve the .dat file, I had to add the following lines :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        if (m_data_file_read_len &amp;lt; INIT_COMMAND_MAX_SIZE) {
            memcpy(s_dfu_settings.init_command, m_data_file_read, m_data_file_read_len);
        }
        s_dfu_settings.bank_current = NRF_DFU_CURRENT_BANK_1;
        s_dfu_settings.progress.command_size = ctx-&amp;gt;file_read_size;
        s_dfu_settings.progress.command_offset = ctx-&amp;gt;file_read_size;
        s_dfu_settings.write_offset = m_bank1_addr;
        sd_softdevice_disable();
        uint32_t err_code = nrf_dfu_settings_write(NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;(for example, I needed to disable the softdevice before calling nrf_dfu_settings_write)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you see any corner cases, don&amp;#39;t hesitate to tell me.&lt;/p&gt;
&lt;p&gt;By the way i have one question :&amp;nbsp;Since I added nrf_dfu_settings.h in my code, my application is now linking some code into&amp;nbsp;the bootloader memory segments (in particular the dfu settings structure in the end of the flash) but I guess it does not bother the ZIP generation. nrf_utils will take into account only the first memory segment , right and will dump the others ?&lt;/p&gt;
&lt;p&gt;Now, I need to make some cleaning in my code and some tests to check if everything is still working as expected, especially regarding DFU over BLE and FDS ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 : update from a LTEM modem</title><link>https://devzone.nordicsemi.com/thread/397880?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 13:32:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5523bbd-d96f-4dc0-baa1-6da4de88b5da</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Aurélien,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, this should work. In addition, you need to set&amp;nbsp;.bank_current == NRF_DFU_CURRENT_BANK_1 to inform the bootloader that there is an image in bank 1 to be validated, and .write_offset+.progress for the&amp;nbsp;app_activate() routine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best&amp;nbsp;&lt;/span&gt;&lt;span&gt;regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 : update from a LTEM modem</title><link>https://devzone.nordicsemi.com/thread/397865?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 12:50:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15a87f92-92a2-4f9b-8287-1060b818b3dd</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;Ok good, that&amp;#39;s very interesting and it should be easier. So, in summary, I just need to&amp;nbsp;do it like this :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- Activate&amp;nbsp;&lt;span&gt;NRF_BL_DFU_ALLOW_UPDATE_FROM_APP and&amp;nbsp;NRF_DFU_IN_APP flag&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Copy &amp;quot;.bin&amp;quot; file in bank1 (first 32 bits aligned address after the&amp;nbsp;end of firmware)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Copy &amp;quot;.dat&amp;quot; file in&amp;nbsp;init_command[INIT_COMMAND_MAX_SIZE] buffer + call&amp;nbsp;nrf_dfu_settings_write (I guess i just need to add a few DFU file in the app to be able to retrieve the settings structure from the app firmware)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Then reboot and the bootloader should be able to make the update in standalone.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I try this and I ll keep you updated.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Aur&amp;eacute;lien&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 : update from a LTEM modem</title><link>https://devzone.nordicsemi.com/thread/397850?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 12:12:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:975c7966-dc14-4314-8740-53d1a48ebc0d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Aur&amp;eacute;lien,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I forgot to point out that you do not have to make a custom transport layer. The bootloader should be able to activate your application as long as you manage to store the update image&amp;nbsp;to bank 1 and the received&amp;nbsp;init command in the settings page.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 : update from a LTEM modem</title><link>https://devzone.nordicsemi.com/thread/397831?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 11:12:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98023e3b-0dcb-425b-9ffd-765136939b7b</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Thank you so much for the reply.&lt;span&gt;In your example, you make the upgrade in the application with the serial interface, so you are using an existing transport layer of the DFU.&amp;nbsp;But according to the readme file, if I want to use an other transport layer, I need to re-write the code of&amp;nbsp;&lt;/span&gt;nrf_dfu_serial_uart so that i can interface with the DFU stack. To do so, I need to understand the DFU&amp;nbsp;transport layer in order to write new one.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At first glance, I was thinking of copying the binaries (.bin + .dat file) myself directly into the internal flash (bank 1) so not using any transport layer, and then rebooting so that the bootloader could finalize the update, but that&amp;#39;s not possible, isn&amp;#39;t it?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Aur&amp;eacute;lien&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 : update from a LTEM modem</title><link>https://devzone.nordicsemi.com/thread/397711?ContentTypeID=1</link><pubDate>Fri, 25 Nov 2022 16:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:026e8a11-d7c8-4356-89a7-d0297183e686</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Aurélien,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The bootloader supports activation of application updates which have been downloaded by the application.&amp;nbsp; To enable this, you&amp;nbsp;can build the&amp;nbsp;bootloader with&amp;nbsp;NRF_BL_DFU_ALLOW_UPDATE_FROM_APP==1 and application with NRF_DFU_IN_APP==1. This will also allow you to&amp;nbsp;import and use the same DFU modules in your application as you already use in the Bootloader. I included an example of&amp;nbsp;that in this post:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46994/background-dfu-application-source-code/187534"&gt;RE: Background DFU application source code&lt;/a&gt;&amp;nbsp;.&amp;nbsp;&lt;/p&gt;
[quote user=""]Regarding step 1 and step 2, i&amp;#39;m not worried, it is more about step 3 where i have some questions :&amp;nbsp;do I&amp;nbsp;need to update the settings in the bootloader by myself ? How can i proceed ?&amp;nbsp;[/quote]
&lt;p&gt;Yes, the application will be responsible for updating the following elements in the settings struct: bank_current, write_offset, progress, and init_command. This will allow the bootloader to activate the image you have stored in bank 1&amp;nbsp;after&amp;nbsp;you reboot.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>