Settings API Example Compiling, but not working

I'm attempting to use the Settings API save and retrieve data from nRF52832 FLASH memory.  I can build and run the example application provided in the Settings documentation (link below)

https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/settings/index.html#example_persist_runtime_state

The entries in my prj.conf file are:

CONFIG_SETTINGS=y
CONFIG_REBOOT=y
The application runs and reboots as intended, but the write or read from FLASH is not working.   Here is the serial port output:
*** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
*** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
foo: 1
*** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
*** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
foo: 1
*** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
*** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
foo: 1
*** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
*** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
foo: 1
What else must I do to make the Settings API correctly save and restore data?
Thanks
Parents
  • Tried your sample on nRF52832 DK and it seems to be working as expected with foo updated

    
    
    
    
    
    
    
    
    
    
    
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 19
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 20
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 21
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 22
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 23
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 24
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 25
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 26
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 27
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 28
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 29
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 30
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    foo: 31
    
    
    

    Attaching my project including build folder

    settings.zip

  • Oh wow.  Thanks for doing that.

    What CONFIG items did you have in your prj.conf file?

    Of course I'm mystified why it's not working on my nrf52dk/nrf52832 board.

  • oops.  Sorry.  I didn't see that you attached your code.

  • I finally have it working and I'm grateful for the help.   

    The missing piece was a file that Sasheel had in boards directory:  nrf52dk_nrf52832.conf

    While I'm grateful to have it working, but I do find it very inconvenient that this required file was not mentioned in the Settings documentation.   Can Nordic please explain how I can be aware of such dependencies in the future?


    Thank you,

    Jim

Reply
  • I finally have it working and I'm grateful for the help.   

    The missing piece was a file that Sasheel had in boards directory:  nrf52dk_nrf52832.conf

    While I'm grateful to have it working, but I do find it very inconvenient that this required file was not mentioned in the Settings documentation.   Can Nordic please explain how I can be aware of such dependencies in the future?


    Thank you,

    Jim

Children
Related