<?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 Re: sdphost loading flashloader sdk example in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-loading-flashloader-sdk-example/m-p/1805526#M28871</link>
    <description>&lt;P&gt;Update: this is exactly the same problem as here &lt;A href="https://community.nxp.com/t5/i-MX-RT/elftosb-issue/m-p/994838" target="_blank"&gt;https://community.nxp.com/t5/i-MX-RT/elftosb-issue/m-p/994838&lt;/A&gt;&lt;/P&gt;&lt;P&gt;elftosb is silently truncating the data section from the program image. It requires s-records file to be used.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2024 22:20:11 GMT</pubDate>
    <dc:creator>astrobuf</dc:creator>
    <dc:date>2024-02-12T22:20:11Z</dc:date>
    <item>
      <title>sdphost loading flashloader sdk example</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-loading-flashloader-sdk-example/m-p/1805457#M28867</link>
      <description>&lt;P&gt;This post relates to getting the flashloader built and loaded/running on RT1064 using sdphost.&lt;BR /&gt;Our end goal is to customise the flashloader with some added functionality (as part of the&lt;BR /&gt;provisioning workflow). So the first step is getting the SDK flashloader example working.&lt;/P&gt;&lt;P&gt;I can debug load/run the flashloader from mcuxpresso, but when I try to load the binary using sdphost, it resets the CPU. Here is the .sb file I am using to create the bootable image.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;options {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;flags = 0x00;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;startAddress = 0x20000000;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ivtOffset = 0x400;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;initialLoadSize = 0x2000;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#entryPointAddress = 0x20002000;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;sources {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;elfFile = extern(0);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;section (0)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;I create the image using the command:&lt;/P&gt;&lt;P&gt;elftosb.exe -f imx -V -c imx-unsigned.bd -o ivt_1064_flashloader.bin&amp;nbsp;&amp;nbsp; Debug/evkmimxrt1064_flashloader.axf&lt;/P&gt;&lt;P&gt;I load the image using the commands:&lt;/P&gt;&lt;P&gt;./sdphost.exe -u 0x1fc9,0x0135 -V -- write-file 0x20000000 ivt_1064_flashloader.bin&lt;BR /&gt;./sdphost.exe -u 0x1fc9,0x0135 -V -- jump-address 0x20000400&lt;/P&gt;&lt;P&gt;Subsequently, the CPU resets.&lt;/P&gt;&lt;P&gt;I have tried attaching the debugger (just before running sdphost commands) and the debugger halts on main, but I can't get it to halt on Reset_Handler. It looks like the reset handler is not run, as data is not properly initialized and the system resets after a CPU exception. However, I can see that the reset handler address is valid in both the ivt and the arm vector table. (In contrast the reset handler is clearly run when I load the program using mcuxpresso debugging.)&lt;/P&gt;&lt;P&gt;Here is a partial dump of ivt_1064_flashloader.bin&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;0000000 0000 0000 0000 0000 0000 0000 0000 0000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0000400 00d1 4020 24a1 2000 0000 0000 0000 0000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0000410 0420 2000 0400 2000 0000 0000 0000 0000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0000420 0000 2000 3b88 0001 0000 0000 0000 0000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0000430 0000 0000 0000 0000 0000 0000 0000 0000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0002000 e600 2020 24a1 2000 24ed 2000 bd8d 2000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0002010 24e9 2000 24e9 2000 24e9 2000 0000 0000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0002020 0000 0000 0000 0000 0000 0000 24f5 2000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I'd appreciate it if anyone can direct me how to get the flashloader example working with sdphost. Thanks.&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 19:11:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-loading-flashloader-sdk-example/m-p/1805457#M28867</guid>
      <dc:creator>astrobuf</dc:creator>
      <dc:date>2024-02-12T19:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: sdphost loading flashloader sdk example</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-loading-flashloader-sdk-example/m-p/1805526#M28871</link>
      <description>&lt;P&gt;Update: this is exactly the same problem as here &lt;A href="https://community.nxp.com/t5/i-MX-RT/elftosb-issue/m-p/994838" target="_blank"&gt;https://community.nxp.com/t5/i-MX-RT/elftosb-issue/m-p/994838&lt;/A&gt;&lt;/P&gt;&lt;P&gt;elftosb is silently truncating the data section from the program image. It requires s-records file to be used.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 22:20:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-loading-flashloader-sdk-example/m-p/1805526#M28871</guid>
      <dc:creator>astrobuf</dc:creator>
      <dc:date>2024-02-12T22:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: sdphost loading flashloader sdk example</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-loading-flashloader-sdk-example/m-p/1805530#M28872</link>
      <description>&lt;P&gt;I tried using elftosb on s-records file, accordingly to information in the i.MX MCU Manufacturing User's Guide. See this example from section 4.2:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="astrobuf_0-1707776583435.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/262879i9E3EC671A67EC0A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="astrobuf_0-1707776583435.png" alt="astrobuf_0-1707776583435.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And guess what, elftosb segfaults with zero indication why. Terrific. By luck I discovered that the identifier "srecFile" must be "elfFile" (even though it's not an elf file) and it finally works.&lt;/P&gt;&lt;P&gt;So....&amp;nbsp; elftosb silently corrupts your program and also segfaults on simple issues like above. Why after all these years haven't these buggy tools been fixed?&lt;/P&gt;&lt;P&gt;NXP: are you listening?&lt;/P&gt;&lt;P&gt;Disgruntled User&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 22:30:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-loading-flashloader-sdk-example/m-p/1805530#M28872</guid>
      <dc:creator>astrobuf</dc:creator>
      <dc:date>2024-02-12T22:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: sdphost loading flashloader sdk example</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-loading-flashloader-sdk-example/m-p/1811229#M28954</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/168856"&gt;@astrobuf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks for contacting us. My apologies for the delayed response.&lt;/P&gt;
&lt;P&gt;The elftosb is now obsolete.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use low level tool commands, please make sure to install latest version of the Secure Provisioning SDK. See installation details here:&amp;nbsp;&amp;nbsp;&lt;A href="https://spsdk.readthedocs.io/en/latest/usage/installation.html" target="_self"&gt;Installation Guide &lt;/A&gt;&amp;nbsp;I want to ensure that you have latest version of the&amp;nbsp;BLHOST, SDPHOST&amp;nbsp; and the nxpimage, which replaces elftosb.&lt;/P&gt;
&lt;P&gt;Now, there is another trick to evaluate this with ease.&amp;nbsp;First&amp;nbsp; install our &lt;A href="https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-secure-provisioning-tool:MCUXPRESSO-SECURE-PROVISIONING" target="_self"&gt;MCUXpresso Secure Provisioning Tool v8,&lt;/A&gt; currently this is the latest version currently.&amp;nbsp; I mention this tool since uses the same tools from the SPSDK, and plus contains reference bd files and scripts.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you create a new workspace, for instance, I am using RT1020, when you click on start flashloader option, the log will show that the tool builds the flashloader.bin using a bd file and srec. See an example below.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;### Build flashloader as unsigned bootable image ###
nxpimage hab export -c "C:...\bd_files\unsigned_MIMXRT1020_flashloader_win.bd"     	-o "C:..\bootable_images\unsigned_MIMXRT1020_flashloader.bin"     	"C:\nxp\MCUX_Provi_v8\bin\_internal\data\targets\MIMXRT1020\flashloader.srec"

Success. (HAB container: C:\Users\nxf59533\secure_provisioning40000000044060434525941000\bootable_images\unsigned_MIMXRT1020_flashloader.bin created.)

nxpimage succeeded&lt;/LI-CODE&gt;
&lt;P&gt;Actually, the SPSDK is now implementing a new nxpimage tool, described over here&amp;nbsp;&lt;A href="https://spsdk.readthedocs.io/en/latest/apps/nxpimage.html" target="_blank"&gt;https://spsdk.readthedocs.io/en/latest/apps/nxpimage.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;A quick test that you can do is import our flashloader demo from the SDK, and find where the tool replace the&amp;nbsp; tool's flashloader.srec by yours. I found that the tool places flashloader&amp;nbsp; screc for the RT1064 in this address :&amp;nbsp;MCUX_Provi_v8\bin\_internal\data\targets\MIMXRT1064&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_0-1708376622336.png" style="width: 590px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/263858i2D530CF53EEB2197/image-dimensions/590x202?v=v2" width="590" height="202" role="button" title="diego_charles_0-1708376622336.png" alt="diego_charles_0-1708376622336.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The tool should use the flashloader that you created and then you can take commands as an example.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if this helps you!!!&lt;/P&gt;
&lt;P&gt;Diego&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got a couple of recommendations. This&amp;nbsp; GUI loads our flashloader to write images and provision fuses etc using NXP tools , such as BLHOST, SDPHOST and elftosb.Those tools are contained in the MCUXpre&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 21:07:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-loading-flashloader-sdk-example/m-p/1811229#M28954</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2024-02-19T21:07:38Z</dc:date>
    </item>
  </channel>
</rss>

