<?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>i.MX RT Crossover MCUs中的主题 Re: elftosb issue</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994843#M5902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;Well, changing to "Release" did eliminate the section overflow (thanks for the pointer), so it does build without any intervention from me.&amp;nbsp; That's as far as the good news goes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run through the IDE, it appears to be alive .&amp;nbsp; According to the "&lt;A href="https://www.nxp.com/docs/en/nxp/application-notes/AN12238.pdf"&gt;Flashloader Use Case&lt;/A&gt;" document that comes with the flashloader package, I think I should be able to run&amp;nbsp; "&lt;STRONG&gt;blhost -u -- get-property 1&lt;/STRONG&gt;" and get a response (I don't).&amp;nbsp; Also, apparently when the flash loader comes up it re-enumerates the USB port to a different PID/VID, but all that I see in "Device Manager" is the device go away.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, I'm clearly a &lt;STRONG&gt;&lt;EM&gt;pain-in-the-***&lt;/EM&gt;&lt;/STRONG&gt;, but if you have any other thoughts, I'd sure appreciate them...&lt;/P&gt;&lt;P&gt;I've even tried ignoring any build and just using the images that come with the flashloader package (see my latest question &lt;A _jive_internal="true" href="https://community.nxp.com/thread/525697"&gt;here&lt;/A&gt;).&amp;nbsp; That doesn't even work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Feb 2020 21:43:06 GMT</pubDate>
    <dc:creator>EdSutter</dc:creator>
    <dc:date>2020-02-26T21:43:06Z</dc:date>
    <item>
      <title>elftosb issue</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994838#M5897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to use elftosb (V4.0.0) to generate an updated version of the flashloader sb file, and having some troubles.&lt;/P&gt;&lt;P&gt;I created a bd file with the following contents;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;options {
 flags = 0x00;
 startAddress = 0x20208000;
 ivtOffset = 0x400;
 initialLoadSize = 0x2000;
}

sources {
 elfFile = extern(0);
}

section (0)
{
}
‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;...and then created the ivt-including file with;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;amd64/elftosb -f imx -V -c c.bd -o flashloader.bin evkmimxrt1020_flashloader.axf‍&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;(I had to use my own built version of the flashloader because the one in the distribution is V2.1 and the one in the bootloader example is V2.7).&lt;/P&gt;&lt;P&gt;I can then upload that to the board, and run it, with;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;./sdphost -u 0x1FC9,0x0130 -V -- write-file 0x20208000 flashloader.bin
./sdphost -u 0x1FC9,0x0130 -- jump-address 0x20208400‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;...trouble is, it doesn't start &lt;SPAN class="lia-unicode-emoji" title=":disappointed_face:"&gt;&lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt; The flashloader works perfectly when run from mcuexpresso.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On investigation I find that the version of the file uploaded by mcuexpresso and the version uploaded by sdphost are identical, until the very end of the load. To the left is the working version uploaded from mcuexpresso, to the right the version uploaded by sdphost (Star means the line is repeated...this is output from od);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Screenshot from 2020-02-06 16-48-19.png"&gt;&lt;IMG alt="Screenshot from 2020-02-06 16-48-19.png" src="https://community.nxp.com/t5/image/serverpage/image-id/102074i3F40941E05C548F6/image-size/large?v=v2&amp;amp;px=999" title="Screenshot from 2020-02-06 16-48-19.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...what is confusing is that the end of the program image is at an offset of 0x15f48, and everything looks good until there!&lt;/P&gt;&lt;P&gt;If I take the memory image on the left and re-upload it using sdphost then flashloader all works correctly.&amp;nbsp; My conclusion is therefore that sdphost is curtailing the write of the output file too soon but, frankly, it shouldn't matter because the differences are all after the end of the program, according to the map file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no idea what is going on here. Can anyone suggest what these extra data are, and why they are needed? I guess they could be thunks or something, but then I would expect them to be in the output file.&amp;nbsp; For completeness the map file and the axf are attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a workaround for now - just image back off the board and use that for sdphost, but it doesn't explain why elftosb isn't working correctly for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;DAVE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:32:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994838#M5897</guid>
      <dc:creator>dmarples</dc:creator>
      <dc:date>2020-11-02T14:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: elftosb issue</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994839#M5898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The plot thickens...if I convert the axf (==elf) into an srec file and use that as the source for elftosb;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;arm-none-eabi-objcopy -O srec evkmimxrt1020_flashloader.axf evk.srec&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;...then everything works properly.&lt;/P&gt;&lt;P&gt;I don't know what elftosb is missing in an elf file, but it's something.&amp;nbsp; My workaround now got easier, but this should probably be investigated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;DAVE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2020 17:21:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994839#M5898</guid>
      <dc:creator>dmarples</dc:creator>
      <dc:date>2020-02-06T17:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: elftosb issue</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994840#M5899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for thinking out loud, but I think I've found the issue. The data segment (initialised data) follows the end of text, so that's not being recognised and loaded.&amp;nbsp; It's possible there's a magic incantation to elftosb to include that (please let me know if so) but it might also be a bug...and it's certainly a trap for the unwary, like me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;DAVE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2020 17:38:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994840#M5899</guid>
      <dc:creator>dmarples</dc:creator>
      <dc:date>2020-02-06T17:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: elftosb issue</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994841#M5900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave, thanks for posting this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just getting started on the 1020EVK (eventually headed for 1064) and I started with this application but lost faith quickly simply because it didn't build successfully.&amp;nbsp; The error (as you must already know) is a section overflow.&lt;/P&gt;&lt;P&gt;I attempted two different fixes:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Increase m_text size by 0x8000.&lt;/LI&gt;&lt;LI&gt;Reduce space needed by setting BL_CONFIG_HS_USB_HID to 0 in bootloader_config.h&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Neither attempt worked for me.&amp;nbsp; Would you mind sharing what you did to get over this hump?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 21:53:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994841#M5900</guid>
      <dc:creator>EdSutter</dc:creator>
      <dc:date>2020-02-25T21:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: elftosb issue</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994842#M5901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you've got to do a Release Build rather than a Debug one....I &lt;/P&gt;&lt;P&gt;seem to remember that was the trick.&amp;nbsp; If you need the app I can probably &lt;/P&gt;&lt;P&gt;send you the binary if you can't get it built.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DAVE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 15:49:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994842#M5901</guid>
      <dc:creator>dmarples</dc:creator>
      <dc:date>2020-02-26T15:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: elftosb issue</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994843#M5902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;Well, changing to "Release" did eliminate the section overflow (thanks for the pointer), so it does build without any intervention from me.&amp;nbsp; That's as far as the good news goes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run through the IDE, it appears to be alive .&amp;nbsp; According to the "&lt;A href="https://www.nxp.com/docs/en/nxp/application-notes/AN12238.pdf"&gt;Flashloader Use Case&lt;/A&gt;" document that comes with the flashloader package, I think I should be able to run&amp;nbsp; "&lt;STRONG&gt;blhost -u -- get-property 1&lt;/STRONG&gt;" and get a response (I don't).&amp;nbsp; Also, apparently when the flash loader comes up it re-enumerates the USB port to a different PID/VID, but all that I see in "Device Manager" is the device go away.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, I'm clearly a &lt;STRONG&gt;&lt;EM&gt;pain-in-the-***&lt;/EM&gt;&lt;/STRONG&gt;, but if you have any other thoughts, I'd sure appreciate them...&lt;/P&gt;&lt;P&gt;I've even tried ignoring any build and just using the images that come with the flashloader package (see my latest question &lt;A _jive_internal="true" href="https://community.nxp.com/thread/525697"&gt;here&lt;/A&gt;).&amp;nbsp; That doesn't even work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 21:43:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994843#M5902</guid>
      <dc:creator>EdSutter</dc:creator>
      <dc:date>2020-02-26T21:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: elftosb issue</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994844#M5903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ed,&lt;/P&gt;&lt;P&gt;It seems to me that the intention is that this stuff can only easily be done with FAE support, which is a shame...anyway, here are the two scripts I use to get the whole thing off the ground;&lt;/P&gt;&lt;P&gt;The first script actually loads the monitor into memory and configures the chip (based on the first 4K of an application file that contains a memory configuration that's suitable);&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;RUNDIR=$(dirname $0)
$RUNDIR/sdphost -u 0x1FC9,0x0130 -- write-file 0x20208000 $RUNDIR/ivt_flashloader.bin
$RUNDIR/sdphost -u 0x1FC9,0x0130 -- jump-address 0x20208400
sleep 1
$RUNDIR/blhost -u 0x15a2,0x0073 -- get-property 1

# Write memory configuration
$RUNDIR/blhost -u 0x15a2,0x0073 -- write-memory 0x20204000 $RUNDIR/nuttx.bin,4096
$RUNDIR/blhost -u 0x15a2,0x0073 -- configure-memory 1 0x20204000
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;The second one burns an application (after running the first one to get the monitor loaded);&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;RUNDIR=$(dirname $0)
$RUNDIR/blhost -u 0x15a2,0x0073 -- flash-image $1 erase 9
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;...and the third erases it;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;RUNDIR=$(dirname $0)
$RUNDIR/blhost -u 0x15a2,0x0073 -- flash-image $1 erase 9
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;Having said all of that, if you're using an 1020_evk you might want to consider tinyUF2...I just committed the patches for that board for it this morning. It makes the application space on the CPU into a 'drive' that you can drag and drop onto, and once it's installed you don't need the OpenSDA stuff. Take a look at &lt;A href="https://github.com/arturo182/tinyuf2" rel="nofollow noopener noreferrer" target="_blank"&gt;TinyUF2. &lt;/A&gt;It's rather painless to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;DAVE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 22:40:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994844#M5903</guid>
      <dc:creator>dmarples</dc:creator>
      <dc:date>2020-02-26T22:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: elftosb issue</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994845#M5904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;Ok, that worked for both the provided flashloader.elf (that comes with the 1020 flashloader package) and the evkmimxrt1020_flashloader.axf (built from the SDK with MCUXpresso).&amp;nbsp; That does require your -earlier-mentioned- conversion to S-record because &lt;EM&gt;apparently&lt;/EM&gt; elftosb doesn't like the non-numerically ordered sections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For either of those files, elftosb can use&amp;nbsp;&lt;STRONG&gt;imx-ocram-unsigned.bd&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;(also comes with the flashloader package) to create the .bin that can be loaded with sdbhost.&amp;nbsp; My error was that I was not compensating for the 0x2000, which I assume is established by the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;initialLoadSize &lt;/STRONG&gt;&lt;/EM&gt;entry&amp;nbsp;in the bd file.&amp;nbsp; I see now that the IVT in the pre-built ivt_flashloader.bin did have a &lt;STRONG&gt;&lt;EM&gt;self&lt;/EM&gt; &lt;/STRONG&gt;entry of 0x20208000.&amp;nbsp; The actual starting point for the executable image is at 0x2020a000, so it is naturally loaded there when the .bin file is written to&amp;nbsp;0x20208000 (0x2020a000-0x2000).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding TinyUF2, thanks for the pointer.&amp;nbsp; Once I feel secure about what I'm doing here, maybe I'll give that a shot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks much for your tips on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2020 19:21:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/elftosb-issue/m-p/994845#M5904</guid>
      <dc:creator>EdSutter</dc:creator>
      <dc:date>2020-02-27T19:21:00Z</dc:date>
    </item>
  </channel>
</rss>

