Flash driver into HardFault_Handler

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

Flash driver into HardFault_Handler

Jump to solution
583 Views
ChowZJ
Contributor II

Hi ALL,

The MCUs I'm using are the S32K312, as well as the S32DS3.6 and RTD500.Then I have a very strange problem now. When I burn the program to 0x00460000, HardFault_Handler() appears in my writes to Flash, but when I burn the program to 0x00580000 it successfully writes to Flash.

ChowZJ_0-1753095749749.png

And of course I put the relevant functions into ram. And also used a function to disable interrupts before writing to flash.

#define DISABLE_GLOBAL_INT() __asm__ __volatile__(" cpsid i")
#define ENABLE_GLOBAL_INT() __asm__ __volatile__(" cpsie i")

ChowZJ_1-1753095832200.png

ChowZJ_2-1753095843614.png

ChowZJ_3-1753095853561.png

 

Tags (2)
0 Kudos
Reply
1 Solution
546 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @ChowZJ 

Please take a look at the recommendations in the thread: [RTD400HF01 LLD]K312 No HSE secure debug operation. Let me know if the issue persists afterward.

 

BR, VaneB

View solution in original post

0 Kudos
Reply
1 Reply
547 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @ChowZJ 

Please take a look at the recommendations in the thread: [RTD400HF01 LLD]K312 No HSE secure debug operation. Let me know if the issue persists afterward.

 

BR, VaneB

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2137388%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EFlash%20driver%20into%20HardFault_Handler%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2137388%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20ALL%2C%3C%2FP%3E%3CP%3EThe%20MCUs%20I'm%20using%20are%20the%20S32K312%2C%20as%20well%20as%20the%20S32DS3.6%20and%20RTD500.Then%20I%20have%20a%20very%20strange%20problem%20now.%20When%20I%20burn%20the%20program%20to%200x00460000%2C%20HardFault_Handler()%20appears%20in%20my%20writes%20to%20Flash%2C%20but%20when%20I%20burn%20the%20program%20to%200x00580000%20it%20successfully%20writes%20to%20Flash.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ChowZJ_0-1753095749749.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ChowZJ_0-1753095749749.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F348526iFC4EA586A4231939%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ChowZJ_0-1753095749749.png%22%20alt%3D%22ChowZJ_0-1753095749749.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAnd%20of%20course%20I%20put%20the%20relevant%20functions%20into%20ram.%20And%20also%20used%20a%20function%20to%20disable%20interrupts%20before%20writing%20to%20flash.%3C%2FP%3E%3CP%3E%23define%20DISABLE_GLOBAL_INT()%20__asm__%20__volatile__(%22%20cpsid%20i%22)%3CBR%20%2F%3E%23define%20ENABLE_GLOBAL_INT()%20__asm__%20__volatile__(%22%20cpsie%20i%22)%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ChowZJ_1-1753095832200.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ChowZJ_1-1753095832200.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F348531i71CA2F24CCDFBDF0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ChowZJ_1-1753095832200.png%22%20alt%3D%22ChowZJ_1-1753095832200.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ChowZJ_2-1753095843614.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ChowZJ_2-1753095843614.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F348532i3B66F56B1B7E83A5%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ChowZJ_2-1753095843614.png%22%20alt%3D%22ChowZJ_2-1753095843614.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ChowZJ_3-1753095853561.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ChowZJ_3-1753095853561.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F348533i069E0746D0EB6501%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ChowZJ_3-1753095853561.png%22%20alt%3D%22ChowZJ_3-1753095853561.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2138679%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Flash%20driver%20into%20HardFault_Handler%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2138679%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F251700%22%20target%3D%22_blank%22%3E%40ChowZJ%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20take%20a%20look%20at%20the%20recommendations%20in%20the%20thread%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FRTD400HF01-LLD-K312-No-HSE-secure-debug-operation%2Fta-p%2F2030149%22%20target%3D%22_blank%22%3E%5BRTD400HF01%20LLD%5DK312%20No%20HSE%20secure%20debug%20operation%3C%2FA%3E.%20Let%20me%20know%20if%20the%20issue%20persists%20afterward.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20VaneB%3C%2FP%3E%3C%2FLINGO-BODY%3E