<?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>.bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84268/bin-file-of-secure-bootloader-is-too-much</link><description>Hi, 
 
 I am using nordic52840 development kit board. and I am using sdk17.1 for development. 
 I tried to create .bin for secure bootloader code inside DFU. but the file size is very large. for my case its around 261MB. 
 Can any one help me here that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Feb 2022 15:30:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84268/bin-file-of-secure-bootloader-is-too-much" /><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/352697?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 15:30:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cb14c76-f7fc-4496-87d6-374b8280911f</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;And also if i create zip package from hex file then it will automatically remove the UICR register form the hex file and create the binary file from it. and the size of that bin file is exact the same what i required.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/351029?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 09:22:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56df56bb-4186-48e8-8438-db7ae4ceba3e</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;Thanks Vidar for your support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/351023?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 09:07:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41abe4e9-a0cb-48de-83f1-2b624ac1d3cd</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes, that correct. But you should be able to automate this process.&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><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/351018?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 08:42:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51f0f01c-fca0-4387-9865-b9e4a09eb2fa</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;ok, got it.&lt;/p&gt;
&lt;p&gt;So that means, if we don&amp;#39;t want to include UICR in .bin file then we need to remove it from hex and create bin file. That&amp;#39;s the only way right..?&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Rohit Saini&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/351014?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 08:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdf43514-6e30-4761-90bd-c118cc447dbf</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes, you have to program the original bootloader hex that has the UICR data at 0x10001014 and 0x10001018. The MBR will not start the bootloader if this data is missing.&lt;/p&gt;
&lt;p&gt;The start address is set here as you said:&lt;/p&gt;
&lt;p&gt;&lt;img style="cursor:zoom-in;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7446.pastedimage1643865905862v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;And the MBR paramater page address at 0x10001018 here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    __root uint32_t const m_uicr_mbr_params_page_address
        @ UICR_PARAM_PAGE_ADDR = NRF_MBR_PARAMS_PAGE_ADDRESS;&lt;/pre&gt;&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><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350991?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 05:26:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47ac07f9-aa52-4c97-86b8-85fdde4e086a</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1643865567680v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;But Right now i am removing the UICR data from my hex file.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1643865664736v2.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;in this case its not jumping to the bootloader part.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;And I checked the link you shared. But one thing again i didn&amp;#39;t understand that where exactly in bootloader we are assigning the address to the UICR register.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1643865905862v3.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;one place is this i know.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;That means without including the UICR register in hex file we cant jump to the bootloader location from the MBR..?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Rohit Saini&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350875?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2022 12:43:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6aadd4dc-380e-4d48-94fb-7e6035df8676</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;OK, so you should not have to set the UICR registers if your are programming the .hex.&lt;/p&gt;
[quote user="R_S"].bin is only used for creating signature separately.[/quote]
&lt;p&gt;Yes, and for DFU. &lt;/p&gt;
[quote user="R_S"]Is it possible to avoid this much manually intervention..?[/quote]
&lt;p&gt;You will have to decode the intelhex format somehow before you can compute the signature. But this is usually something you will automate through a script (shell, python, etc), so not something you should have to do manually.&lt;/p&gt;
[quote user="R_S"]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How it knows in case of blink application code and not in Bootloader code...?&lt;/p&gt;[/quote]
&lt;p&gt;The MBR will jump to the bootloader on startup if it sees the bootloader address at 0x10001014 or 0xff8. Please see the &amp;quot;&lt;span&gt;&lt;a title="Master boot record and SoftDevice reset procedure" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/mbr_bootloader/mbr_sd_reset_behavior.html?cp=4_7_3_0_11_2"&gt;Master boot record and SoftDevice reset procedure&amp;quot;&amp;nbsp;&lt;/a&gt;&lt;/span&gt; &lt;span&gt;section of the Softdevice specification for more details.&lt;/span&gt;&lt;/p&gt;
&lt;p&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: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350819?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2022 10:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8bdeb4d-1814-46a7-b2a4-f78e95996fbc</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;And i have one more doubt.&lt;/p&gt;
&lt;p&gt;LIke i am erasing the flash then loading softdevice code. and then my Blinky application code which started from 0x27000 location in flash.&lt;/p&gt;
&lt;p&gt;nrfjprog.exe --family NRF52 --eraseall&lt;/p&gt;
&lt;p&gt;nrfjprog --program s140_nrf52_7.2.0_softdevice.hex&amp;nbsp; --family NRF52&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nrfjprog --reset --program blinky_pca10056.hex --family NRF52&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;once it reset the LED start Blinking.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That means its jumping to the 0x27000 memory location. But my question is how he knows that this location it need to jump.&lt;/p&gt;
&lt;p&gt;Because when i did same for the open bootloader code. I created the hex file and i deleted the uicr Address register from hex file and then performed below steps.&lt;/p&gt;
&lt;p&gt;nrfjprog.exe --family NRF52 --eraseall&lt;/p&gt;
&lt;p&gt;nrfjprog --program s140_nrf52_7.2.0_softdevice.hex&amp;nbsp; --family NRF52&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nrfjprog --reset --program open_bootloader_usb_mbr_pca10056.hex --family NRF52&lt;/p&gt;
&lt;p&gt;But in this case its not jumping to my bootloader code. why is that so. why in blibky application its jumping from mbr to its location(0x27000) but for open bootloader code its not jumping to its loaction(0xBE000)....?&lt;/p&gt;
&lt;p&gt;How it knows in case of blink application code and not in Bootloader code...?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rohit Saini&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350778?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2022 07:23:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5df4f086-e651-469e-8a7a-f3c9a3771d55</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;I am using nrfjprog only to flash my chip. And also i am using .hex file for programming.&lt;/p&gt;
&lt;p&gt;.bin is only used for creating signature separately.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Writing UICR with nrfjprog

&amp;gt; nrfjprog --memwr 0x10001014 --val &amp;lt;bl_start&amp;gt;

&amp;gt; nrfjprog --memwr 0x10001018 --val &amp;lt;mbr_param_page&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But this process will be manually right. First need to build the code then remove the UICR content from the .hex file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;creating .bin based on that hex file and then i need to create the signature on that bin.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is it possible to avoid this much manually intervention..?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rohit Saini&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350775?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2022 07:11:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ae43205-799b-4e5b-a99d-8bb2af278a11</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The UICR registers used by the bootloader are only meant to be written once when you first program the device. They cannot be included a DFU image.&lt;/p&gt;
[quote userid="109220" url="~/f/nordic-q-a/84268/bin-file-of-secure-bootloader-is-too-much/350772#350772"]Now i question. How many ways we can write the data into UICR register..?[/quote]
&lt;p&gt;What are you currently using for programming the chip? nrfjprog, jlink commander, or something else? Also, it is a must to use the .bin file for programming, or can you use the .hex?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Writing UICR with nrfjprog&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; nrfjprog --memwr 0x10001014 --val &amp;lt;bl_start&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; nrfjprog --memwr 0x10001018 --val &amp;lt;mbr_param_page&amp;gt;&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><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350772?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2022 06:25:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ac309b3-8324-468e-b069-9d1abcac5c0b</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;Actually i am using my won public key and certificate to create a signature on .bin directly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And i did as you mentioned by removing the UICR register from hex and then created bin file from hex by using &amp;quot;&lt;span&gt;arm-none-eabi-objcopy&amp;quot; command.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now i question. How many ways we can write the data into UICR register..?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Or anything else we can change here, so that our code directly jump to the Bootloader address..?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you help me here...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Rohit Saini&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350704?ContentTypeID=1</link><pubDate>Tue, 01 Feb 2022 14:03:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46acdea4-b032-4fc7-bd67-aadb67128643</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The nrfutil script does this already. I.e. strips away the UICR section from the hex, converts it to a bin, and computes the signature with your private key as input. Is there are reason you can&amp;#39;t use nrfutil?&lt;/p&gt;
[quote user="R_S"]and to run &amp;quot;arm-none-eabi-objcopy&amp;quot; command. which place i need to run this..?[/quote]
&lt;p&gt;It&amp;#39;s from the command line. Objcopy is included in the GNU Arm Embedded Toolchain (&lt;a href="https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads"&gt;link&lt;/a&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350691?ContentTypeID=1</link><pubDate>Tue, 01 Feb 2022 13:43:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c90a6c5b-17f7-413a-a767-dfd80aed5120</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;bin I am using for Signature creation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But the size of that bin is very large.&lt;/p&gt;
&lt;p&gt;and to run &amp;quot;arm-none-eabi-objcopy&amp;quot; command. which place i need to run this..?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;R_S&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350683?ContentTypeID=1</link><pubDate>Tue, 01 Feb 2022 13:20:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eed54939-accd-4ab3-b105-86dc8a3b6c42</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;What&amp;#39;s the purpose of generating this bin file, is it for DFU or for programming through the debug interface. You will need to write the UICR registers separately if it&amp;#39;s for the latter.&lt;/p&gt;
[quote user="R_S"]And also to creating .bin from .hex which command need will be used....?[/quote]
&lt;p&gt;I usually use objcopy or hex2bin (&lt;a href="https://python-intelhex.readthedocs.io/en/latest/part3-1.html"&gt;link&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;example with objcopy:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;arm-none-eabi-objcopy --input-target=ihex --output-target=binary &amp;lt;input&amp;gt;.hex &amp;lt;output&amp;gt;.bin
&lt;/pre&gt;&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><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350680?ContentTypeID=1</link><pubDate>Tue, 01 Feb 2022 12:59:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08daa571-207e-4c24-8765-3373c4a71f44</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;So looks like I need to remove the content related&amp;nbsp;to uicr register from hex file and then creating bin file from it.&lt;/p&gt;
&lt;p&gt;Now,&lt;/p&gt;
&lt;p&gt;So in this case do i also need to program UICR register separately or not....?&lt;/p&gt;
&lt;p&gt;And also to creating .bin from .hex which command need will be used....?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rohit Saini&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .bin  file of Secure bootloader is too much</title><link>https://devzone.nordicsemi.com/thread/350664?ContentTypeID=1</link><pubDate>Tue, 01 Feb 2022 12:26:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c95978dd-07ea-49a5-9320-3b8f3db3b933</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Rohit,&lt;/p&gt;
&lt;p&gt;Please see my answer in this thread: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/47903/noload-directive-for-uicr_bootloader_start_address-and-uicr_mbr_params_page"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/47903/noload-directive-for-uicr_bootloader_start_address-and-uicr_mbr_params_page&lt;/a&gt;. The large file size is caused by byte padding needed to offset the UICR data that is part of the bootloader image.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>