<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to create a non-encrypted factory image with custom secondary bootloader on LPC11U68 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867200#M34574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;We are working on a firmware for the LPC11U68 (custom PCB design), and we try to integrate a secondary bootloader (SBL) because the primary bootloader (DFU via ISP-mode on USB MSC) is not suitable for our application.&lt;BR /&gt;I carefully read and follow the instruction of the application note AN12037 (&lt;A href="https://www.nxp.com/docs/en/application-note/AN12037_LPC11U6x.zip"&gt;LPC11U6x USB DFU Secondary Bootloader, Rev. 1 – September 2017&lt;/A&gt;). However, I did not find a way to create a simple factory image with a custom SBL, i.e. a binary that integrates both the custom SBL and the user application.&lt;BR /&gt;The “lpc11xx_secimgcr.exe” provided in the “image-creator-tools” seems to only give the option to create encrypted factory image through the “--factory-image-create” option. Is there another option to create non-encrypted factory image using this tool, or to combine the SBL binary with the application using another tool?&lt;BR /&gt; &lt;BR /&gt;Here are the details of the steps I followed to create the custom SBL and the SBL-compatible firmware. Note that I develop with MCUXpresso v10.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Custom SBL: Based on the project “sbl_dfu_lpc11u60” given in the application note’s sources, I customized the SBL to our needs. When programmed on the LPC11U68, (via SWD or primary bootloader), the SBL works as expected (LpcDevice in device manager and found by “dfu-util.exe” with option “-l”).&lt;/LI&gt;&lt;LI&gt;SBL-compatible firmware: I modified our firmware to integrate the required header and memory map as described in the application note:&lt;UL&gt;&lt;LI&gt;Automatic linker script disabled,&lt;/LI&gt;&lt;LI&gt;Definition of memory region to take into account the SBL space,&lt;/LI&gt;&lt;LI&gt;Definition of the image header with the firmware version,&lt;/LI&gt;&lt;LI&gt;Generation of the CRC using “lpc11xx_secimgcr.exe”&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;SBL DFU tests: When the SBL is programmed, the DFU works as expected.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Mar 2019 20:09:26 GMT</pubDate>
    <dc:creator>d_m_</dc:creator>
    <dc:date>2019-03-18T20:09:26Z</dc:date>
    <item>
      <title>How to create a non-encrypted factory image with custom secondary bootloader on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867200#M34574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;We are working on a firmware for the LPC11U68 (custom PCB design), and we try to integrate a secondary bootloader (SBL) because the primary bootloader (DFU via ISP-mode on USB MSC) is not suitable for our application.&lt;BR /&gt;I carefully read and follow the instruction of the application note AN12037 (&lt;A href="https://www.nxp.com/docs/en/application-note/AN12037_LPC11U6x.zip"&gt;LPC11U6x USB DFU Secondary Bootloader, Rev. 1 – September 2017&lt;/A&gt;). However, I did not find a way to create a simple factory image with a custom SBL, i.e. a binary that integrates both the custom SBL and the user application.&lt;BR /&gt;The “lpc11xx_secimgcr.exe” provided in the “image-creator-tools” seems to only give the option to create encrypted factory image through the “--factory-image-create” option. Is there another option to create non-encrypted factory image using this tool, or to combine the SBL binary with the application using another tool?&lt;BR /&gt; &lt;BR /&gt;Here are the details of the steps I followed to create the custom SBL and the SBL-compatible firmware. Note that I develop with MCUXpresso v10.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Custom SBL: Based on the project “sbl_dfu_lpc11u60” given in the application note’s sources, I customized the SBL to our needs. When programmed on the LPC11U68, (via SWD or primary bootloader), the SBL works as expected (LpcDevice in device manager and found by “dfu-util.exe” with option “-l”).&lt;/LI&gt;&lt;LI&gt;SBL-compatible firmware: I modified our firmware to integrate the required header and memory map as described in the application note:&lt;UL&gt;&lt;LI&gt;Automatic linker script disabled,&lt;/LI&gt;&lt;LI&gt;Definition of memory region to take into account the SBL space,&lt;/LI&gt;&lt;LI&gt;Definition of the image header with the firmware version,&lt;/LI&gt;&lt;LI&gt;Generation of the CRC using “lpc11xx_secimgcr.exe”&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;SBL DFU tests: When the SBL is programmed, the DFU works as expected.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2019 20:09:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867200#M34574</guid>
      <dc:creator>d_m_</dc:creator>
      <dc:date>2019-03-18T20:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a non-encrypted factory image with custom secondary bootloader on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867201#M34575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;Please See AN chapter 8,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;8.1.1 Inserting a CRC checksum in the application image&lt;BR /&gt;To make an application image acceptable to the DFU SBL, add a CRC checksum to the application binary. See Section 9.2 for more information on how to perform DFU updates with a DFU capable application image.&lt;BR /&gt;The syntax to invoke the tool to create an output binary file with image header from an input binary file is:&lt;BR /&gt;lpc11xx_secimgcr.exe &amp;lt;input file name.bin&amp;gt; &amp;lt;output file name.dfu&amp;gt;&lt;BR /&gt;The syntax in Fig 23. generates the CRC for the input application binary file ‘app_blinky.bin’ and creates an output file ‘burnhid.dfu’.&lt;BR /&gt;The CRC can be generated over the image header or over the entire length of the image.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we can use&amp;nbsp;&lt;SPAN&gt;lpc11xx_secimgcr.exe &amp;lt;input file name.bin&amp;gt; &amp;lt;output file name.dfu&amp;gt; this to generate a non-secure image.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jun Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2019 03:05:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867201#M34575</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2019-03-26T03:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a non-encrypted factory image with custom secondary bootloader on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867202#M34576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Jun,&lt;BR /&gt;Thanks for your answer. Unfortunately, to what I understand and after numerous tests, the command you mention is only to create a DFU capable image (with a generated CRC), and does not create a &lt;EM&gt;factory image&lt;/EM&gt; &lt;EM&gt;that integrates both the secondary bootloader and the application&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px; color: #808080;"&gt;Note: I tried the command with both a binary (with .bin extension) and a DFU image (with .dfu extension), but the command “lpc11xx_secimgcr.exe &amp;lt;input file&amp;gt; &amp;lt;output file &amp;gt;” with no parameter does not integrate the bootloader for a factory image.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I found a solution to create this factory image (SBL + DFU image) using the &lt;A href="https://sourceforge.net/projects/srecord/" rel="nofollow noopener noreferrer" target="_blank"&gt;SRecord tool&lt;/A&gt;, however&amp;nbsp;we have other problems with the SBL. The command to create the factory image with SRecord is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;srec_cat.exe &amp;lt;input bootloader binary with checksum.bin&amp;gt; -binary &amp;lt;input DFU file with CRC.dfu&amp;gt; -binary -offset 0x2000 -o &amp;lt;output factory image.bin&amp;gt; -binary‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the question has been marked as "assumed answered", I create another post for the "bug" we found in the SBL of AN12037: &lt;A href="https://community.nxp.com/message/1130244" rel="nofollow noopener noreferrer" target="_blank"&gt;Hard-fault on SBL re-entry, Application Note AN12037 (LPC11U6x USB DFU Secondary Bootloader)&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2019 13:16:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867202#M34576</guid>
      <dc:creator>d_m_</dc:creator>
      <dc:date>2019-03-26T13:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a non-encrypted factory image with custom secondary bootloader on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867203#M34577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try -h option?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_31.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/75539i9CEF298F1F1DFD2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_31.png" alt="pastedImage_31.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I tested from my side:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_104.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/74675iD556A17991C635EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_104.png" alt="pastedImage_104.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The generated blink1_dfu.dfu includes both SBL and application file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jun Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 08:34:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867203#M34577</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2019-03-28T08:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a non-encrypted factory image with custom secondary bootloader on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867204#M34578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did look at the “help” of the “lpc11xx_secimgcr.exe”, and as mentioned in the question of my initial post, I tried the “--factory-image-create” (i.e. “-f”) option. I thought that the “&amp;lt;key file name&amp;gt;” argument was mandatory. Personally, I would have use brackets in the help to denote this argument: “[key file name]”.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, this solution with the “-f” argument does not work on my side for two reasons:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The resulting factory image does not work when programmed to the development board (using base address 0). However, with the srec_cat command and the same initial files it works.&lt;/LI&gt;&lt;LI&gt;The help section of “lpc11xx_secimgcr.exe” mention that the SBL is expected to be a file named “sbl_11uxx_dfu.bin”, but it does not seem to take this file when present (Note: in the “image-creator-tool” folder, the SBL is “sbl_dfu_lpc11u60.bin” and with both names “sbl_dfu_lpc11u60.bin” and “sbl_11uxx_dfu.bin” this does not work). By looking at the binary, the first part of the generated image does not correspond to the provided SBL. Take a look at the resulting factory image binary and compare it to the SBL binary.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76016iEBC85AE76262057D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may be doing something wrong, but it seems more that the tool does not provide the expected output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;BR /&gt;Best,&lt;BR /&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 09:51:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867204#M34578</guid>
      <dc:creator>d_m_</dc:creator>
      <dc:date>2019-03-28T09:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a non-encrypted factory image with custom secondary bootloader on LPC11U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867205#M34579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;I contacted the author. you are right the lpc11xx_secimgcr.exe may has problem.&lt;/P&gt;&lt;P&gt;Your method of using srec_cat.exe to combine files is recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Jun Zhang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2019 04:09:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-create-a-non-encrypted-factory-image-with-custom/m-p/867205#M34579</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2019-03-29T04:09:30Z</dc:date>
    </item>
  </channel>
</rss>

