nRF5340 with RV3028C7 external clock EVENTS_LFCLKSTARTED not triggering

Our design has an nRF5340 with RV3028C7 to provide the 32 kHz clock via P0.00.

If I configure P0.00 as a digital input, I can see the pin toggling.

However, if I use the code below to try and switch from to the external clock, the EVENTS_LFCLKSTARTED doesn't happen.  Any idea why this would be?

NRF_CLOCK->LFCLKSRC = CLOCK_LFCLKSRC_SRC_LFXO << CLOCK_LFCLKSRC_SRC_Pos;
NRF_OSCILLATORS->XOSC32KI.INTCAP = OSCILLATORS_XOSC32KI_INTCAP_INTCAP_External << OSCILLATORS_XOSC32KI_INTCAP_INTCAP_Pos;
NRF_OSCILLATORS->XOSC32KI.BYPASS = OSCILLATORS_XOSC32KI_BYPASS_BYPASS_Enabled << OSCILLATORS_XOSC32KI_BYPASS_BYPASS_Pos;
NRF_P0->PIN_CNF[0] = GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos |
GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos |
GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos |
GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos;
NRF_P0->PIN_CNF[1] = GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos |
GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos |
GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos |
GPIO_PIN_CNF_INPUT_Disconnect<< GPIO_PIN_CNF_INPUT_Pos;
NRF_CLOCK->LFCLKALWAYSRUN = CLOCK_LFCLKALWAYSRUN_ALWAYSRUN_AlwaysRun << CLOCK_LFCLKALWAYSRUN_ALWAYSRUN_Pos;
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK->TASKS_LFCLKSTART = 1;
uint32_t count = 0;
while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {
// wait for LFCLK to start
++count;
}
  • In our application, if the application has:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_20PPM=y
     
    and the network has:
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
     
    BLE will work for a few connections, but after about one hour it stops advertising.
    How long did you run your test?
  • I setup peripheral_lbs with sysbuild/ipc_radio.conf to use LFRC, keeping the application using crystal, and was able to reproduce advertising stopping after about 1 hour with a few intermittent connections.  Same as in my app.  Can you give this a try to reproduce?

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
  • Sure, I can try to reproduce this. Did you test with SDK v3.0.x as well?

    EDIT: I started a simple test that I will let run over night. I used the peripheral_lbs sample from v3.0.1 and applied the clock configuration you posted. In addition I set CONFIG_RESET_ON_FATAL_ERROR=n on both cores to avoid masking any runtime errors.

  • I did not.  We are in production and still using 2.9.x (because of all the changes needed to move to 3.0.x we won't be moving to that version quite yet)..

  • I got an MPSL assert in the IPC radio FW after x LF calibration events which caused the program to enter the fatal error handler. I have reported this internally for further investigations. However, since this is occurring on the network core which is not updatable in your case, I'm afraid it will not be possible to work around this.   

Related