Dear engineer:
Firstly, the introduction of the application environment as follow:
1. we use the IDE of S32 design studio for s32 v3.5;
2. we use the RTD (version: S32K3XX AUTOSAR 4.4 - R21-11 RTD 3.0.0 D2303 Example Projects);
3. we create the project through using the choice of S32DS Application Project;
4. we use the GDB PEMicro Interface Debugging to load and debug program (Debug_Flash_PNE mode).
5. we use the self-designed hardware rather than official EVB.
Then, the problem we faced is:
We can use the debugger to load and start the program, and the mcu can work well at the mode of debug. However, when we disconnect the mcu with the debugger, and just power on the mcu, the mcu can not work normally. It just run about several seconds then stop. We do not know how to solve this problem. We try to refer some resolution like adding the define of START_FROM_FLASH in preprossors (as following figure), but it does not work.
We look forward to any suggestion from anyone, thank you very much!
已解决! 转到解答。
Dear Daniel:
Thank you for this valuable advice, we have solved this problem. The main reason which causes this problem should be the incorrect clock configuration. As fore-mentioned introduction, we refer to the demo project of S32K344 to configure the mcu s32k311. In our hardware, we use the 8M external XTAL. Hence,we just adjsut the clock configuration to satisfy the 120MHz core_clk which neglect other clock configuration such as HSE_CLK(which should be half of the core_clk). Therefore, the unsuitable clock casue the mcu abnormal reset (following wave shows the signal of reset_b, several low-level signals lead to the reset of mcu, finally the mcu stops due to the exception).
Therefore, we reconfigure the each clock source, and the problem is disappeared. We wish the experience can be helpful for others. Thank you again!
Regards,
Sunj.
Hi @Sunj,
After the several seconds, is the MCU reset? Can you monitor the reset_b pin with an oscilloscope?
And if so, what is the source if the reset?
Please read the MC_RGM[FES, DES] registers.
You can use the Power_Ip_GetResetReason() for this.
If the MCU is not reset, you should be able to attach the debugger back, halt the execution and find out where the MCU is stuck.
Regards,
Daniel
Dear Daniel:
Thank you for this valuable advice, we have solved this problem. The main reason which causes this problem should be the incorrect clock configuration. As fore-mentioned introduction, we refer to the demo project of S32K344 to configure the mcu s32k311. In our hardware, we use the 8M external XTAL. Hence,we just adjsut the clock configuration to satisfy the 120MHz core_clk which neglect other clock configuration such as HSE_CLK(which should be half of the core_clk). Therefore, the unsuitable clock casue the mcu abnormal reset (following wave shows the signal of reset_b, several low-level signals lead to the reset of mcu, finally the mcu stops due to the exception).
Therefore, we reconfigure the each clock source, and the problem is disappeared. We wish the experience can be helpful for others. Thank you again!
Regards,
Sunj.