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
  • 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

Children
  • 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

  • Which one? My system finds a bunch when I type it in. Anything in particular I should be looking for inside of it?

  • Hi Spencer,

    nRF Connect SDK projects are set up in a specific way. See the Zephyr Hello World sample for how it looks:

    Your main file will be located in a "src/" folder. The prj.conf I refer to is the file located in the same folder as "src".

    To learn more about the basics of nRF Connect SDK, see the nRF Connect SDK Tutorial series.

    Regards,
    Sigurd Hellesvik

Related