S32G3 M7 Encounters Hardfault Exception When Calling a Large External Library

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

S32G3 M7 Encounters Hardfault Exception When Calling a Large External Library

Jump to solution
1,251 Views
XD
Contributor II

Hi,

I am using the M7 Linflexd_Uart_IP_Example project to test the M core's performance on the S32G3 goldbox. When running a benchmark function from an external library, the function attempts to allocate a large array, which triggers a hardfault exception. The hardfault handler indicates this by turning on an LED.

I need help with:

1. Understanding the memory restrictions for the M7 Linflexd_Uart_IP_Example project.
2. Recommendations for increasing the memory allocation to prevent the hardfault exception.
3. Best practices for handling large memory allocations on the S32G3 M7.

Thank you for your assistance,

XD

0 Kudos
Reply
1 Solution
1,214 Views
chenyin_h
NXP Employee
NXP Employee

Hi, @XD 

Thanks for the post and sorry for the delay.

Regarding the memory information for the specific examples, you may refer to the ld file under project settings.

Since you were allocating large memories for your specific array, not sure of your allocation method, but it is possible that specific sections(stack/data/etc.) may be overlapped. You may have to compute the actually size and re-arrange the memory settings via the ld file.

 

Best Regards

Chenyin

View solution in original post

0 Kudos
Reply
1 Reply
1,215 Views
chenyin_h
NXP Employee
NXP Employee

Hi, @XD 

Thanks for the post and sorry for the delay.

Regarding the memory information for the specific examples, you may refer to the ld file under project settings.

Since you were allocating large memories for your specific array, not sure of your allocation method, but it is possible that specific sections(stack/data/etc.) may be overlapped. You may have to compute the actually size and re-arrange the memory settings via the ld file.

 

Best Regards

Chenyin

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1905608%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32G3%20M7%20Encounters%20Hardfault%20Exception%20When%20Calling%20a%20Large%20External%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1905608%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20using%20the%20M7%20Linflexd_Uart_IP_Example%20project%20to%20test%20the%20M%20core's%20performance%20on%20the%20S32G3%20goldbox.%20When%20running%20a%20benchmark%20function%20from%20an%20external%20library%2C%20the%20function%20attempts%20to%20allocate%20a%20large%20array%2C%20which%20triggers%20a%20hardfault%20exception.%20The%20hardfault%20handler%20indicates%20this%20by%20turning%20on%20an%20LED.%3C%2FP%3E%3CP%3EI%20need%20help%20with%3A%3C%2FP%3E%3CP%3E1.%20Understanding%20the%20memory%20restrictions%20for%20the%20M7%20Linflexd_Uart_IP_Example%20project.%3CBR%20%2F%3E2.%20Recommendations%20for%20increasing%20the%20memory%20allocation%20to%20prevent%20the%20hardfault%20exception.%3CBR%20%2F%3E3.%20Best%20practices%20for%20handling%20large%20memory%20allocations%20on%20the%20S32G3%20M7.%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20assistance%2C%3C%2FP%3E%3CP%3EXD%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1908312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32G3%20M7%20Encounters%20Hardfault%20Exception%20When%20Calling%20a%20Large%20External%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1908312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F235130%22%20target%3D%22_blank%22%3E%40XD%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20the%20post%20and%20sorry%20for%20the%20delay.%3C%2FP%3E%0A%3CP%3ERegarding%20the%20memory%20information%20for%20the%20specific%20examples%2C%20you%20may%20refer%20to%20the%20ld%20file%20under%20project%20settings.%3C%2FP%3E%0A%3CP%3ESince%20you%20were%20allocating%20large%20memories%20for%20your%20specific%20array%2C%20not%20sure%20of%20your%20allocation%20method%2C%20but%20it%20is%20possible%20that%20specific%20sections(stack%2Fdata%2Fetc.)%20may%20be%20overlapped.%20You%20may%20have%20to%20compute%20the%20actually%20size%20and%20re-arrange%20the%20memory%20settings%20via%20the%20ld%20file.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20Regards%3C%2FP%3E%0A%3CP%3EChenyin%3C%2FP%3E%3C%2FLINGO-BODY%3E