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