Hit HardFault when Debugging with Lauterbach on S32G

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hit HardFault when Debugging with Lauterbach on S32G

1,062 Views
chaoping
Contributor I

Hello, NXP support.

I setup a FLB image according to the guidelines in GoldenVIP folder.

Then I use IVT to generate the blob image and flash it into the RDB2 board.

When I debug with Lauterbach and click the reset button, the PC will reach the startup code expectedly.

But when I try to debug with "Step" or "Over" button, it will jump to "HardFault_Handler" directly.

chaoping_0-1757053768242.pngchaoping_1-1757053790464.png

Do you know why, it there anything I'm missing to config?

chaoping_2-1757053888930.png

Thank you, looking forward to your feedback.

 

 

 

0 Kudos
Reply
4 Replies

936 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @chaoping 

Thanks for your reply

Yes, the T bit should not be set to 0 for cortex-M cores, but I feel sorry that I did not reproduce your issue described on my end, by every "In target reset" triggering, the XPSR remains 0x010000xx, it may not be related with S32G directly.

 

BR

Chenyin 

 

0 Kudos
Reply

1,034 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @chaoping 

Thanks for your post, would you mind calibrating on the following:

1. Which version GoldVIP you used?

2. Which project/samples used in your test?

3. Have you ever tried other simpler samples on RDB2, if yes, any similar faults met?

 

BR
Chenyin

0 Kudos
Reply

1,026 Views
chaoping
Contributor I

Hi, NXP support.

GoldVIP version: GoldVIP-S32G2-1.14.0

I would like to test the FBL demo code into RDB2 board. (What I have changed is that, I build with GHS compiler, and use a personal build framework, so all the components were coming from the GoldVIP).

I could make sure the memory have been mapped correctly and loaded to SRAM correctly(by IVT QSPI flash).

I just don't understand why the exception was triggered after only one step of debugging?

0 Kudos
Reply

981 Views
chaoping
Contributor I

Hi, NXP support.

Looks like I have found the reason.

chaoping_0-1757259468702.png

When I perform the "In Target Reset" in the Lauterbach. I could see the XPSR value reset to 0.

chaoping_1-1757259542023.png

The "Thumb" bit with 0 will make the processor enter "Lockup".

So I tried modify the XPSR to 0x01000000, then debugging becomes normally.

Could you tell me why would this XPSR to be cleared as "0" after reset by Lauterbach?

Is it mandatory to be set once after Power on the Chip?

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2164115%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHit%20HardFault%20when%20Debugging%20with%20Lauterbach%20on%20S32G%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2164115%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%20NXP%20support.%3C%2FP%3E%3CP%3EI%20setup%20a%20FLB%20image%20according%20to%20the%20guidelines%20in%20GoldenVIP%20folder.%3C%2FP%3E%3CP%3EThen%20I%20use%20IVT%20to%20generate%20the%20blob%20image%20and%20flash%20it%20into%20the%20RDB2%20board.%3C%2FP%3E%3CP%3EWhen%20I%20debug%20with%20Lauterbach%20and%20click%20the%20reset%20button%2C%20the%20PC%20will%20reach%20the%20startup%20code%20expectedly.%3C%2FP%3E%3CP%3EBut%20when%20I%20try%20to%20debug%20with%20%22Step%22%20or%20%22Over%22%20button%2C%20it%20will%20jump%20to%20%22HardFault_Handler%22%20directly.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22chaoping_0-1757053768242.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chaoping_0-1757053768242.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F355676i77DFACCC6075BB5E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22chaoping_0-1757053768242.png%22%20alt%3D%22chaoping_0-1757053768242.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22chaoping_1-1757053790464.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chaoping_1-1757053790464.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F355677iD0E9B74530930609%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22chaoping_1-1757053790464.png%22%20alt%3D%22chaoping_1-1757053790464.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EDo%20you%20know%20why%2C%20it%20there%20anything%20I'm%20missing%20to%20config%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22chaoping_2-1757053888930.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chaoping_2-1757053888930.png%22%20style%3D%22width%3A%20379px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F355678i36B9B47EA15AD4FA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22chaoping_2-1757053888930.png%22%20alt%3D%22chaoping_2-1757053888930.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThank%20you%2C%20looking%20forward%20to%20your%20feedback.%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2164835%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Hit%20HardFault%20when%20Debugging%20with%20Lauterbach%20on%20S32G%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2164835%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F231410%22%20target%3D%22_blank%22%3E%40chaoping%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20reply%3C%2FP%3E%0A%3CP%3EYes%2C%20the%20T%20bit%20should%20not%20be%20set%20to%200%20for%20cortex-M%20cores%2C%20but%20I%20feel%20sorry%20that%20I%20did%20not%20reproduce%20your%20issue%20described%20on%20my%20end%2C%20by%20every%20%22In%20target%20reset%22%20triggering%2C%20the%20XPSR%20remains%200x010000xx%2C%20it%20may%20not%20be%20related%20with%20S32G%20directly.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EChenyin%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2164732%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Hit%20HardFault%20when%20Debugging%20with%20Lauterbach%20on%20S32G%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2164732%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%20NXP%20support.%3C%2FP%3E%3CP%3ELooks%20like%20I%20have%20found%20the%20reason.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22chaoping_0-1757259468702.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chaoping_0-1757259468702.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F355835iC08103221C23C442%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22chaoping_0-1757259468702.png%22%20alt%3D%22chaoping_0-1757259468702.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EWhen%20I%20perform%20the%20%22In%20Target%20Reset%22%20in%20the%20Lauterbach.%20I%20could%20see%20the%20XPSR%20value%20reset%20to%200.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22chaoping_1-1757259542023.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chaoping_1-1757259542023.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F355836iB9AA3555E02232CD%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22chaoping_1-1757259542023.png%22%20alt%3D%22chaoping_1-1757259542023.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20%22Thumb%22%20bit%20with%200%20will%20make%20the%20processor%20enter%20%22Lockup%22.%3C%2FP%3E%3CP%3ESo%20I%20tried%20modify%20the%20XPSR%20to%200x01000000%2C%20then%20debugging%20becomes%20normally.%3C%2FP%3E%3CP%3ECould%20you%20tell%20me%20why%20would%20this%20XPSR%20to%20be%20cleared%20as%20%220%22%20after%20reset%20by%20Lauterbach%3F%3C%2FP%3E%3CP%3EIs%20it%20mandatory%20to%20be%20set%20once%20after%20Power%20on%20the%20Chip%3F%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2164400%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Hit%20HardFault%20when%20Debugging%20with%20Lauterbach%20on%20S32G%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2164400%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%20NXP%20support.%3C%2FP%3E%3CP%3EGoldVIP%20version%3A%26nbsp%3BGoldVIP-S32G2-1.14.0%3C%2FP%3E%3CP%3EI%20would%20like%20to%20test%20the%20FBL%20demo%20code%20into%20RDB2%20board.%20(What%20I%20have%20changed%20is%20that%2C%20I%20build%20with%20GHS%20compiler%2C%20and%20use%20a%20personal%20build%20framework%2C%20so%20all%20the%20components%20were%20coming%20from%20the%20GoldVIP).%3C%2FP%3E%3CP%3EI%20could%20make%20sure%20the%20memory%20have%20been%20mapped%20correctly%20and%20loaded%20to%20SRAM%20correctly(by%20IVT%20QSPI%20flash).%3C%2FP%3E%3CP%3EI%20just%20don't%20understand%20why%20the%20exception%20was%20triggered%20after%20only%20one%20step%20of%20debugging%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2164358%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Hit%20HardFault%20when%20Debugging%20with%20Lauterbach%20on%20S32G%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2164358%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F231410%22%20target%3D%22_blank%22%3E%40chaoping%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20post%2C%20would%20you%20mind%20calibrating%20on%20the%20following%3A%3C%2FP%3E%0A%3CP%3E1.%20Which%20version%20GoldVIP%20you%20used%3F%3C%2FP%3E%0A%3CP%3E2.%20Which%20project%2Fsamples%20used%20in%20your%20test%3F%3C%2FP%3E%0A%3CP%3E3.%20Have%20you%20ever%20tried%20other%20simpler%20samples%20on%20RDB2%2C%20if%20yes%2C%20any%20similar%20faults%20met%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3CBR%20%2F%3EChenyin%3C%2FP%3E%3C%2FLINGO-BODY%3E