Hello, i am having a weird behaviour at a NRF52832 device.
To explain. Basically I am using an external RTC chip to source the clock of the LFCLK.
During the initialization I call:
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos)|(CLOCK_LFCLKSRC_BYPASS_Enabled << CLOCK_LFCLKSRC_BYPASS_Pos ) | (CLOCK_LFCLKSRC_EXTERNAL_Enabled << CLOCK_LFCLKSRC_EXTERNAL_Pos); NRF_CLOCK->EVENTS_LFCLKSTARTED = 0; NRF_CLOCK->TASKS_LFCLKSTART = 1; while(NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {//do nothing }
However, during an investigation of a problem explained here I realized that after a Reset from byt J-LInk during a debug session the LFCLKSTAT start already with SRC as Xtal and State as Running. If I call NRF_CLOCK->TASKS_LFCLKSTOP = 1 it will stay as running and wont stop. Also If I try to change the source of the LFCLK to RC it wont change as the LFCLKSTAT State is running.
I could not find any ERRATA explaining about this.
Is there any solution? Am I doing anything wrong?