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

mesh_config_event.h MESH_CONFIG_STRATEGY_ON_POWER_DOWN

Hi,

We are looking at using the key:value store functionality defined in mesh_config.h. Can you provide some additional detail on

HW and or SW configuration required to use the  MESH_CONFIG_STRATEGY_ON_POWER_DOWN strategy.

Per the nRF52840 PSv1.1, the NVIC doesn't permit writing to FLASH once a brownout is detected (or at least that is our understanding).

How should we trigger the FLASH write? Do we need to monitor a voltage level over a CAP or similar outside of the SoC?

Our device is line-powered. Mesh SDK v3.0 and Nordic SDK 15.2. We see the mesh_config is used to persist a few Mesh Stack variables, but

weren't able to find any that are rapidly changing or use the power down strategy.

Erik

Parents
  • Hi,

    The mesh config APIs themselves are unaware of the brown out state or power availability. To use `MESH_CONFIG_STRATEGY_ON_POWER_DOWN` strategy, user should generate some kind of external interrupt using power monitoring hardware to signal the application to trigger flash writes by calling `mesh_config_power_down()` API. User should design a system with sufficiently large backup capacitor such that enough power is available to finish all flash writes. The time required to store all mesh config entries can be obtained by calling `mesh_config_power_down_time_get()`API.

  • Yes, your understanding is correct. You need to have an external circuit that triggers the interrupt on a separate gpio pin before the VCC level drops significantly causing failure of flash writes. It is best to not use POFCON functionality since mesh_config functionality does not take any action to allow or disallow writing. If flash area is available, it will always try to finish pending writes. System designer should ensure that sufficient power backup is available to complete these writes.

    To minimize capacitor size you can also disable the mesh completely by calling `nrf_mesh_disable()` after receiving the interrupt.

Reply
  • Yes, your understanding is correct. You need to have an external circuit that triggers the interrupt on a separate gpio pin before the VCC level drops significantly causing failure of flash writes. It is best to not use POFCON functionality since mesh_config functionality does not take any action to allow or disallow writing. If flash area is available, it will always try to finish pending writes. System designer should ensure that sufficient power backup is available to complete these writes.

    To minimize capacitor size you can also disable the mesh completely by calling `nrf_mesh_disable()` after receiving the interrupt.

Children
No Data
Related