nRF Connect 1.8.0 SDK NVS Suppress Messages

Hello,

I'm working with the nRF Connect NVS module on the nRF9160.  Every time there is a read/write to NVS the messages:

I: 3 Sectors of 4096 bytes
I: alloc wra: 0, 668
I: data wra: 0, 4c0
D: Recovering last ate from sector 0

Are getting printed.  I looked through nvs.c and can't figure out where they're coming from.  What is the source of these messages and is there a way to suppress them?

Thanks!

  • Hi Jake,

    In your prj.conf, simply add (or modify, if it exists)

    CONFIG_NVS_LOG_LEVEL_DBG=n

    That should be it.
    I found out by doing a quick search for "recovering last" in the Zephyr tree and build folder, and seeing that the messages are coming from "LOG_DBG" statements in the NVS library. See for example line 446 in

    .../ncs/v2.1.2/zephyr/subsys/fs/nvs/nvs.c

    Just in case you weren't aware, you can basically consider "LOG" statements as print statements (except you have some more control at compile time over whether you want them to show up). DEBUG is the most verbose level of logging available in Zephyr, used only for troubleshooting some software component - so safe to say these can be turned off most of the time.

    You can see that the NVS log module gets registered on line 17 in the same file, with a specified log level as an argument. Usually you configure your desired log level for each declared log module in prj.conf, with for example  "CONFIG_NVS_LOG_LEVEL=2" (Level 2 will print errors and warnings, but no more). This way you can be precise about how much information you want to get from your various modules.

    You could also set a global max for your log levels, or turn off logging entirely. (CONFIG_LOG=n)

    Best regards,

    Raoul Pathak

  • That was it thank you!  And thanks for explaining how you found it, that's really helpful.  

Related