<?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 Debugging i.MX8 RTOS examples with IAR - hitting hard fault in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1393892#M185317</link>
    <description>&lt;P&gt;I've seen other posts mentioning what I think is probably this same issue, but have yet to find a resolution.&amp;nbsp; I'm using an i.MX8M Plus (Boundary Devices) platform and am trying to load and debug the FreeRTOS and multicore examples under IAR EWARM 9.20.2 with a J-Link Plus (and yes, I've installed the IAR patches).&amp;nbsp; What appears to happen is that if the M7 is already running FreeRTOS code, IAR loads and enters the debugger okay but ends up in the hard fault handler at line 260 of startup_MIMX8ML8_cm7.s (which just spins an an infinite loop) rather than at main().&amp;nbsp; If I then break in the hard fault handler and do a reset in the IAR debugger, I get to main() and can run the code.&amp;nbsp; But the next IAR debugger reset will land in the hard fault again, then at main(), etc.&amp;nbsp; I've tried several of the multicore/FreeRTOS examples and they all do this (freertos_hello, freertos_uart, rpmsg_lite_str_echo_rtos), but the plain (non-RTOS) hello_world example does not show this behavior - every IAR debugger reset lands at main().&amp;nbsp; Thus I'm concluding this bug is unique to the FreeRTOS implementation.&lt;/P&gt;&lt;P&gt;This is going to make testing and debugging my FreeRTOS Cortex-M7 application a pain if I have to stumble through the hard fault handler at every reset.&amp;nbsp; It would be wonderful if someone at NXP who knows the i.MX environment better than I do could help figure out what's wrong with the FreeRTOS examples.&lt;/P&gt;&lt;P&gt;Debug log from IAR EWARM:&lt;/P&gt;&lt;P&gt;Mon Jan 03, 2022 19:19:18: IAR Embedded Workbench 9.20.2 (C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\bin\armPROC.dll)&lt;BR /&gt;Mon Jan 03, 2022 19:19:18: Loaded macro file: C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\config\debugger\NXP\imx8mn.dmac&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: JLINK command: ProjectFile = P:\Brighton Technologies\1039 Surface Analyst IoT\Electrical\Software\Code_listings\i.MX8 FreeRTOS\freertos\boards\evkmimx8mp\rtos_examples\freertos_hello\iar\settings\freertos_hello_debug.jlink, return = 0&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Device "MIMX8ML8_M7" selected.&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: DLL version: V7.60a, compiled Dec 16 2021 10:39:12&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Firmware: J-Link V11 compiled Dec 9 2021 14:14:49&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: JTAG speed is initially set to: 32 kHz&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: InitTarget() start&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: J-Link script: iMX8M Nano Cortex-M7 J-Link script&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: ****** Reset Release with M7_RCR : 0x000000A8&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: InitTarget() end&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: TotalIRLen = 4, IRPrint = 0x01&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: JTAG chain detection found 1 devices:&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: #0 Id: 0x5BA00477, IRLen: 04, CoreSight JTAG-DP&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: DPv0 detected&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Scanning AP map to find all available APs&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[5]: Stopped AP scan as end of AP map has been reached&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[0]: AHB-AP (IDR: 0x64770001)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[1]: APB-AP (IDR: 0x44770002)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[2]: JTAG-AP (IDR: 0x24760010)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[3]: JTAG-AP (IDR: 0x001C0030)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[4]: AHB-AP (IDR: 0x64770001)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Iterating through AP map to find AHB-AP to use&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[0]: Skipped. No ROM table (AHB-AP ROM base: 0x00000000)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[1]: Skipped. Not an AHB-AP&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[2]: Skipped. Not an AHB-AP&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[3]: Skipped. Not an AHB-AP&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[4]: Core found&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[4]: AHB-AP ROM base: 0xE00FE000&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Found Cortex-M7 r1p2, Little endian.&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: FPUnit: 8 code (BP) slots and 0 literal slots&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: CoreSight components:&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: ROMTbl[0] @ E00FE000&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [0][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ROMTbl[1] @ E00FF000&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [1][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [1][1]: E0001000 CID B105E00D PID 000BB002 DWT&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [1][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [1][3]: E0000000 CID B105E00D PID 000BB001 ITM&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [0][1]: E0041000 CID B105900D PID 001BB975 ETM-M7&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [0][2]: E0042000 CID B105900D PID 004BB906 CTI&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [0][3]: E0043000 CID B105900D PID 001BB908 CSTF&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: Cache: Separate I- and D-cache.&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: SetupTarget() start&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: J-Link script: Prepare Landing Zone&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: J-Link script: Release Wait&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: SetupTarget() end&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ResetTarget() start&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: J-Link script: Reset Target&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ****** M7_RCR : 0x000000A8&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: J-Link script: Release Wait&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ResetTarget() end&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: Hardware reset with strategy 0 was performed&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: Initial reset was performed&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: Found 1 JTAG device, Total IRLen = 4:&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: #0 Id: 0x5BA00477, IRLen: 4, IRPrint: 0x1 CoreSight JTAG-DP&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: Loaded debugee: P:\Brighton Technologies\1039 Surface Analyst IoT\Electrical\Software\Code_listings\i.MX8 FreeRTOS\freertos\boards\evkmimx8mp\rtos_examples\freertos_hello\iar\debug\freertos_hello.out&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: 39992 bytes downloaded and verified (302.75 Kbytes/sec)&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: Download completed and verification successful.&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ResetTarget() start&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: J-Link script: Reset Target&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ****** M7_RCR : 0x000000A8&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: J-Link script: Release Wait&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ResetTarget() end&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: Software reset was performed&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: Target reset&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: HardFault exception.&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: The processor has escalated a configurable-priority exception to HardFault.&lt;BR /&gt;Mon Jan 03, 2022 19:19:41:&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: An instruction executed with an invalid EPSR.T or EPSR.IT field (CFSR.INVSTATE).&lt;BR /&gt;Mon Jan 03, 2022 19:19:41:&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: Exception occurred at PC = 0x12ee6, LR = 0x4649&lt;BR /&gt;Mon Jan 03, 2022 19:19:41:&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: See the call stack for more information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2022 00:40:43 GMT</pubDate>
    <dc:creator>Earthshine</dc:creator>
    <dc:date>2022-01-04T00:40:43Z</dc:date>
    <item>
      <title>Debugging i.MX8 RTOS examples with IAR - hitting hard fault</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1393892#M185317</link>
      <description>&lt;P&gt;I've seen other posts mentioning what I think is probably this same issue, but have yet to find a resolution.&amp;nbsp; I'm using an i.MX8M Plus (Boundary Devices) platform and am trying to load and debug the FreeRTOS and multicore examples under IAR EWARM 9.20.2 with a J-Link Plus (and yes, I've installed the IAR patches).&amp;nbsp; What appears to happen is that if the M7 is already running FreeRTOS code, IAR loads and enters the debugger okay but ends up in the hard fault handler at line 260 of startup_MIMX8ML8_cm7.s (which just spins an an infinite loop) rather than at main().&amp;nbsp; If I then break in the hard fault handler and do a reset in the IAR debugger, I get to main() and can run the code.&amp;nbsp; But the next IAR debugger reset will land in the hard fault again, then at main(), etc.&amp;nbsp; I've tried several of the multicore/FreeRTOS examples and they all do this (freertos_hello, freertos_uart, rpmsg_lite_str_echo_rtos), but the plain (non-RTOS) hello_world example does not show this behavior - every IAR debugger reset lands at main().&amp;nbsp; Thus I'm concluding this bug is unique to the FreeRTOS implementation.&lt;/P&gt;&lt;P&gt;This is going to make testing and debugging my FreeRTOS Cortex-M7 application a pain if I have to stumble through the hard fault handler at every reset.&amp;nbsp; It would be wonderful if someone at NXP who knows the i.MX environment better than I do could help figure out what's wrong with the FreeRTOS examples.&lt;/P&gt;&lt;P&gt;Debug log from IAR EWARM:&lt;/P&gt;&lt;P&gt;Mon Jan 03, 2022 19:19:18: IAR Embedded Workbench 9.20.2 (C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\bin\armPROC.dll)&lt;BR /&gt;Mon Jan 03, 2022 19:19:18: Loaded macro file: C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\config\debugger\NXP\imx8mn.dmac&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: JLINK command: ProjectFile = P:\Brighton Technologies\1039 Surface Analyst IoT\Electrical\Software\Code_listings\i.MX8 FreeRTOS\freertos\boards\evkmimx8mp\rtos_examples\freertos_hello\iar\settings\freertos_hello_debug.jlink, return = 0&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Device "MIMX8ML8_M7" selected.&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: DLL version: V7.60a, compiled Dec 16 2021 10:39:12&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Firmware: J-Link V11 compiled Dec 9 2021 14:14:49&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: JTAG speed is initially set to: 32 kHz&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: InitTarget() start&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: J-Link script: iMX8M Nano Cortex-M7 J-Link script&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: ****** Reset Release with M7_RCR : 0x000000A8&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: InitTarget() end&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: TotalIRLen = 4, IRPrint = 0x01&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: JTAG chain detection found 1 devices:&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: #0 Id: 0x5BA00477, IRLen: 04, CoreSight JTAG-DP&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: DPv0 detected&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Scanning AP map to find all available APs&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[5]: Stopped AP scan as end of AP map has been reached&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[0]: AHB-AP (IDR: 0x64770001)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[1]: APB-AP (IDR: 0x44770002)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[2]: JTAG-AP (IDR: 0x24760010)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[3]: JTAG-AP (IDR: 0x001C0030)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[4]: AHB-AP (IDR: 0x64770001)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Iterating through AP map to find AHB-AP to use&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[0]: Skipped. No ROM table (AHB-AP ROM base: 0x00000000)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[1]: Skipped. Not an AHB-AP&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[2]: Skipped. Not an AHB-AP&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[3]: Skipped. Not an AHB-AP&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[4]: Core found&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: AP[4]: AHB-AP ROM base: 0xE00FE000&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: Found Cortex-M7 r1p2, Little endian.&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: FPUnit: 8 code (BP) slots and 0 literal slots&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: CoreSight components:&lt;BR /&gt;Mon Jan 03, 2022 19:19:20: ROMTbl[0] @ E00FE000&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [0][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ROMTbl[1] @ E00FF000&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [1][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [1][1]: E0001000 CID B105E00D PID 000BB002 DWT&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [1][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [1][3]: E0000000 CID B105E00D PID 000BB001 ITM&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [0][1]: E0041000 CID B105900D PID 001BB975 ETM-M7&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [0][2]: E0042000 CID B105900D PID 004BB906 CTI&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: [0][3]: E0043000 CID B105900D PID 001BB908 CSTF&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: Cache: Separate I- and D-cache.&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: SetupTarget() start&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: J-Link script: Prepare Landing Zone&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: J-Link script: Release Wait&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: SetupTarget() end&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ResetTarget() start&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: J-Link script: Reset Target&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ****** M7_RCR : 0x000000A8&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: J-Link script: Release Wait&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: ResetTarget() end&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: Hardware reset with strategy 0 was performed&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: Initial reset was performed&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: Found 1 JTAG device, Total IRLen = 4:&lt;BR /&gt;Mon Jan 03, 2022 19:19:21: #0 Id: 0x5BA00477, IRLen: 4, IRPrint: 0x1 CoreSight JTAG-DP&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: Loaded debugee: P:\Brighton Technologies\1039 Surface Analyst IoT\Electrical\Software\Code_listings\i.MX8 FreeRTOS\freertos\boards\evkmimx8mp\rtos_examples\freertos_hello\iar\debug\freertos_hello.out&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: 39992 bytes downloaded and verified (302.75 Kbytes/sec)&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: Download completed and verification successful.&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ResetTarget() start&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: J-Link script: Reset Target&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ****** M7_RCR : 0x000000A8&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: J-Link script: Release Wait&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ***************************************************&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: ResetTarget() end&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: Software reset was performed&lt;BR /&gt;Mon Jan 03, 2022 19:19:23: Target reset&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: HardFault exception.&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: The processor has escalated a configurable-priority exception to HardFault.&lt;BR /&gt;Mon Jan 03, 2022 19:19:41:&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: An instruction executed with an invalid EPSR.T or EPSR.IT field (CFSR.INVSTATE).&lt;BR /&gt;Mon Jan 03, 2022 19:19:41:&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: Exception occurred at PC = 0x12ee6, LR = 0x4649&lt;BR /&gt;Mon Jan 03, 2022 19:19:41:&lt;BR /&gt;Mon Jan 03, 2022 19:19:41: See the call stack for more information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 00:40:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1393892#M185317</guid>
      <dc:creator>Earthshine</dc:creator>
      <dc:date>2022-01-04T00:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging i.MX8 RTOS examples with IAR - hitting hard fault</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1398898#M185766</link>
      <description>&lt;P&gt;Anyone?&amp;nbsp; Anyone?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 13:46:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1398898#M185766</guid>
      <dc:creator>Earthshine</dc:creator>
      <dc:date>2022-01-13T13:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging i.MX8 RTOS examples with IAR - hitting hard fault</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1399688#M185846</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm double checking with internal team since this issue looks similar to other reported for the i.MX8MN which has been already fixed.&lt;BR /&gt;&lt;BR /&gt;Issue fixed in J-Link Software and Documentation Pack V7.58c&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;[DLL]: NXP iMX8M: Under special circumstances, a debug session did not work as expected. Added a device specific reset. Fixed.&lt;BR /&gt;&lt;BR /&gt;I'll let you know as soon as I get more information.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Aldo.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 01:56:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1399688#M185846</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2022-01-15T01:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging i.MX8 RTOS examples with IAR - hitting hard fault</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1400524#M185916</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Please try with the attached JLinkScript for i.MX8MPlus this should have this issue fixed.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Aldo.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 00:54:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1400524#M185916</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2022-01-18T00:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging i.MX8 RTOS examples with IAR - hitting hard fault</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1401099#M185973</link>
      <description>&lt;P&gt;Well there's some progress with this J-Link script: On initial debugger load/entry, I'm ending up at the start of main() as I should rather than in the hard fault handler.&amp;nbsp; But... if I run the FreeRTOS code, pause or hit a breakpoint, and then hit the debugger "reset", it then lands in the hard fault handler again.&amp;nbsp; Resetting the debugger anytime BEFORE the FreeRTOS scheduler starts works fine, but once the scheduler is started a debugger reset lands in the hard fault.&amp;nbsp; I'd say whatever you did to fix the initial load, also needs to be done in the case of a debugger reset (this icon or "Debug"-&amp;gt;"Reset" from the menus):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Earthshine_0-1642529790586.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/168017iBE33057627852118/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Earthshine_0-1642529790586.png" alt="Earthshine_0-1642529790586.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 18:18:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1401099#M185973</guid>
      <dc:creator>Earthshine</dc:creator>
      <dc:date>2022-01-18T18:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging i.MX8 RTOS examples with IAR - hitting hard fault</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1404202#M186217</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Could you please test the attached startup file?&lt;/P&gt;
&lt;P&gt;This needs to be unzipped to &amp;lt;sdk_path&amp;gt;\devices\MIMX8ML8\iar\ folder&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Aldo.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 00:04:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1404202#M186217</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2022-01-25T00:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging i.MX8 RTOS examples with IAR - hitting hard fault</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1404613#M186264</link>
      <description>&lt;P&gt;Looks like this solves the problem, thanks!&amp;nbsp; Is the previous J-Link script file still necessary?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 14:51:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Debugging-i-MX8-RTOS-examples-with-IAR-hitting-hard-fault/m-p/1404613#M186264</guid>
      <dc:creator>Earthshine</dc:creator>
      <dc:date>2022-01-25T14:51:16Z</dc:date>
    </item>
  </channel>
</rss>

