This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Flash storage in nRF52 using nrf connect sdk

Hi,

I need to store the 1kB of data in the flash storage and it need to be read anytime and change the data anywhere.

I am using nrf52840 DK and also nrf5340 DK to perform these Flash storage

I found the example code in this link

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/storage/nvs/nvs.html?highlight=flash%20storage

and i have tested the code.

I have difficulty to change the data storage address. where we need to change the starting address. size of flash storage. If i use DFU how to assign the flash storage

Parents Reply Children
  • Hi ,

    I found this lines in nrf52dk_nrf52832.dts

    boot_partition: partition@0 {
    			label = "mcuboot";
    			reg = <0x00000000 0xc000>;
    		};
    		slot0_partition: partition@c000 {
    			label = "image-0";
    			reg = <0x0000C000 0x32000>;
    		};
    		slot1_partition: partition@3e000 {
    			label = "image-1";
    			reg = <0x0003E000 0x32000>;
    		};
    		scratch_partition: partition@70000 {
    			label = "image-scratch";
    			reg = <0x00070000 0xa000>;
    		};
    		storage_partition: partition@7a000 {
    			label = "storage";
    			reg = <0x0007a000 0x00006000>;
    		};

    there it show the

    storage_partition: partition@7a000 {
                label = "storage";
                reg = <0x0007a000 0x00006000>;
            };

    if 0x7a000 then what is 0x00006000  (storage size?) how it calculate in kB.

    and if i change the start address from 0x7a000 to 0x7000 then what will be the storage size .

    My case i need to store the

    1. Bond state PM address

    2. 1 KB (Kilo Byte) sensor data

    3. 2 KB second sensor data

  • Sunil vignesh said:
    if 0x7a000 then what is 0x00006000  (storage size?) how it calculate in kB.

     6000 hex is 24 kB.

     

    Sunil vignesh said:
    and if i change the start address from 0x7a000 to 0x7000 then what will be the storage size .

     You can't change it in the dts file directly. You need to modify the partition manager with a pm_static.yml file.

Related