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
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
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.
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.
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