RTC peripheral enables subsecond timer in wrong order on MIMXRT685S

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

RTC peripheral enables subsecond timer in wrong order on MIMXRT685S

740 次查看
Kenzimatic
Contributor II

When using the new RTC peripheral, I see that there is an option to enable the subsecond timer.

This is the code it generates:

 

/* Enable sub-second counter */
RTC_EnableSubsecCounter(HRC_RTC_PERIPHERAL, true);
/* Start RTC timer */
RTC_StartTimer(HRC_RTC_PERIPHERAL);

 

However, the subsecond timer will not start unless the RTC has been started, making the first call ineffective. The order should be reversed.

As a temporary fix, I have edited my code generator at: \ProgramData\NXP\mcu_data_v15\components\ksdk2_0\lpc_rtc_5b94d23b38d98ad150d835147973adbf\lpc_rtc.component

 

0 项奖励
回复
3 回复数

720 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will be supporting your case, sorry I could not understand if you are reporting an issue, if yes could you elaborate further on how to replay?  if this is not the case, could you explain more?

Best regards,
Pavel

0 项奖励
回复

708 次查看
Kenzimatic
Contributor II

I have a workaround, but the bug exists in the IDE.

On an MIMXRT685S project, create the RTC peripheral and turn on the subsecond counter.

Kenzimatic_0-1707142950875.png

Call the peripheral init function. If you execute the code, you'd find that the RTC CTRL register's SUBSEC_ENA bit does not get set to 1 when RTC_EnableSubsecCounter is called.

This is because peripherals.c is generated incorrectly. It calls RTC_EnableSubsecCounter before RTC_StartTimer, which is the wrong order.

 

 

0 项奖励
回复

695 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, sorry for the late response I did the test and have the same result, so let me open an internal report.

Best regards,
Pavel

 

0 项奖励
回复