Storing to flash storage

Hi, 

We're working on the nrf52833 chipset and were wondering how to add more data to the flash storage. I've traced the calls of load_settings() in the main and where fcb_init() is called in bt_enable() but it seems to just know where flash data is. There's no struct or file that actually has data that I can manipulate / add to. Ideally, we would like to be able to see where the bluetooth configuration data is in the flash. Any pointers to the right direction or advice would be appreciated.

Thanks,

Spencer

Parents Reply Children
  • Hi

    Is the Non-Volatile Storage Driver what you are looking for?
    For an example, see NVS: Non-Volatile Storage sample.

    There might be some complications when the Bluetooth driver and NVS tries to use flash at the same time, but it should be possible to solve this. See this case for a case where this happened.

    If you face any problems with your implementation, let me know, and I will try to help.

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd, 

    I saw the example and document and it does look like that's a step in the right direction. However, when trying to implement it in my code I get an error saying "undefined reference to xxx" where xxx are the different nvs functions like nvs_init, nvs_read, etc. But for some reason, I only get this error when I'm trying to rebuild the solution; I can compile the file I have with the nvs functions by itself and it will compile. I'm not sure why I would be getting undefined references then... any advice?

    Thanks,

    Spencer

  • Hi Spencer,

    Which tool are you using to build your project?

    Could you post the full error log?

    Regards,
    Sigurd Hellesvik

  • Hi,

    I'm using Segger Embedded Studio. Sure, here is the error log. It's quite long so if you want anything more specific let me know! Thanks.



    app/libapp.a(NVSAbstraction.o): in function `NVSAbstraction::testing()':
    undefined reference to `nvs_init'
    c:/users/e0645950/documents/otherbranches/champ2_central_uc_fw/nordicsdk/nrf_connect_sdk/v1.5.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\E0645950\Documents\OtherBranches\champ2_central_uc_fw\NordicSDK\NRF_Connect_SDK\nrfConnectprj\champ_light_build_nrf52833/../../../../CHAMPSourceCode/PIC_SDK_AbstractionLayer/HardwareAbstraction/NVSAbstraction.cpp:92: undefined reference to `nvs_read'
    c:/users/e0645950/documents/otherbranches/champ2_central_uc_fw/nordicsdk/nrf_connect_sdk/v1.5.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\E0645950\Documents\OtherBranches\champ2_central_uc_fw\NordicSDK\NRF_Connect_SDK\nrfConnectprj\champ_light_build_nrf52833/../../../../CHAMPSourceCode/PIC_SDK_AbstractionLayer/HardwareAbstraction/NVSAbstraction.cpp:100: undefined reference to `nvs_write'
    c:/users/e0645950/documents/otherbranches/champ2_central_uc_fw/nordicsdk/nrf_connect_sdk/v1.5.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\E0645950\Documents\OtherBranches\champ2_central_uc_fw\NordicSDK\NRF_Connect_SDK\nrfConnectprj\champ_light_build_nrf52833/../../../../CHAMPSourceCode/PIC_SDK_AbstractionLayer/HardwareAbstraction/NVSAbstraction.cpp:104: undefined reference to `nvs_read'
    c:/users/e0645950/documents/otherbranches/champ2_central_uc_fw/nordicsdk/nrf_connect_sdk/v1.5.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\E0645950\Documents\OtherBranches\champ2_central_uc_fw\NordicSDK\NRF_Connect_SDK\nrfConnectprj\champ_light_build_nrf52833/../../../../CHAMPSourceCode/PIC_SDK_AbstractionLayer/HardwareAbstraction/NVSAbstraction.cpp:106: undefined reference to `nvs_write'
    c:/users/e0645950/documents/otherbranches/champ2_central_uc_fw/nordicsdk/nrf_connect_sdk/v1.5.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\E0645950\Documents\OtherBranches\champ2_central_uc_fw\NordicSDK\NRF_Connect_SDK\nrfConnectprj\champ_light_build_nrf52833/../../../../CHAMPSourceCode/PIC_SDK_AbstractionLayer/HardwareAbstraction/NVSAbstraction.cpp:116: undefined reference to `nvs_read_hist'
    c:/users/e0645950/documents/otherbranches/champ2_central_uc_fw/nordicsdk/nrf_connect_sdk/v1.5.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\E0645950\Documents\OtherBranches\champ2_central_uc_fw\NordicSDK\NRF_Connect_SDK\nrfConnectprj\champ_light_build_nrf52833/../../../../CHAMPSourceCode/PIC_SDK_AbstractionLayer/HardwareAbstraction/NVSAbstraction.cpp:126: undefined reference to `nvs_write'
    c:/users/e0645950/documents/otherbranches/champ2_central_uc_fw/nordicsdk/nrf_connect_sdk/v1.5.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\E0645950\Documents\OtherBranches\champ2_central_uc_fw\NordicSDK\NRF_Connect_SDK\nrfConnectprj\champ_light_build_nrf52833/../../../../CHAMPSourceCode/PIC_SDK_AbstractionLayer/HardwareAbstraction/NVSAbstraction.cpp:135: undefined reference to `nvs_write'
    ld returned 1 exit status
    Build failed

    *edited to make shorter

  • Hi Spencer

    How does your prj.conf look?

    Regards,
    Sigurd Hellesvik

Related