S32K311 can not work normally without debugger

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

S32K311 can not work normally without debugger

Jump to solution
1,181 Views
Sunj
Contributor II

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.

Sunj_0-1688608598375.png

   We look forward to any suggestion from anyone, thank you very much!  

 

Tags (1)
0 Kudos
Reply
1 Solution
1,062 Views
Sunj
Contributor II

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!

Sunj_0-1688969873966.png

Regards,

Sunj.

 

 

View solution in original post

3 Replies
523 Views
RogerFranca
Contributor II

It worked for me to also, divide the HSE_CLK by 2.

Core CLK = 120 MHz and HSE CLK = 60 MHz

0 Kudos
Reply
1,152 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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.

danielmartynek_0-1688910206658.png

 

Regards,

Daniel

 

 

 

0 Kudos
Reply
1,063 Views
Sunj
Contributor II

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!

Sunj_0-1688969873966.png

Regards,

Sunj.