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

Flash storage, unable to write and read 1024 and 2048 bytes

Hi, I am testing the flash storage of nrf52840 with NVS example from NCS v1.4.2

i have run the example code successfully. from the example code i have changed the

uint8_t longarray[128]; to uint8_t longarray[1024];

memset(&longarray , 'A',sizeof(longarray));

output log is

*** Booting Zephyr OS build v2.4.0-ncs2  ***

 rd - ID : 1 ; D :  ; L:16
No address found, adding 192.168.1.1 at id 1
 
wd - ID : 1 ; D : 192.168.1.1 ; L:12

write : O:f8000, D:192.168.1.1, L:12
write : O:f8ff0, D:, L:8
 rd - ID : 2 ; D : è ; L:8
No key found, adding it at id 2
 
wd - ID : 2 ; D : ÿþýüûúùø ; L:8

write : O:f800c, D:ÿþýüûúùø, L:8
write : O:f8fe8, D:, L:8
 rd - ID : 3 ; D :  ; L:4
No Reboot counter found, adding it at id 3
 
wd - ID : 3 ; D :  ; L:4

write : O:f8014, D:, L:4
write : O:f8fe0, D:, L:8
 rd - ID : 4 ; D : 192.168.1.1 ; L:16
Id: 4 not found, adding it
 
wd - ID : 4 ; D : DATA ; L:5

write : O:f8018, D:DATA, L:4
write : O:f8fd8, D:, L:8
 rd - ID : 5 ; D : Pa ; L:1024
Longarray not found, adding it as id 5

Query is

1. How to properly write and read the 1024 bytes,2048 bytes

2. I need to work in ble_his_keyboard example. where flash storage is initialized for pairing data storage. I need to store the sensor data . how to interface flash write into the main application of ble_hid_keyboard

Parents Reply
  • Hi Simon,

    We continue here

    Issue 1 :

          Basic BLE_HID_KEYBOARD example with nRF52840 DK board the application use flash storage starts from F8000 by default it use F8000 - FF000 8 pages . Same code while enabling DFU Bootloader it starts from FE000 and used only 2 pages FE000 - FF000.

    this logic is not understanding . Even if i given flash pages been F5000 and 3 pages only then also it starts from FE000.

    Issue 2 :

            I have created two storage partition to not disturbing my data and the device ble / Pair setting .

           Default "storage" partition is used for the BLE Pair data storage , other activity of device are stored in the partition . "sensor" partition is used for storing my personal data.

    Without DFU : Works perfect

    With DFU :     It through an error

    nrf52840dk_nrf52840.dts

    peripheral_hids_keyboard.zip

Children
Related