Crash while calling an SDK functinon

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

Crash while calling an SDK functinon

跳至解决方案
1,058 次查看
gauravbanyal
Contributor IV

Hello,

I am facing a crash which I don't understand.

The scenario is, the MCU is in VLLS3 state and in this state, the LPTMR instance zero (LPTMR0) is running with LPO as the clock source. The system wakes and goes to RUN state  due to a pin interrupt and in the main() function, there is a call to "LPTMR_GetCurrentTimerCount(LPTMR0)" LPTMR API from the SDK. At this point, the system crashes and re-boots.

I have also tried to read some other registers of the TIMER LPTMR0 and every time I try to read any register, the application re-boots.

Somebody please help me whats the reason for this. 

Thanks,
Gaurav.

标记 (1)
0 项奖励
回复
1 解答
878 次查看
mjbcswitzerland
Specialist V

Hi

Before you can read the LPTMR registers you need to enable clocks to it by using something like

POWER_UP(5, SIM_SCGC5_LPTIMER);

This is *(unsigned long *)0x40048038 |= 0x00000001; at its lowest level.

This is valid after each reset, even of the LPTMR otherwise may be operating.

Regards

Mark

在原帖中查看解决方案

0 项奖励
回复
1 回复
879 次查看
mjbcswitzerland
Specialist V

Hi

Before you can read the LPTMR registers you need to enable clocks to it by using something like

POWER_UP(5, SIM_SCGC5_LPTIMER);

This is *(unsigned long *)0x40048038 |= 0x00000001; at its lowest level.

This is valid after each reset, even of the LPTMR otherwise may be operating.

Regards

Mark

0 项奖励
回复