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
  • The link/picture you've added is broken on my end. Can you try uploading it again? 

    Regarding your other ticket, try moving the "writable Flash pages to pages not used by the bootloader/DFU to be able to write to flash.

    There are no declarations of anything called "PM_PM_PM" in the NCS, so you should check out whatever function you're getting this error from and check that you're using it correctly.

    Best regards,

    Simon

Children
Related