This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Guarantee that SoftDevice won't wake the CPU up

nRF52832, SDK 14.0.0, SoftDevice 132 v5.

If SoftDevice is enabled but the system is not yet advertising or connected via BLE, will SoftDevice ever wake the CPU up from sleep?

The context here is that we're doing an open-loop voltage measurement from our PMIC, and the nRF52 /must/ be sleeping while this happens. If SoftDevice wakes it up, the nRF52 current draw will overwhelm a capacitor and brown out, causing a system reset.

Related to https://devzone.nordicsemi.com/f/nordic-q-a/45502/rtc1-irq-not-firing-until-debugger-connected, where enabling SoftDevice seems to make app_timer work, but now I'm nervous that SoftDevice will wake the nRF52 out of a critical sleep.

Parents
  • Hi,

    The Softdevice will perform periodic calibration of the RC oscillator if that's the clock source you use. However, the current draw is pretty low (~4uA average). Also, this is an "internal" Softdevice event that won't wake the application. Apart from that, it should not generate any events.

  • "Internal" SoftDevice events consume CPU current, though, which can cause our system to fail. Is there a way to tell SoftDevice to be 100% silent and do nothing for an explicit period of time?

    As soon as I rearranged our firmware to enable SoftDevice before doing anything else, our PMIC closed-loop battery measurements started failing. My hypothesis is that SoftDevice, oblivious to this requirement, is waking up at whatever intervals it chooses to do housekeeping. It absolutely must not do that during this period.

  • To be clear, waking the nRF52 up for any reason at all will kill us. Clock recalibration, as I understand it, does the following:

    1. Wake the nRF52 up

    2. Enable the external 1mhz crystal oscillator

    3. Set a timer for a few single-digit msec

    4. Update a scalar correction factor used to un-skew the internal IRC oscillator

    5. Disable the external oscillator

    6. Go back to sleep.

    We need to perform none of these, or any other steps, for ~126 msec.

Reply
  • To be clear, waking the nRF52 up for any reason at all will kill us. Clock recalibration, as I understand it, does the following:

    1. Wake the nRF52 up

    2. Enable the external 1mhz crystal oscillator

    3. Set a timer for a few single-digit msec

    4. Update a scalar correction factor used to un-skew the internal IRC oscillator

    5. Disable the external oscillator

    6. Go back to sleep.

    We need to perform none of these, or any other steps, for ~126 msec.

Children
No Data
Related