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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,035 次查看
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 项奖励
1 解答
1,011 次查看
SethWang
NXP Employee
NXP Employee
Thank you.
The reasons is the configuration problem of PLL .The problem has solved.

在原帖中查看解决方案

0 项奖励
5 回复数
1,027 次查看
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 项奖励
348 次查看
erinc
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 项奖励
341 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @erinc,

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 项奖励
1,012 次查看
SethWang
NXP Employee
NXP Employee
Thank you.
The reasons is the configuration problem of PLL .The problem has solved.
0 项奖励
422 次查看
DouDou1
Contributor II

Can you tell me how you solved the problem?

0 项奖励