<?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>S32K中的主题 S32K311 bootloader porting</title>
    <link>https://community.nxp.com/t5/S32K/S32K311-bootloader-porting/m-p/2414573#M61103</link>
    <description>&lt;P&gt;I am currently porting a working Bootloader project from the&amp;nbsp;S32K312&amp;nbsp;to the&amp;nbsp;S32K311. I am using&amp;nbsp;S32 Design Studio&amp;nbsp;along with&amp;nbsp;NXP RTD 4.9.0&amp;nbsp;and the GCC compiler. I am encountering two severe issues related to the Vector Table and Reset Handler that seem specific to the S32K311 / RTD 4.9 environment.&lt;/P&gt;&lt;P&gt;Issue 1: Immediate UsageFault on Debugger Reset&amp;nbsp;When launching the PEMicro debugger, the core crashes immediately during the reset script before ever reaching main().&lt;/P&gt;&lt;P&gt;Reset script (...) completed.&lt;BR /&gt;UsageFault: An instruction executed with an invalid EPSR.T or EPSR.IT field.&lt;BR /&gt;HardFault: A fault has been escalated to a hard fault.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;We checked&amp;nbsp;startup_cm7.s&amp;nbsp;and&amp;nbsp;Vector_Table.s. We noticed that&amp;nbsp;Reset_Handler&amp;nbsp;was missing the&amp;nbsp;.type Reset_Handler, %function&amp;nbsp;directive, causing the ELF entry point to be an even address (e.g.,&amp;nbsp;0x00402420&amp;nbsp;instead of&amp;nbsp;0x00402421), which naturally causes an ARM-mode UsageFault on the Cortex-M7.&lt;/P&gt;&lt;P&gt;Even after fixing the&amp;nbsp;.type&amp;nbsp;directive and ensuring the Vector Table has the LSB set for Thumb mode, the PEMicro debugger still occasionally throws this&amp;nbsp;UsageFault&amp;nbsp;immediately upon reset.&lt;/P&gt;&lt;P&gt;Issue 2: Interrupts jump to 0x0 (Uninitialized RAM Vector Table)&amp;nbsp;When we successfully bypass the reset issue and reach&amp;nbsp;main(), the system crashes the moment a hardware interrupt (like FlexCAN or SWT) triggers. The PC jumps to&amp;nbsp;0x00000000.&lt;/P&gt;&lt;P&gt;Upon investigating memory, we found that the RAM vector table at&amp;nbsp;__interrupts_ram_start&amp;nbsp;(0x20000000) is completely uninitialized (filled with zeroes). We discovered that:&lt;/P&gt;&lt;P&gt;startup_cm7.s&amp;nbsp;sets&amp;nbsp;VTOR&amp;nbsp;to&amp;nbsp;__RAM_INTERRUPT_START&amp;nbsp;at the end of initialization but&amp;nbsp;never copies&amp;nbsp;the table from ROM.&lt;BR /&gt;IntCtrl_Ip_Init(&amp;amp;IntCtrlConfig_0)&amp;nbsp;(generated by the Platform component) sets&amp;nbsp;VTOR&amp;nbsp;if&amp;nbsp;INT_CTRL_IP_ENABLE_VTOR_CONFIG&amp;nbsp;is enabled, but it&amp;nbsp;also does not copy&amp;nbsp;the default vector table from flash to RAM.&lt;BR /&gt;To work around this, we had to write a manual&amp;nbsp;for-loop in&amp;nbsp;main.c&amp;nbsp;to physically copy the vector table from&amp;nbsp;__interrupts_init_start&amp;nbsp;to&amp;nbsp;__interrupts_ram_start&amp;nbsp;and update&amp;nbsp;S32_SCB-&amp;gt;VTOR&amp;nbsp;before calling&amp;nbsp;IntCtrl_Ip_InstallHandler().&lt;/P&gt;&lt;P&gt;got the base code from&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/Unified-bootloader-Demo/ta-p/1423099" target="_blank"&gt;Unified bootloader Demo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;does anyone know a post where the bootloader for S32K311 with CAN was ported and posted??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Sep 2026 10:18:14 GMT</pubDate>
    <dc:creator>ujwal12</dc:creator>
    <dc:date>2026-09-18T10:18:14Z</dc:date>
    <item>
      <title>S32K311 bootloader porting</title>
      <link>https://community.nxp.com/t5/S32K/S32K311-bootloader-porting/m-p/2414573#M61103</link>
      <description>&lt;P&gt;I am currently porting a working Bootloader project from the&amp;nbsp;S32K312&amp;nbsp;to the&amp;nbsp;S32K311. I am using&amp;nbsp;S32 Design Studio&amp;nbsp;along with&amp;nbsp;NXP RTD 4.9.0&amp;nbsp;and the GCC compiler. I am encountering two severe issues related to the Vector Table and Reset Handler that seem specific to the S32K311 / RTD 4.9 environment.&lt;/P&gt;&lt;P&gt;Issue 1: Immediate UsageFault on Debugger Reset&amp;nbsp;When launching the PEMicro debugger, the core crashes immediately during the reset script before ever reaching main().&lt;/P&gt;&lt;P&gt;Reset script (...) completed.&lt;BR /&gt;UsageFault: An instruction executed with an invalid EPSR.T or EPSR.IT field.&lt;BR /&gt;HardFault: A fault has been escalated to a hard fault.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;We checked&amp;nbsp;startup_cm7.s&amp;nbsp;and&amp;nbsp;Vector_Table.s. We noticed that&amp;nbsp;Reset_Handler&amp;nbsp;was missing the&amp;nbsp;.type Reset_Handler, %function&amp;nbsp;directive, causing the ELF entry point to be an even address (e.g.,&amp;nbsp;0x00402420&amp;nbsp;instead of&amp;nbsp;0x00402421), which naturally causes an ARM-mode UsageFault on the Cortex-M7.&lt;/P&gt;&lt;P&gt;Even after fixing the&amp;nbsp;.type&amp;nbsp;directive and ensuring the Vector Table has the LSB set for Thumb mode, the PEMicro debugger still occasionally throws this&amp;nbsp;UsageFault&amp;nbsp;immediately upon reset.&lt;/P&gt;&lt;P&gt;Issue 2: Interrupts jump to 0x0 (Uninitialized RAM Vector Table)&amp;nbsp;When we successfully bypass the reset issue and reach&amp;nbsp;main(), the system crashes the moment a hardware interrupt (like FlexCAN or SWT) triggers. The PC jumps to&amp;nbsp;0x00000000.&lt;/P&gt;&lt;P&gt;Upon investigating memory, we found that the RAM vector table at&amp;nbsp;__interrupts_ram_start&amp;nbsp;(0x20000000) is completely uninitialized (filled with zeroes). We discovered that:&lt;/P&gt;&lt;P&gt;startup_cm7.s&amp;nbsp;sets&amp;nbsp;VTOR&amp;nbsp;to&amp;nbsp;__RAM_INTERRUPT_START&amp;nbsp;at the end of initialization but&amp;nbsp;never copies&amp;nbsp;the table from ROM.&lt;BR /&gt;IntCtrl_Ip_Init(&amp;amp;IntCtrlConfig_0)&amp;nbsp;(generated by the Platform component) sets&amp;nbsp;VTOR&amp;nbsp;if&amp;nbsp;INT_CTRL_IP_ENABLE_VTOR_CONFIG&amp;nbsp;is enabled, but it&amp;nbsp;also does not copy&amp;nbsp;the default vector table from flash to RAM.&lt;BR /&gt;To work around this, we had to write a manual&amp;nbsp;for-loop in&amp;nbsp;main.c&amp;nbsp;to physically copy the vector table from&amp;nbsp;__interrupts_init_start&amp;nbsp;to&amp;nbsp;__interrupts_ram_start&amp;nbsp;and update&amp;nbsp;S32_SCB-&amp;gt;VTOR&amp;nbsp;before calling&amp;nbsp;IntCtrl_Ip_InstallHandler().&lt;/P&gt;&lt;P&gt;got the base code from&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/Unified-bootloader-Demo/ta-p/1423099" target="_blank"&gt;Unified bootloader Demo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;does anyone know a post where the bootloader for S32K311 with CAN was ported and posted??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2026 10:18:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K311-bootloader-porting/m-p/2414573#M61103</guid>
      <dc:creator>ujwal12</dc:creator>
      <dc:date>2026-09-18T10:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: S32K311 bootloader porting</title>
      <link>https://community.nxp.com/t5/S32K/S32K311-bootloader-porting/m-p/2414656#M61106</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/266272"&gt;@ujwal12&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the Cortex-M7, the Reset Handler entry in the vector table must indicate Thumb mode by using an address with the LSB set. If the Reset_Handler symbol is not generated correctly as a function symbol, the linker may place an even address in the vector table, which can lead to a UsageFault during startup. For this reason, we generally do not recommend modifying startup_cm7.s or Vector_Table.s.&lt;/P&gt;
&lt;P&gt;By design, the S32K3 RTD uses a RAM-based relocatable interrupt vector table. During startup, the vector table is copied from Flash to RAM, and VTOR is updated to point to the RAM-based table.&lt;/P&gt;
&lt;P&gt;Regarding the availability of an S32K311 bootloader example, there is currently no official bootloader example specifically targeting the S32K311. The closest references available are the &lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K312-Bootloader-to-Application-Jump-DS3-5-RTD300/ta-p/1809810" target="_blank" rel="noopener"&gt;Example S32K312 Bootloader to Application Jump DS3.5 RTD300&lt;/A&gt; and the Unified Bootloader Demo that you are already using.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, please note that t&lt;SPAN&gt;he Unified Bootloader is an unofficial NXP demo that has only been published on the community forum, and therefore it is not supported by NXP technical support.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, VaneB&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2026 17:41:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K311-bootloader-porting/m-p/2414656#M61106</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2026-09-18T17:41:26Z</dc:date>
    </item>
  </channel>
</rss>

