<?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>Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63158/need-help-with-a-custom-dfu-transport</link><description>Hi all, 
 I&amp;#39;m working on a custom Bootloader for my nrf52840-based board, and it needs to support DFU from external SPI Flash. I previously was successful with a &amp;quot;first draft&amp;quot; where I implemented by own DFU protocol (see https://devzone.nordicsemi.com</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Oct 2022 15:30:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63158/need-help-with-a-custom-dfu-transport" /><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/393075?ContentTypeID=1</link><pubDate>Fri, 28 Oct 2022 15:30:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc27e972-e924-4510-8ed9-21b0b14b9865</guid><dc:creator>Inia</dc:creator><description>&lt;p&gt;Hi brooksp,&lt;br /&gt;&lt;br /&gt;Your post is very interesting. I am in the same configuration. I want to create a custom bootloader that act as DFU controller and DFU target.&lt;/p&gt;
&lt;p&gt;The dfu firmware (.zip) is downloaded in the context of the application and save in another flash.&lt;/p&gt;
&lt;p&gt;Can you confirm that you achieve to make it work when you modify nrf_bootloader_init() to launch the process of dfu ? Can you confirm that you are using a firmware create by dfu (.zip file with softdevice, bootsetings, etc) ?&lt;/p&gt;
&lt;p&gt;Thanks for your time and help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/359233?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 20:22:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b5930e0-dbcf-4502-bcd8-9ac41c5da30c</guid><dc:creator>nevi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/brooksp"&gt;brooksp&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;I am just trying to create a similar&amp;nbsp;custom DFU. Could you share your results?&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/274167?ContentTypeID=1</link><pubDate>Sun, 11 Oct 2020 20:24:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa61db6d-59ca-4434-a525-3b37232f2487</guid><dc:creator>brooksp</dc:creator><description>&lt;p&gt;Yeah, I can probably help. Send me a message; I don&amp;#39;t think the DevZone is the best place for collaboration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/273544?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 14:45:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79ba5046-19b0-43b9-a1e9-8965256e6ed0</guid><dc:creator>Rycco</dc:creator><description>&lt;p&gt;Hi, @brooksp&lt;/p&gt;
&lt;p&gt;I was wondering if you would mind sharing your code/structure for this issue, We are trying to achieve exactly the same thing, having BLE DFU with another transport running from SPI memory.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If it is something you are willing to discuss/share i would really appreciate the help, as not to invent the wheel again &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/258561?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2020 09:55:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26b49d87-9e88-4da8-b51d-7c5681758be8</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Not that I am aware of. I believe you would need some changes for the bootloader in order to change it from a &amp;quot;passive&amp;quot; to an &amp;quot;active&amp;quot; bootloader.&lt;/p&gt;
&lt;p&gt;Glad to hear that it is working now &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/258182?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 16:54:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c0bf53f-2c1c-4edd-b2af-929c1b72f06a</guid><dc:creator>brooksp</dc:creator><description>&lt;p&gt;OK, I think I fixed it! I&amp;nbsp;was only calling Object Execute once for the whole firmware image, instead of once per object:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I.e. Old way:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;while (more data to send)
{
    Object Create
    Object Write
}
Object Execute&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;New way:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;while (more data to send)
{
    Object Create
    Object Write
    Object Execute
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With this change, I was able to get my DFU logic to work! The one additional thing I have to do currently is to call my DFU function from inside&amp;nbsp;nrf_bootloader_init(), just before loop_forever() is called. I was really hoping to not modify the SDK at all, but I&amp;#39;m not sure if that&amp;#39;s possible. If there is a workaround for this, please do let me know :)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/258117?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 13:21:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:932eebc6-551e-4d84-bff7-1fc5ae1b21d3</guid><dc:creator>brooksp</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/63158/need-help-with-a-custom-dfu-transport/258001"] I would suggest leaving all interrupts, and wait for the callback.[/quote]
&lt;p&gt;I was able to get Flash erase/write to work, yes, but I&amp;#39;m not sure how much I like my solution. Is there a way via the SDK to wait for the callback?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And for the firmware image size part:&lt;/p&gt;
&lt;p&gt;My total firmware image size is not an even multiple of 4096. I was assume that&amp;#39;s true for the majority of firmware images too.&lt;/p&gt;
&lt;p&gt;I am using the same firmware image as I did in my previous bootloader (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/62777/need-help-with-custom-dfu-bootloader-transferring-back-to-main-app"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/62777/need-help-with-custom-dfu-bootloader-transferring-back-to-main-app&lt;/a&gt;) and was able to get that working, which leads me to believe the firmware image is good.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve also used this firmware image successfully as a package and used it via the BLE DFU with the nRF Connect app.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In this case, my firmware image&amp;#39;s size is 131,660 bytes. That&amp;#39;s 32 full pages, and one incomplete page.&lt;/p&gt;
&lt;p&gt;32 full pages = 131,072&lt;/p&gt;
&lt;p&gt;last page =&amp;nbsp;&lt;span&gt;131660 - 131,072 = 588&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So when I&amp;#39;m writing the final page, the actual firmware image is not 4096 bytes, and that&amp;#39;s when I&amp;#39;m running into issues. All previous 32 pages write successfully.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Attempt 1:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Object Create with size = 588&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Object Write with size = 588&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;result:&amp;nbsp;Object Create errors and says that &amp;quot;Object size must be page aligned&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Attempt 2:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Object Create with size = 4096&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Object Write with size = 588&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;result: Object Write errors and says &amp;quot;Invalid data. expected: 4096, got: 588&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m not sure how to proceed here. The firmware image only has 588 bytes left; I&amp;#39;m guessing there&amp;#39;s some way to handle this final smaller write. Do you know?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/258001?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 08:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43cd8fa2-d4e2-4104-8608-11db0b61d06d</guid><dc:creator>Edvin</dc:creator><description>[quote user="brooksp"]Right now this is failing when trying to erase/write to internal Flash. Here&amp;#39;s a log:[/quote]
&lt;p&gt;&amp;nbsp;Did you solve this?&lt;/p&gt;
&lt;p&gt;Erase failed with 0xD (12) is NRF_ERROR_TIMEOUT. This can e.g. be caused by not allowing the nRF to erase the flash, if you are waiting in an interrupt with a higher priority than the flash operations. The flash operations have a very low priority, so I would suggest leaving all interrupts, and wait for the callback.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="brooksp"]To fix that, I call&amp;nbsp;ALIGN_TO_PAGE() on the Object Create size, but I only Object Write the actual size. After the firmware transfer is complete, I call Object Execute and I get the following error:[/quote]
&lt;p&gt;&amp;nbsp;So it looks like it is expecting 4096 bytes from the dfu settings, but the actual data_object_size is only 588 long, measured with:&lt;/p&gt;
&lt;p&gt;s_dfu_settings.progress.firmware_image_offset -&lt;br /&gt; s_dfu_settings.progress.firmware_image_offset_last;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So it looks like you have not stored the entire image properly, possibly because of some issues with the flash writing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried to read out the flash of the nRF at this point in time, and checked what it looks like compared to the application hex file that you try to update to? Is it actually shorter, or is the image offset wrong, perhaps?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/257950?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 22:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8adb8a0a-afc1-489a-82b6-9d9188df72e3</guid><dc:creator>brooksp</dc:creator><description>&lt;p&gt;OK, I&amp;#39;m getting close; I&amp;#39;m able to write from SPI Flash to Internal Flash!&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;m wondering about the Object Create and Object Write calls. When writing my firmware, it takes up multiple Flash pages, so I transfer the firmware one page at a time. For the last chunk, it is less than the size of a page, however Object Create says that &amp;quot;Object size must be page aligned&amp;quot;, and errors.&lt;/p&gt;
&lt;p&gt;To fix that, I call&amp;nbsp;ALIGN_TO_PAGE() on the Object Create size, but I only Object Write the actual size. After the firmware transfer is complete, I call Object Execute and I get the following error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (data)
&amp;lt;error&amp;gt; nrf_dfu_req_handler: Invalid data. expected: 4096, got: 588
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x8&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;m not sure how to proceed. Can you help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/257900?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 14:38:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f610cb0-969b-4111-99a2-d620e26ce37a</guid><dc:creator>brooksp</dc:creator><description>&lt;p&gt;Correct!&lt;/p&gt;
&lt;p&gt;Yes, I&amp;#39;m using block SPI to read from my external SPI Flash.&lt;/p&gt;
&lt;p&gt;In Version 1 of my Bootloader (the original post), I called blocking SPI commands from inside &lt;span&gt;wa_dfu_transport_init(). This ended up crashing/failing because I queued up too many requests and filled up the App Scheduler&amp;#39;s queue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In Version 2 I added a call to&amp;nbsp;app_sched_execute() immediately after I called&amp;nbsp;nrf_dfu_req_handler_on_req(). However, this didn&amp;#39;t work&amp;nbsp;because&amp;nbsp;nrf_dfu_req_handler::m_observer isn&amp;#39;t initialized yet, so the Bootloader asserts/crashes when processing the Object Create/Write requests. To fix this, I need&amp;nbsp;nrf_dfu_init() to be called before my&amp;nbsp;update_device_firmware() is called.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In Version 3, I tried a work-around. In&amp;nbsp;wa_dfu_transport_init(), I queued a new request to an unused request OP, *without*&amp;nbsp;app_sched_execute(). I then set the request.callback.response to be&amp;nbsp;update_device_firmware(). Unfortunately this doesn&amp;#39;t work either. It does successfully delay calling update_device_firmware() until after&amp;nbsp;nrf_dfu_init(), but the way the App Scheduler Queue works, the queue doesn&amp;#39;t pop until the callback returns. And since my top-level function, update_device_firmware(), queues up more events, whenever&amp;nbsp;app_sched_execute() runs, the first event is still&amp;nbsp;update_device_firmware() (since it hasn&amp;#39;t returned yet), which then causes&amp;nbsp;update_device_firmware() to get run multiple times, and no other requests run.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In Version 4, I am modifying&amp;nbsp;nrf_bootloader_init() to call my top-level function, update_device_firmware(), after&amp;nbsp;nrf_dfu_init() is called. Right now this is failing when trying to erase/write to internal Flash. Here&amp;#39;s a log:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (data)
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x00026000, len=1 pages), queue usage: 0
&amp;lt;debug&amp;gt; nrf_dfu_flash: Flash erase failed (0xD): addr=0x00026000, len=0x1 bytes, pending 0
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Creating object with size: 4096. Offset: 0x00000000, CRC: 0x00000000
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m investigating this currently. I&amp;#39;m wondering if it&amp;#39;s a SoftDevice configuration issue? I&amp;#39;m not sure though. Any suggestions/recommendations are very much appreciated. Thank you!&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: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/257747?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 08:43:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5eae6316-8abb-4cf9-9308-508a76c1eaf8</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Regarding the fault handler in the boot loader, in case you run into other faults at a later point in time. Check out app_error_weak.c&amp;#39;s fault handler. ID 0x4002 refers to NRF_FAULT_ID_SDK_ASSERT, and ID 0x4001 refers to NRF_FAULT_ID_SDK_ERROR. Check out the implementation of these two in app_error_weak.c to see how to find out where the fault handler is pointing to.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="brooksp"]However,&amp;nbsp;&lt;span&gt;nrf_dfu_req_handler_init() hasn&amp;#39;t been called yet&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;It looks like your wa_dfu_transport_init() calls update_device_firmware()&lt;/p&gt;
&lt;p&gt;There are two ways of using the SPI. Blocking and non-blocking. Basically, if you have an event handler, then the SPI transactions are non-blocking, and the event handler is called when a message is sent/received. If you don&amp;#39;t have an event handler, then the SPI is blocking, so transmitting an SPI message will not return until the message has been sent.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which of the two types do you use?&lt;/p&gt;
&lt;p&gt;If you use the blocking SPI, do you start the process from your transport init function? Does&amp;nbsp;&lt;span&gt;wa_dfu_transport_init() return?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/257665?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 18:37:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2b63c28-84df-4fff-8c5c-556ee4452fc1</guid><dc:creator>brooksp</dc:creator><description>&lt;p&gt;More updates:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been making more progress, and now it looks like I&amp;#39;ve figured out how to do (4) from my original post. How I&amp;#39;m running into another issue:&lt;/p&gt;
&lt;p&gt;So when nrf_dfu_transports_init() gets called by nrf_dfu_init(), my transport fires and begins my DFU. However,&amp;nbsp;&lt;span&gt;nrf_dfu_req_handler_init() hasn&amp;#39;t been called yet. That means the&amp;nbsp;nrf_dfu_req_handler::m_observer hasn&amp;#39;t been initialized yet... So when my transport tries to do Object Create, it crashes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now I&amp;#39;m not sure where to put my DFU call now. Should I move it out of my transport init and instead call it from main(), or somewhere else? I&amp;#39;m gonna try moving it to main() now and will reply back when I know more.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/257654?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 16:00:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8458731-b9f9-4991-acd7-c816a0dd5a74</guid><dc:creator>brooksp</dc:creator><description>&lt;p&gt;Update: The Fault above was due to a mismatch in my PRN Request function. I set the request type to the wrong value, which caused the callback to trigger an assert when it say the Request Type was different than expected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/257614?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 13:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c2797ff-68ea-474b-989f-89cb425cbb15</guid><dc:creator>brooksp</dc:creator><description>&lt;p&gt;Hi Edvin, yes, let me elaborate; sorry for not being clear!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Yes, the External SPI Flash is a passive module. You are correct, it will not send anything automatically, so the Bootloader must manually read it. In effect, I&amp;#39;m trying to have the Bootloader be both the DFU Controller and DFU Target at once.&lt;/li&gt;
&lt;li&gt;For BLE, no, I am not sending commands to tell the nRF to read from Flash. Really I&amp;#39;m trying to have two distinct and separate DFU transports. For the sake of this ticket, it&amp;#39;s easiest to just image there is no BLE DFU.&lt;/li&gt;
&lt;li&gt;Data gets into the SPI Flash during normal application execution (our board uses Cellular), but I&amp;#39;m not using the background DFU to do so.&lt;/li&gt;
&lt;li&gt;And yes, in the Bootloader the DFU only needs to read from External SPI Flash, not write. I have confirmed that I can do this successfully.&lt;/li&gt;
&lt;li&gt;At the of my first post, I was not seeing any callbacks. Some more info/updates below:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Today I traced down that I need to call&amp;nbsp;app_sched_execute() in order for my DFU requests to get executed. I&amp;#39;ve added a call to&amp;nbsp;app_sched_execute() after each of my calls to&amp;nbsp;nrf_dfu_req_handler_on_req(). However now I&amp;#39;m seeing a Fault that I&amp;#39;m trying to track down. Here&amp;#39;s a log:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: Inside main
&amp;lt;debug&amp;gt; app: In nrf_bootloader_init
&amp;lt;debug&amp;gt; nrf_dfu_settings: Calling nrf_dfu_settings_init()...
&amp;lt;debug&amp;gt; nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
&amp;lt;debug&amp;gt; app: Enter nrf_bootloader_fw_activate
&amp;lt;info&amp;gt; app: No firmware to activate.
&amp;lt;debug&amp;gt; app: Enter nrf_dfu_app_is_valid
&amp;lt;debug&amp;gt; app: Return false in valid app check
&amp;lt;debug&amp;gt; app: DFU mode because app is not valid.
&amp;lt;info&amp;gt; nrf_bootloader_wdt: WDT is not enabled
&amp;lt;debug&amp;gt; app: in weak nrf_dfu_init_user
&amp;lt;info&amp;gt; app_timer: RTC: initialized.
&amp;lt;info&amp;gt; app: Entering DFU mode.
&amp;lt;debug&amp;gt; app: Initializing transports (found: 2)
&amp;lt;debug&amp;gt; nrf_dfu_ble: Initializing BLE DFU transport
&amp;lt;debug&amp;gt; nrf_dfu_ble: Setting up vector table: 0x000E0000
&amp;lt;debug&amp;gt; nrf_dfu_ble: Enabling SoftDevice.
&amp;lt;debug&amp;gt; nrf_dfu_ble: Configuring BLE stack.
&amp;lt;debug&amp;gt; nrf_dfu_ble: Enabling the BLE stack.
&amp;lt;debug&amp;gt; nrf_dfu_ble: No advertising name found
&amp;lt;debug&amp;gt; nrf_dfu_ble: Using default advertising name
&amp;lt;debug&amp;gt; nrf_dfu_ble: Advertising...
&amp;lt;debug&amp;gt; nrf_dfu_ble: BLE DFU transport initialized.
&amp;lt;debug&amp;gt; wa_dfu_transport: Initializing WA DFU transport...
&amp;lt;debug&amp;gt; wa_dfu_transport: { update_device_firmware
&amp;lt;debug&amp;gt; wa_dfu_req_handler: { wa_dfu_req_set_prn
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_MTU_GET
&amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
&amp;lt;debug&amp;gt; wa_dfu_req_handler: { set_prn_callback
&amp;lt;error&amp;gt; app: Received a fault! id: 0x00004002, pc: 0x00000000, info: 0x2003FEA8&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with a custom DFU transport</title><link>https://devzone.nordicsemi.com/thread/257612?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 13:32:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d504332-3a3b-446c-b5fe-1b52bc369925</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Just need to check. The external SPI flash is a passive module? That is, it will not send anything automatically, so you manually need to read the SPI flash from the bootloader?&lt;/p&gt;
&lt;p&gt;I am not sure I understand your implementation correctly. Are you sending commands over BLE to tell the nRF to read from flash?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I assume that the data found in the SPI flash is transferred over BLE at some point, probably as a background DFU while you run your application?&lt;/p&gt;
&lt;p&gt;If so, you should only need to read this back when you enter DFU mode, right?&lt;/p&gt;
&lt;p&gt;What callbacks is it that you don&amp;#39;t see?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>