Hardfault when debugging with CMSIS-DAP

cancel
Showing results for 
Search instead for 
Did you mean: 

Hardfault when debugging with CMSIS-DAP

Jump to solution
1,170 Views
burakgorduk1
Contributor I

Hi there,

I have been getting started with the LPC55S16-EVK recently. I have downloaded the SDK in order to try demo applications. I am having bit of an issue with the debugging though. The project is led_blinky inside demo_apps folder. And my IDE is IAR 8.50.1. 

The issue is that, when I download and debug the application using the onboard debugger, MCU cannot run to main and it is stuck on hardfault. I removed "run to main" tick in order to see where it fails.

pastedImage_1.png

It starts with the reset handler normally.

pastedImage_3.png

When I click on step into it directly goes to hardfault handler. 

I also noticed following 3 warnings during debugging;

Sat May 02, 2020 11:53:11: The downloaded program doesn't seem to match the expected memory layout of the target system:
Sat May 02, 2020 11:53:11: Some SFRs are placed outside known memory areas, or in memory areas designated as read-only or as RAM:
Sat May 02, 2020 11:53:11: FLASH_CFPA0_HEADER @ 0x0003E000, 32 bits
Sat May 02, 2020 11:53:11: FLASH_CFPA0_VERSION @ 0x0003E004, 32 bits
Sat May 02, 2020 11:53:11: FLASH_CFPA0_S_FW_Version @ 0x0003E008, 32 bits
Sat May 02, 2020 11:53:11: FLASH_CFPA0_NS_FW_Version @ 0x0003E00C, 32 bits
Sat May 02, 2020 11:53:11: FLASH_CFPA0_IMAGE_KEY_REVOKE @ 0x0003E010, 32 bits
Sat May 02, 2020 11:53:11: and more...
Sat May 02, 2020 11:53:11: Memory is specified as follows:
Sat May 02, 2020 11:53:11: 0x00000000 - 0x0003DDFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x0003DE00 - 0x000408BF ROM/Flash
Sat May 02, 2020 11:53:11: 0x03000000 - 0x0301FFFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x04000000 - 0x04003FFF RAM
Sat May 02, 2020 11:53:11: 0x10000000 - 0x1003DDFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x1003DE00 - 0x1003FFFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x13000000 - 0x1301FFFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x14000000 - 0x14003FFF RAM
Sat May 02, 2020 11:53:11: 0x20000000 - 0x20007FFF RAM
Sat May 02, 2020 11:53:11: 0x20008000 - 0x2000BFFF RAM
Sat May 02, 2020 11:53:11: 0x2000C000 - 0x2000FFFF RAM
Sat May 02, 2020 11:53:11: 0x20010000 - 0x20013FFF RAM
Sat May 02, 2020 11:53:11: 0x30000000 - 0x30007FFF RAM
Sat May 02, 2020 11:53:11: 0x30008000 - 0x3000BFFF RAM
Sat May 02, 2020 11:53:11: 0x3000C000 - 0x3000FFFF RAM
Sat May 02, 2020 11:53:11: 0x30010000 - 0x30013FFF RAM
Sat May 02, 2020 11:53:11: 0x40000000 - 0x40013FFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x40020000 - 0x4003DFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x40082000 - 0x4008EFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x40094000 - 0x4009FFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x400A0000 - 0x400ACFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x50000000 - 0x50013FFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x50020000 - 0x5003DFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x50082000 - 0x5008EFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x50094000 - 0x5009FFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x500A0000 - 0x500ACFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0xE0000000 - 0xE00FFFFF Uncached/SFR
Sat May 02, 2020 11:53:11: SFRs range from 0x0003DE00 to 0xE00FFFFF
Sat May 02, 2020 11:53:11: LowLevelReset(software, delay 200)
Sat May 02, 2020 11:53:11: Calling reset script: SoftwareReset
Sat May 02, 2020 11:53:11: LowLevelReset(system, delay 200)
Sat May 02, 2020 11:53:11: Calling reset script: SystemReset
Sat May 02, 2020 11:53:11: 5102 bytes verified (99.65 Kbytes/sec)
Sat May 02, 2020 11:53:11: Download completed and verification successful.
Sat May 02, 2020 11:53:11: LowLevelReset(software, delay 200)
Sat May 02, 2020 11:53:11: Calling reset script: SoftwareReset
Sat May 02, 2020 11:53:11: Target reset
Sat May 02, 2020 11:53:11: INFO: Configuring trace using 'SWO,ETB' setting ...
Sat May 02, 2020 11:53:11: Trace: ETMv4 not found, so trying ETMv3 for Cortex-M33 core ...INFO: SWO trace mode is not supported by the probe (use I-jet/I-jet-Trace probe) - trace is disabled.
Sat May 02, 2020 11:53:11: There were 3 warnings during the initialization of the debugging session.
Sat May 02, 2020 11:53:59: HardFault exception.
Sat May 02, 2020 11:53:59: The processor has escalated a configurable-priority exception to HardFault.
Sat May 02, 2020 11:53:59:
Sat May 02, 2020 11:53:59: Exception occured at PC = 0xffffffff, LR = 0x0
Sat May 02, 2020 11:53:59:
Sat May 02, 2020 11:53:59: See the call stack for more information.

Call stack is looking like below;

pastedImage_8.png

The only way I can run the application in debugging mode is to change the reset setting to "Hardware" and do a reset. But then debug screen jumps directly to infinite while loop inside the main. This prevents me from debugging anything before that. A software reset returns to reset handler and ends up with the hardfault.

I tried debugging with a J-Link and there were no such problems. I could step by step debug each instruction after reset.

Any help on solving the issue I am facing please?

Labels (1)
0 Kudos
1 Solution
1,035 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Burak ,

Refer to readme, these demo support  IAR v8.40.2, I also test on IAR v8.40.2,

it can work well.

pastedImage_1.png

I have the same issue with you when use IAR v8.50.1.

So please use IAR v8.40.2.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
7 Replies
1,034 Views
burakgorduk1
Contributor I

Any suggestions please?

0 Kudos
1,034 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Burak ,

Could you please test other demos? I haven't install this new version IAR v8.50.1.

I debug this demo on MCUXpresso IDE, it works well.  I will install the IAR v8.50.1 to test.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,034 Views
burakgorduk1
Contributor I

Hello Alice_Yang‌,

Thank you for the response. I have now tried several other demo applications, all of which gave the same warning and started with hardfault.

0 Kudos
1,036 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Burak ,

Refer to readme, these demo support  IAR v8.40.2, I also test on IAR v8.40.2,

it can work well.

pastedImage_1.png

I have the same issue with you when use IAR v8.50.1.

So please use IAR v8.40.2.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,034 Views
dash
Contributor II

Alice,

Is there any resolution to this issue? I am seeing the same with IAR 8.50.1, RT685 EVK (rev E board, B0 device), REL_2.7.0_RT600_RFP_RC2_4 SDK, and a ewarm850-nxp-imxrt5xx-6xx-patch2.zip from Chun in San Jose.

As you recommended, I installed IAR 8.40.1 and applied the patch and CMSIS works as expected, same SDK and hardware.

When will there be a fix (assuming in the SDK) to 8.50.1?

Thanks,


Dan

0 Kudos
1,034 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Dan,

Sorry, I don't know when the next SDK release.

BR

Alice

0 Kudos
1,034 Views
burakgorduk1
Contributor I

Hi Alice,

Thank you for the answer. I also programmed LPC-Link with J-Link firmware. This is also working for me at the moment.

Thank you.

0 Kudos