When NVS flash is enabled device does not boot/start

I'm currently trying to port some software to the nrf52840 dongle, and it works great, if I do not activate NVS.

As soon as I activate NVS, then the dongle shows no lifesigns (unable to see it in dmesg, no lights, etc.).

I suspect it has something to do with the offsets for the partitions, as I'm running the default bootloader that the device cames with.

Currently to make it build, I have changed the following things: https://github.com/eyJhb/hid-remapper/blob/add-nrf52840-dongle-support/firmware-bluetooth/boards/nrf52840dongle_nrf52840.conf

But doing this, it doesn't persist any configuration that is made runtime using the project.

I build it doing the following.


git clone -b add-nrf52840-dongle-support https://github.com/eyJhb/hid-remapper.git
cd hid-remapper/firmware-bluetooth
west build -b nrf52840dongle_nrf52840
nrfutil pkg generate --hw-version 52 --sd-req=0x00 --application build/zephyr/remapper.hex --application-version 1 remapper.zip && nrfutil dfu usb-serial -pkg remapper.zip -p /dev/ttyACM0

I'm using the 2.2 sdk in Docker with the image `nordicplayground/nrfconnect-sdk:v2.2-branch`. 

I would appreciate any pointers that you might have, to get this running. I'm at my wits' end now. I tried to debug it on my DK board, but it opened many other issues instead.

The source for the project I'm experimenting on can be found here https://github.com/eyJhb/hid-remapper/tree/add-nrf52840-dongle-support (keep in mind the branch).

Parents
  • Hello,

    The problem could be that the NVS storage partition is overlapping with the bootloader that comes pre-programmed on the Dongle. Please have a look at this thread: https://devzone.nordicsemi.com/f/nordic-q-a/118594/nrf52840-dongle-ble-peripheral_uart-example-sdk-migration-from-2-6-0-to-2-9-0 tosee if it may be relevant. 

    Best regards,

    Vidar

  • Hello,

    Thanks for the quick response! I've looked at the replies in the thread, and I'm unable to apply it in a meaningful way to my setup, which is most likely a lack of urderstanding how it works. I use neither sysbuild, or the partition manager. So I think it should " just work". I've tried setting the following as well, but it doesn't seem to aid anything.

    CONFIG_BOOTLOADER_MCUBOOT=n
    CONFIG_BOARD_HAS_NRF5_BOOTLOADER=y

    If I however disable the NVS settings backend, and use FCB for settings, then it works and I can save settings. But ideally it should use the NVS backend.

    CONFIG_USE_DT_CODE_PARTITION=n
    CONFIG_NVS=n
    
    CONFIG_SETTINGS_FCB=y
    CONFIG_FCB=y
    

    Is there anything in the overlay that should be changed, to match the above thread? From reading it, it seems like if I'm not using sysbuild, it should "just work".

  • Hello,

    I see now that this project is based on an older version of our SDK so the linked Q&A does not apply in your case (SDK v2.2.0 is not using the sysbuild and does not require use of the partition manager). That said, please try with the DT overlay and see if you get the same result:

    / {
        aliases {
            led0 = &led1_red;
            led1 = &led1_blue;
        };
        chosen {
            /delete-property/ zephyr,code-partition;
        };
    };
    
    /delete-node/ &storage_partition;
    /delete-node/ &slot0_partition;
    /delete-node/ &slot1_partition;
    /delete-node/ &scratch_partition;
    
    &flash0 {
    
    	partitions {        
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
            mbr_partition: partition@0 {
                label = "softdevice";
                reg = <0x00000000 0x0001000>;
            };
    
            code_partition: partition@1000 {
                label = "code_partition";
                reg = <0x00001000 0x000db000>;
            };
    
            storage_partition: partition@dc000 {
                label = "storage";
                reg = <0x000dc000 0x00004000>;
            };
    
            nrf5_bootloader: partition@e0000 {
                label = "nrf_bootloader";
                reg = <0x000e0000 0x000020000>;
            };
    	};
    };
     

    Note: if you want to test this build on an nRF52840 DK, you must program the mbr.hex separately. It's available in the  old nRF5 SDK under the following path nRF5_SDK_17.1.0_ddde560/components/softdevice/mbr/hex.

    Best regards,

    Vidar

Reply
  • Hello,

    I see now that this project is based on an older version of our SDK so the linked Q&A does not apply in your case (SDK v2.2.0 is not using the sysbuild and does not require use of the partition manager). That said, please try with the DT overlay and see if you get the same result:

    / {
        aliases {
            led0 = &led1_red;
            led1 = &led1_blue;
        };
        chosen {
            /delete-property/ zephyr,code-partition;
        };
    };
    
    /delete-node/ &storage_partition;
    /delete-node/ &slot0_partition;
    /delete-node/ &slot1_partition;
    /delete-node/ &scratch_partition;
    
    &flash0 {
    
    	partitions {        
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
            mbr_partition: partition@0 {
                label = "softdevice";
                reg = <0x00000000 0x0001000>;
            };
    
            code_partition: partition@1000 {
                label = "code_partition";
                reg = <0x00001000 0x000db000>;
            };
    
            storage_partition: partition@dc000 {
                label = "storage";
                reg = <0x000dc000 0x00004000>;
            };
    
            nrf5_bootloader: partition@e0000 {
                label = "nrf_bootloader";
                reg = <0x000e0000 0x000020000>;
            };
    	};
    };
     

    Note: if you want to test this build on an nRF52840 DK, you must program the mbr.hex separately. It's available in the  old nRF5 SDK under the following path nRF5_SDK_17.1.0_ddde560/components/softdevice/mbr/hex.

    Best regards,

    Vidar

Children
No Data
Related