There is an error in document i.MX RT1010 Processor Reference Manual, Rev. 0, 09/2019, p.1659:
This is FALSE: A software reset does not affect the CLKSRC bit.
Hi @youngSheldon ,
I also use the SDK demo to test this feature:
evkmimxrt1010_gpt_timer
The code is like this:
int main(void)
{
uint32_t gptFreq;
gpt_config_t gptConfig;
/* Board pin, clock, debug console init */
BOARD_ConfigMPU();
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitDebugConsole();
PRINTF("\r\n ===================GPT demo begin after reset!===================");
CLOCK_EnableClock(kCLOCK_Gpt2);
PRINTF("\r\n GPT CR = %x", (GPT2->CR & 0x1c0));
GPT_GetDefaultConfig(&gptConfig);
/* Initialize GPT module */
GPT_Init(EXAMPLE_GPT, &gptConfig);
/* Divide GPT clock source frequency by 3 inside GPT module */
GPT_SetClockDivider(EXAMPLE_GPT, 3);
/* Get GPT clock frequency */
gptFreq = EXAMPLE_GPT_CLK_FREQ;
/* GPT frequency is divided by 3 inside module */
gptFreq /= 3;
/* Set both GPT modules to 1 second duration */
GPT_SetOutputCompareValue(EXAMPLE_GPT, kGPT_OutputCompare_Channel1, gptFreq);
/* Enable GPT Output Compare1 interrupt */
GPT_EnableInterrupts(EXAMPLE_GPT, kGPT_OutputCompare1InterruptEnable);
/* Enable at the Interrupt */
EnableIRQ(GPT_IRQ_ID);
PRINTF("\r\nPress any key to start the example");
GETCHAR();
/* Start Timer */
PRINTF("\r\nStarting GPT timer ...");
GPT_StartTimer(EXAMPLE_GPT);
while (true)
{
/* Check whether occur interupt and toggle LED */
if (true == gptIsrFlag)
{
PRINTF("\r\n GPT interrupt is occurred !");
gptIsrFlag = false;
PRINTF("\r\n GPT CR[CLKSRC] value before software reset !");
PRINTF("\r\n GPT CR = %x", (GPT2->CR & 0x1c0));
NVIC_SystemReset();
}
else
{
// __WFI();
}
}
}
The printf log is:
So, really need to remove :
A software reset does not affect the CLKSRC bit.
I already report it internally, it will be fixed in the next RT1010RM version.
Thanks a lot for your contribution.
Best Regards,
Kerry
Hi @youngSheldon ,
Thanks for the RM issue pointing.
Do you mean, the software reset does affect the CLKSRC bit. Right?
And you also test it to confirm it?
Please let me know the details, then I will double check it on my side, if it is confirmed the issues, I will report it to our internal doc team, thanks.
I checked the RT1060 new RM, this area is really removed, I will also check it with out internal side at first.
Best Regads,
Kerry
Hi,
i can confirm that the software reset does reset the clock source on RT1060.
So in chapter 52.6 Initialization/ Application Information, it seems weird, after you selected the clock source the next step is to do a software reset.
Cheers!