ble connection trace after power down

hello Nordic

i am workig with nrf52840 and nrf52832 with ncs v2.5.0

i sometimes get power down resets while connecting via BLE cause of low battery.

since i know at rise-up that reset reason was power i would also like to know if my device was connected while the power down happened.

is there some register or other why to know after a device is powered on that it was connected via BLE before it was powered down cause of low battery or other ?

hope to read you soon

best regards

Ziv

Parents
  • Hi,

    There is no register keeping information about BLE connection status. BLE protocol state is known only to the software stack, the RADIO peripheral just sends/receives packets defined by the SW.

    You can use the Power supply supervisor to get an early warning when battery voltage becomes too low, but unfortunately, it is not possible to write the connection state to flash directly if you get into this state: "If power-fail warning is enabled and the supply voltage is below VPOF the power-fail comparator will prevent the NVMC from performing write operations to the NVM."

    Depending on the voltage level where the warning is generated, you could disable the Power supply supervisor feature (or perform a soft reset with GPREGRET register set to a specific value that is written to flash on boot) to write the state to flash before the device is powered down.

    Another alternative is to always write the connection state to flash, for instance using NVS library, but this could wear out flash over time if you have lots of connect/disconnects (flash is rated for 10000 write/erase cycles per page).

    Best regards,
    Jørgen

Reply
  • Hi,

    There is no register keeping information about BLE connection status. BLE protocol state is known only to the software stack, the RADIO peripheral just sends/receives packets defined by the SW.

    You can use the Power supply supervisor to get an early warning when battery voltage becomes too low, but unfortunately, it is not possible to write the connection state to flash directly if you get into this state: "If power-fail warning is enabled and the supply voltage is below VPOF the power-fail comparator will prevent the NVMC from performing write operations to the NVM."

    Depending on the voltage level where the warning is generated, you could disable the Power supply supervisor feature (or perform a soft reset with GPREGRET register set to a specific value that is written to flash on boot) to write the state to flash before the device is powered down.

    Another alternative is to always write the connection state to flash, for instance using NVS library, but this could wear out flash over time if you have lots of connect/disconnects (flash is rated for 10000 write/erase cycles per page).

    Best regards,
    Jørgen

Children
No Data
Related