nrf9160 NVS write flush (NCS 1.9.1, MFW 1.3.2)

Hello,

My application stores settings in Zephyr NVS. During device production a python script running on PC sends RTT commands to write initial settings to NVS/flash.

The setup ran flawlessly on my table, but factory had some issues as the settings wasn't successfully written to flash after production. Turns out, they controlled DUT power switch automatically and turned DUT power off as soon as the script returned. Adding a delay before turning power off fixed the issue.

Does it mean that data are not yet committed to the flash after nvs_write returned? I have a hard time reading soc_flash_nrf.c, looks like much of the code there is to ensure realtime radio operation on nrf52, is this still enabled for nrf9160? How do I ensure that the data are flushed?

Thank you.

Related