I have a project on S32K312 (using EB tresos to configure and makefile to build and run). When I run program in debug mode, But sometime program got hard fault, so I need to flash another project build on CT before this project it works well. I realize that in debug mode when I press RESET button, program run from Reset_Handler to main, and in main function, it run over some steps then go to the HardFault_Handler (maybe until the line regard to pin, port, register of chip).
So what reason I encounter ? Can you help me to fix it. Or can I have a idea to trace this problem.
Thank you !