The program runs normally with a debugger, but the program runs flying without a debugger

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

The program runs normally with a debugger, but the program runs flying without a debugger

Jump to solution
1,432 Views
SethWang
NXP Employee
NXP Employee

Hi,

Using S32K312, I found that when debugging on FLASH with a debugger, the program ran normally. Without a debugger, when running the ADC to initialize the operation on the MCR registers, the program runaway. After doing some debugging, I found that when operating the registers of PWM or SPI without a debugger, the program will also runaway, but with a debugger, the program runs normally.

The program are all running on FLASH, I don't know the difference between with and without a debuger? Do you know why the program runaway without a debugger?

Thank you

0 Kudos
Reply
1 Solution
1,408 Views
SethWang
NXP Employee
NXP Employee
Thank you.
The reasons is the configuration problem of PLL .The problem has solved.

View solution in original post

0 Kudos
Reply
5 Replies
1,424 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @SethWang,

What does it actually do? Do you see a fault exception or a system reset?

The debugger can typically disable the WDOG or initialize SRAM ECC.

Can you double-check the SRAM ECC?

 

Thanks,

BR, Daniel

0 Kudos
Reply
745 Views
anakha
Contributor III
how can I check them without debugger?
My app also runs OK with debugger but goes to hard fault handler but I am not sure.
I put below code to my app and my test rgb led goes to red(error).

void HardFault_Handler(void)
{
set_rgb_status(ERROR);
while(TRUE){};
}
0 Kudos
Reply
738 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @anakha,

What debugger do you have?

Multilink can be attached to the running MCU stuck in the exception handler.

danielmartynek_0-1713256703869.png

 

Make sure the clocks are configured precisely to one of the clock options.

RM, 24.7.2 System clocking configurations

 

Regards,

Daniel

 

0 Kudos
Reply
1,409 Views
SethWang
NXP Employee
NXP Employee
Thank you.
The reasons is the configuration problem of PLL .The problem has solved.
0 Kudos
Reply
819 Views
DouDou1
Contributor III

Can you tell me how you solved the problem?

0 Kudos
Reply