<?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: Why does the AN12218SW bootloader fails to parse the generated .srec file? in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1277426#M7503</link>
    <description>&lt;P&gt;Hello Lukas,&lt;BR /&gt;&lt;BR /&gt;Thank you for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When rewriting/editing&amp;nbsp;&lt;SPAN&gt;AN12218, could you also put a note in about the changes in Java licenses? To be honest, the change makes the windows application quite useless.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 May 2021 06:48:26 GMT</pubDate>
    <dc:creator>roy_vanlierop</dc:creator>
    <dc:date>2021-05-17T06:48:26Z</dc:date>
    <item>
      <title>Why does the AN12218SW bootloader fails to parse the generated .srec file?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1275665#M7478</link>
      <description>&lt;P&gt;When using the supplied S32K148 bootloader application with a S32DS generated .srec file it fails to write phrases which are not aligned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="roy_vanlierop_0-1620825629334.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/144568iF9FF4344589890EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="roy_vanlierop_0-1620825629334.png" alt="roy_vanlierop_0-1620825629334.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please NXP: Fix the srecord parser in the Bootloader or fix the generated .srec file&lt;/P&gt;&lt;P&gt;Edit: &lt;A href="https://mcuoneclipse.com/2015/09/23/aligning-s19-records-to-64-bit-boundaries/" target="_self"&gt;Found this 6 year old post&lt;/A&gt; with exactly the same problem.&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 13:44:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1275665#M7478</guid>
      <dc:creator>roy_vanlierop</dc:creator>
      <dc:date>2021-05-12T13:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the AN12218SW bootloader fails to parse the generated .srec file?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1276318#M7488</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;the best option is to use a converter which aligns all the s-record lines and which forces all the lines to have the same length. The advantages are: it helps to keep the bootloader small because the parser will be very simple. Second, you can use any IDE / compiler - regardless of output, you will always have s-record file which will be 100% working.&lt;/P&gt;
&lt;P&gt;I used this way in AN5319 which is a serial bootloader for MPC5748G. I wrote simple converter for S3 records (it's included in the SW package). But there are tools which can be used for other formats like:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://srecord.sourceforge.net/man/man1/srec_cat.html" target="_blank"&gt;http://srecord.sourceforge.net/man/man1/srec_cat.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;As far as I know, there's no such configuration in S32DS, so we could add some note to AN12218. Thanks for pointing this out.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 09:19:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1276318#M7488</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2021-05-13T09:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the AN12218SW bootloader fails to parse the generated .srec file?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1277426#M7503</link>
      <description>&lt;P&gt;Hello Lukas,&lt;BR /&gt;&lt;BR /&gt;Thank you for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When rewriting/editing&amp;nbsp;&lt;SPAN&gt;AN12218, could you also put a note in about the changes in Java licenses? To be honest, the change makes the windows application quite useless.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 06:48:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1277426#M7503</guid>
      <dc:creator>roy_vanlierop</dc:creator>
      <dc:date>2021-05-17T06:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the AN12218SW bootloader fails to parse the generated .srec file?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1277538#M7505</link>
      <description>&lt;P&gt;As you're editing AN12218SW, could you also change this:&lt;/P&gt;&lt;P&gt;community.nxp.com/t5/S32-Design-Studio/Changing-BAUD-rate-in-AN12218SW-bootloader-non-zero-reset-values/m-p/1277536&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 10:07:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1277538#M7505</guid>
      <dc:creator>roy_vanlierop</dc:creator>
      <dc:date>2021-05-17T10:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the AN12218SW bootloader fails to parse the generated .srec file?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1292021#M7579</link>
      <description>&lt;P&gt;Hi Roy:&lt;/P&gt;&lt;P&gt;I've been fighting with this as well: I wanted to point out that even after running the FW through srec_cat or using the obj-copy --srec-len command we still ran into an issue where the last record could still be 4 or 12 byte aligned as the firmware wasn't evenly divisible by 8 bytes and the last write could fail. I ended up having to add padding functionality in the mem_man.c mem_man_write() function.&lt;/P&gt;&lt;P&gt;AFAIK this works right, but I'm experiencing some inconsistency issues that I'm still debugging.&lt;/P&gt;&lt;P&gt;I also added checks of the return value of the FlashProgram() and added in a call to FlashProgramCheck() to verify that the data actually got written correctly. NXP in their rush to get something to "work" and keep it "small" really skimped on the error handling and it has bitten us hard.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	/* Check alignment and pad if needed.
	 * S32 Flash Program takes 8 byte phrases. Misalligned bytes will result in a failed write.
	 */
	uint16_t sizeMod = data_size % 8;
	if(0 != sizeMod){
		/* set remaining bytes of array to 0xFF (default erased value)
		 * extend data_size to match new length.
		 */
		sizeMod = data_size + (8 - sizeMod); /* Generate new size */
		memset((void *) (BP-&amp;gt;F.PhraseData + data_size), 0xFF, MAX_DATA_BP - data_size);
		
		data_size = sizeMod;
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 14:58:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1292021#M7579</guid>
      <dc:creator>lucianomoretti</dc:creator>
      <dc:date>2021-06-14T14:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the AN12218SW bootloader fails to parse the generated .srec file?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1292049#M7581</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/46737"&gt;@lucianomoretti&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I can relate to the troubles you went through. The code quality of the bootloader example is much to be desired. That said: the foundation in the form of the flash_drivers is great and very useful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem you're describing can be easily fixed by using the srec_cat tool. The command line argument "-range-padding" can align your srecord to arbitrary boundaries. The resulting command that I used looked like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"${ProjDirPath}/Tools/srec_cat.exe" ${ProjName}.srec -fill 0x00 -within ${ProjName}.srec -range-padding 256 -address-length=4 -obs=32 -o aligned_${ProjName}.srec&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a look at my other ticket describing the Post-Build steps: &lt;A href="https://community.nxp.com/t5/S32-Design-Studio/Post-build-steps-triggering-too-early/m-p/1291242/highlight/true#M7575" target="_self"&gt;LINK&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Good luck, hopes this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 15:49:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1292049#M7581</guid>
      <dc:creator>roy_vanlierop</dc:creator>
      <dc:date>2021-06-14T15:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the AN12218SW bootloader fails to parse the generated .srec file?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1642941#M10074</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/70112"&gt;@roy_vanlierop&lt;/a&gt;&amp;nbsp;you can use this command to align srec file by 8 byte&amp;nbsp;&lt;BR /&gt;srec_cat hello_world_s32k144.srec -Output_Block_Size 8 -Output_Block_Packing -output news32k.srec&lt;/P&gt;&lt;P&gt;but the problem is we need to align this every time we build the project or for every project&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 08:10:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Why-does-the-AN12218SW-bootloader-fails-to-parse-the-generated/m-p/1642941#M10074</guid>
      <dc:creator>baseerahmadpiracha</dc:creator>
      <dc:date>2023-05-02T08:10:24Z</dc:date>
    </item>
  </channel>
</rss>

