<?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>Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89370/serial-bootloader-dfu-without-softdevice-and-crypto</link><description>Hello DevZone, 
 
 On my board I have a nRF52810 and a nRF52840. I want to implement a serial bootloader for the nRF52810 and have the nRF52840 program it. 
 I have looked for example projects for DFU over serial and found only projects that have encryption</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Jul 2022 11:14:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89370/serial-bootloader-dfu-without-softdevice-and-crypto" /><item><title>RE: Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/thread/376758?ContentTypeID=1</link><pubDate>Wed, 13 Jul 2022 11:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b151b677-d4f7-4b66-a537-11b1a85c5f73</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;I&amp;#39;ll guess I have to figure it out myself then.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/thread/375197?ContentTypeID=1</link><pubDate>Sat, 02 Jul 2022 14:35:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14b8a9e2-02ac-4525-b175-f58f3722e714</guid><dc:creator>T IJ</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/89370/serial-bootloader-dfu-without-softdevice-and-crypto/375128"]But why does it have to be done on the chip itself.&amp;nbsp; It seems like it would be a lot easier if you just generated the init packet together with the binary.[/quote]
&lt;p&gt;Protobuf is something we intent in using anyway so that shouldn&amp;#39;t be an issue.&lt;/p&gt;
&lt;p&gt;The reason we want to do it in the chip itself is that it will probably also perform DFU over Bluetooth to other devices. We want to probably use hex merge to merge multiple firmwares in one hex file for programming the main controller.&lt;/p&gt;
&lt;p&gt;Instead of running the nrfutil every time we have a new version we prefer to only export the hex file and let the microcontroller create all required metadata&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/thread/375128?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2022 13:58:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8059908e-e717-4272-91d8-9215141d2b67</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The init packet is encoded with Protobuf as mentioned in the documentation here: &lt;span class="item"&gt;&lt;a class="" title="Customizing the init packet" href="https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_customizing.html?cp=10_7_9"&gt;Customizing the init packet&lt;/a&gt;&lt;/span&gt;. But why does it have to be done on the chip itself.&amp;nbsp; It seems like it would be a lot easier if you just generated the init packet together with the binary.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/thread/375124?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2022 13:32:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d437947-a59b-446b-ab2a-c72017caba4b</guid><dc:creator>T IJ</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/89370/serial-bootloader-dfu-without-softdevice-and-crypto/375072"]The readme included with the &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8306.DFUMaster_5F00_UART.zip"&gt;DFUMaster_UART.zip&lt;/a&gt; explains what you need to do to generate and program the init file to the host.[/quote]
&lt;p&gt;I am able to use nrfutil to generate all the necessary files and program my device but I want to be able to generate the init file in my nRF52840. I am currently trying to find out how the init file is structured by deciphering the python files on github but so far no success.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My goal is to have my nRF52840 to serve as a host and receive firmware for the nRF52810 over USB ( want to make a program that selects a hex file, converts it to a bin file and transmit that to the nRF52840, besides the bin file, information about the update shall also be provided)&lt;/p&gt;
&lt;p&gt;The nRF52840 when done with processing shal create the init file and initiate a firmware update.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But for this I have to know how the init file is created.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have found this but it doesn&amp;#39;t list what the size is of each member.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;|- Image #{0}:
   |- Type: {1}
   |- Image file: {2}
   |- Init packet file: {3}
      |
      |- op_code: {4}
      |- signature_type: {5}
      |- signature (little-endian): {6}
      |
      |- fw_version: 0x{7:08X} ({7})
      |- hw_version 0x{8:08X} ({8})
      |- sd_req: {9}
      |- type: {10}
      |- sd_size: {11}
      |- bl_size: {12}
      |- app_size: {13}
      |
      |- hash_type: {14}
      |- hash (little-endian): {15}
      |
      |- boot_validation_type: {16}
      |- boot_validation_signature (little-endian): {17}
      |
      |- is_debug: {18}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I would like an overview of the structure of the init file with word sizes so I can make a function to generate these files.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/thread/375072?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2022 11:46:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:658234c0-2afd-47d1-ba97-c18b99155880</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="T IJsselmuiden"]I cannot find anything that resembles this init packet.[/quote]
&lt;p&gt;The readme included with the &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8306.DFUMaster_5F00_UART.zip"&gt;DFUMaster_UART.zip&lt;/a&gt; explains what you need to do to generate and program the init file to the host. And yes, the &lt;span&gt;&lt;a title="Init packet" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader_dfu_validation.html?cp=8_1_3_5_1_1_0#lib_bootloader_dfu_init"&gt;Init packet&lt;/a&gt;&lt;/span&gt; is always required, even if you allow for unsigned updates. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/thread/374734?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 12:26:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f15b4355-278a-43d8-ac59-ba564d2dd330</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;Okay I think I have the bootloader/DFU side running. I have modified the open variant of the example project to use the UART instead of USB. (exlude nrf_dfu_serial_usb.c and add nrf_dfu_serial_uart.c)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am now trying to get the host side working. I am building from one of the examples at the bottom of&amp;nbsp;&lt;/p&gt;
[quote userid="15146" url="~/f/nordic-q-a/89370/serial-bootloader-dfu-without-softdevice-and-crypto/374301"]&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader" data-contentid="fbec17e1b7f14de4a8a4f1dfd9cfd422" data-contenttypeid="f7d226abd59f475c9d224a79e3f0ec07" class="ui-contentpeek internal-link"&gt;Getting started with Nordic&amp;#39;s Secure DFU bootloader, a step by step guide&lt;/a&gt;&amp;nbsp;[/quote]
&lt;p&gt;To be precise,&amp;nbsp;&lt;span&gt;UART DFU Master code:&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/DFUMaster_5F00_UART.zip"&gt;DFUMaster_UART.zip&lt;/a&gt;&amp;nbsp;is what&amp;nbsp;I&amp;#39;ve used.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I dont know if you know anything about this code but I have a question about some addresses and stuff. I could not find any information regarding these addresses.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void start_DFU(void)
{
    uint32_t data_size;
    uint32_t application_image_address = 0x30000;
    nrf_gpio_pin_clear(LED_1);
    data_size = find_image_size(0x9000,0x10000);
    NRF_LOG_INFO(&amp;quot;Init data size: %d&amp;quot;, data_size);
    uint8_t *data;
    data= (uint8_t *) 0x9000;
    NRF_LOG_INFO(&amp;quot;Data : %x %x %d&amp;quot;, *data, *(data+1),MAX_ACTUAL_PAYLOAD);
    nrf_delay_ms(5);
    uart_send_init_packet(&amp;amp;m_dfu,(uint8_t *) 0x9000,data_size);
    nrf_delay_ms(500);
    
    data_size = find_image_size(application_image_address,application_image_address+0x40000);
    NRF_LOG_INFO(&amp;quot;Image size: %d&amp;quot;, data_size);
    //Max object size is 4096 bytes.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;First, an init packet is sent from address 0x9000 to 0x10000 ish, I cannot find anything that resembles this init packet. Is this required as I use an open bootloader? Ive read that this is a signed packet to prevent malicious attacks.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;To protect the target device against malicious attackers trying to impersonate the rightful sender of the firmware update, the init packet of the firmware package must be signed.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Second is the application_image_address = 0x30000. I guess this is the address in memory where the image is located that has to be programmed in the other microcontroller.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I try and load a image I get the message&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;error&amp;gt; nrf_dfu_req_handler: Cannot create data object without valid init command&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there a step by step tutorial on how to perform DFU as a master or are there better examples available?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/thread/374451?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2022 07:10:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cc3f046-28e7-48b0-bc2c-212760c51997</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;I have compared the two SDK_Config files and made the modifications, I still get errors that there are undefined refferences to&amp;nbsp;g_nrf_crypto_ecc_secp256r1_curve_info,&amp;nbsp;nrf_crypto_ecdsa_verify,&amp;nbsp;g_nrf_crypto_hash_sha256_info and more. I have disabled all these features in the SDK config.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If I enable those features and keep nrf_crypto disabled I get :&lt;/p&gt;
&lt;p&gt;fatal error: nrf_cc310_bl_hash_sha256.h: No such file or directory&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/thread/374338?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 11:50:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f52d788-7e0f-4de3-af43-6ec12d2de9b6</guid><dc:creator>T IJ</dc:creator><description>[quote userid="15146" url="~/f/nordic-q-a/89370/serial-bootloader-dfu-without-softdevice-and-crypto/374301"]To relax the&amp;nbsp;&lt;span&gt;security, modify the settings similar to the Open Bootloader.&lt;/span&gt;[/quote]
&lt;p&gt;Are these settings listed in the SDK_config or are they scattered throughout the code?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="15146" url="~/f/nordic-q-a/89370/serial-bootloader-dfu-without-softdevice-and-crypto/374301"]&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader" data-contentid="fbec17e1b7f14de4a8a4f1dfd9cfd422" data-contenttypeid="f7d226abd59f475c9d224a79e3f0ec07" class="ui-contentpeek internal-link"&gt;Getting started with Nordic&amp;#39;s Secure DFU bootloader, a step by step guide&lt;/a&gt;&amp;nbsp;[/quote]
&lt;p&gt;I have seen this post before, I&amp;#39;ll check if this can help me out&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial bootloader / DFU without softdevice and crypto</title><link>https://devzone.nordicsemi.com/thread/374301?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 09:17:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcfa4261-652e-4a3c-83e7-8efad72462f5</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For the nRF52810 I think the easiest would be to start with the&amp;nbsp;pca10040e_uart project in nRF5_SDK_folder \examples\dfu\secure_bootloader. To relax the&amp;nbsp;&lt;span&gt;security, modify the settings similar to the Open Bootloader.&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_open_bootloader.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_open_bootloader.html&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Currently we don&amp;#39;t have an official DFU Master code running on embedded chip (for example updating an nRF52 from another nRF52 via BLE or UART/SPI), but we have some unofficial&amp;nbsp;code at chapter 6 in this post:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader"&gt;Getting started with Nordic&amp;#39;s Secure DFU bootloader, a step by step guide&lt;/a&gt;&amp;nbsp;&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></channel></rss>