RTC peripheral enables subsecond timer in wrong order on MIMXRT685S

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

RTC peripheral enables subsecond timer in wrong order on MIMXRT685S

414件の閲覧回数
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 返答(返信)

394件の閲覧回数
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 件の賞賛
返信

382件の閲覧回数
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 件の賞賛
返信

369件の閲覧回数
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 件の賞賛
返信