<?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>MCUXpresso IDEのトピックRe: CRC Insertion with Managed Linker Scripts?</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-debugger-when-using-an-SREC-file-with-Flash-CRC/m-p/1710353#M9140</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/221984"&gt;@med_engineer&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;as for the linker script: did you know that you can use Freemarker to extend/modify it? I'm using it for example to build bootloaders, see &lt;A href="https://mcuoneclipse.com/2019/10/06/linking-bootloader-applications-with-eclipse-and-freemarker-scripts/" target="_blank"&gt;https://mcuoneclipse.com/2019/10/06/linking-bootloader-applications-with-eclipse-and-freemarker-scripts/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And you don't 'loose the debug information':&lt;/P&gt;&lt;P&gt;a) create a binary file from the .axf with the CRC inserted using SRecord&lt;/P&gt;&lt;P&gt;b) flash the binary file&lt;/P&gt;&lt;P&gt;c) debug with the symbols of the .axf (which has all the debug information)&lt;/P&gt;&lt;P&gt;You can tell the debugger not to flash, but to use the .axf for debug information, for example see&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2020/11/03/debugging-bootloader-and-application-with-one-debug-session/" target="_blank"&gt;https://mcuoneclipse.com/2020/11/03/debugging-bootloader-and-application-with-one-debug-session/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2023 06:20:30 GMT</pubDate>
    <dc:creator>ErichStyger</dc:creator>
    <dc:date>2023-08-24T06:20:30Z</dc:date>
    <item>
      <title>MCUXpresso debugger when using an SREC file with Flash CRC inserted via srecord?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-debugger-when-using-an-SREC-file-with-Flash-CRC/m-p/1710136#M9139</link>
      <description>&lt;P&gt;I am working to add two 16-bit CRC values to our codebase at compile time in order to verify the integrity of the program text/data stored in flash memory and the text/data stored in QSPI.&amp;nbsp; I have managed to implement this functionality using srecord and the solution suggested in &lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/CRC-Checksum-Generation-with-MCUXpresso-IDE/ta-p/1180671" target="_self"&gt;this NXP Community post&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that this procedure does not integrate tightly with our standard build-compile-debug process in MCUXpresso.&amp;nbsp; &amp;nbsp;I have been able to integrate the process with MCUXpresso by adding the Post-build steps shown below.&amp;nbsp; The three steps are to 1) copy the .axf file to a .srec file, 2) perform the CRC calculation and insertion at the proper addresses, and 3) Copy the .srec file back to a .axf file.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;arm-none-eabi-objcopy -v -O srec "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.srec"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;../program_crc/srecord-1.65.0-win64/bin/srec_cat.exe @../program_crc/srec_command.txt&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;arm-none-eabi-objcopy -v -I srec -O elf32-littlearm "${BuildArtifactFileBaseName}.crc.srec" "${BuildArtifactFileName}"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This works well in the sense that the build process is now entirely integrated with MCUXpresso.&amp;nbsp; However, the conversion from AXF to SREC and back again removes all of the debug information so that debugging is no longer possible.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone been able to calculate and insert a CRC at compile time without losing all of the debug information stored in the AXF file?&amp;nbsp; There is a suggestion &lt;A href="https://stackoverflow.com/questions/24150030/storing-crc-into-an-axf-elf-file" target="_self"&gt;here&lt;/A&gt; which modifies the linker script.&amp;nbsp; However, MCUXpresso now uses managed linker scripts which I would like to maintain.&amp;nbsp; Is it possible to do this with templates?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any suggestions!&lt;/P&gt;&lt;P&gt;FYI: we are using MCUXpresso v11.7.0 and developing for an MK82FN256 microcontroller.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 17:46:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-debugger-when-using-an-SREC-file-with-Flash-CRC/m-p/1710136#M9139</guid>
      <dc:creator>med_engineer</dc:creator>
      <dc:date>2023-08-24T17:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: CRC Insertion with Managed Linker Scripts?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-debugger-when-using-an-SREC-file-with-Flash-CRC/m-p/1710353#M9140</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/221984"&gt;@med_engineer&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;as for the linker script: did you know that you can use Freemarker to extend/modify it? I'm using it for example to build bootloaders, see &lt;A href="https://mcuoneclipse.com/2019/10/06/linking-bootloader-applications-with-eclipse-and-freemarker-scripts/" target="_blank"&gt;https://mcuoneclipse.com/2019/10/06/linking-bootloader-applications-with-eclipse-and-freemarker-scripts/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And you don't 'loose the debug information':&lt;/P&gt;&lt;P&gt;a) create a binary file from the .axf with the CRC inserted using SRecord&lt;/P&gt;&lt;P&gt;b) flash the binary file&lt;/P&gt;&lt;P&gt;c) debug with the symbols of the .axf (which has all the debug information)&lt;/P&gt;&lt;P&gt;You can tell the debugger not to flash, but to use the .axf for debug information, for example see&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2020/11/03/debugging-bootloader-and-application-with-one-debug-session/" target="_blank"&gt;https://mcuoneclipse.com/2020/11/03/debugging-bootloader-and-application-with-one-debug-session/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 06:20:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-debugger-when-using-an-SREC-file-with-Flash-CRC/m-p/1710353#M9140</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2023-08-24T06:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: CRC Insertion with Managed Linker Scripts?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-debugger-when-using-an-SREC-file-with-Flash-CRC/m-p/1710910#M9142</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/17173"&gt;@ErichStyger&lt;/a&gt;&amp;nbsp;Thank you for the suggestion!&amp;nbsp; Your second suggestion to pull the symbols from the AXF file and the application code from the SREC file solved my issue.&amp;nbsp; Debugging is now completely seamless and works as one would expect.&lt;/P&gt;&lt;P&gt;Just to be clear for anyone else who sees this topic in the future; The steps below are what I had to do in MCUXpresso in order to implement this solution.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Under the “Run” menu select “Debug configurations”&lt;/LI&gt;&lt;LI&gt;Ensure that you have the correct debug configuration selected in the left-hand pane ("Sargasso_EFDemo JLink Debug” in the screenshots below).&lt;/LI&gt;&lt;LI&gt;Under the “Main” tab, edit the “C/C++ Application” to use the SREC file using the “Browse” button (see screenshot below).&lt;/LI&gt;&lt;LI&gt;Under the “Other Symbols” tab, edit the “Load symbols” file to point toward the AXF file using the “File System” button (see screenshot below).&lt;/LI&gt;&lt;LI&gt;Click “Apply” to apply the new settings.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="med_engineer_0-1692898969559.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/237940iD81C095B15944C11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="med_engineer_0-1692898969559.png" alt="med_engineer_0-1692898969559.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="med_engineer_1-1692898969637.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/237941i205640A75A0E8FB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="med_engineer_1-1692898969637.png" alt="med_engineer_1-1692898969637.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 17:44:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-debugger-when-using-an-SREC-file-with-Flash-CRC/m-p/1710910#M9142</guid>
      <dc:creator>med_engineer</dc:creator>
      <dc:date>2023-08-24T17:44:36Z</dc:date>
    </item>
  </channel>
</rss>

