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

Pair device address and BT_Characteristic Notify enable disable use unwanted flash space in NCS v1.4.2

Hi,

I have develop the Code based on HID_KEYBOARD AND NUS code

here i also need to ADD NVS and DFU to nrf52840 device

1. Pair device address is stored in what manner. I am not able to read and delete the pair data. Is there any document for bond management

2. While using BLE NUS, BATTERY, and Custom service notification enable

I found that some data is writing on the flash . Its like increase the size of the flash . i need to control the unwanted storage . how it is possible

3. I have use storage that to be start F8000 and size is 8000 . is it possible to write and read the data in page wise ( entering direct address to write and read data).

Parents
  • Hi Sunil,

     You are using a bit of an older version of NCS, read more on latest v1.6.1 (at the time of this writing)

    1. Pair device address is stored in what manner. I am not able to read and delete the pair data. Is there any document for bond management

     I am assuming that the bond management is done inside the Softdevice controller and no details about how it does that seems to be documented. What is your exact need for knowing this detail? What are you trying to achieve?

     

    I found that some data is writing on the flash . Its like increase the size of the flash . i need to control the unwanted storage . how it is possible

     You can easily understand this by setting the brearkpoints at the flash activity API and starting the program in debug mode. The function call stack will give you the contexts of those flash acitivity.

     

    3. I have use storage that to be start F8000 and size is 8000 . is it possible to write and read the data in page wise ( entering direct address to write and read data).

     It should possible to do that using the HAL drivers which are OS agnostic drivers. These HAL NVMC drivers use direct address to access flash but you should be very careful not to conflict you access with other modules in the RTOS system that think they own that flash page.

  • 1. I want to use ble_hid_keyboard program. where i need to implement DFU and Flash storage to store some data

    As i know from board management file the storage location starts at  F8000 and size is 8000 if so. does DFU dual bank is working or not is any address collusion will occur or not i need to understand . and  i have tested the NVS code in that data store is based on ID not direct address . and it use extra 8 byte each id while write / read also in delete . and it have restriction that one page complete and then it move to another page .

    My requirement is

    page size - 4096 bytes

    allocate

    1st page for bond management

    2nd page for sensor1 data 1KB

    3rd page for sensor 2 data 2KB

    if i need i can delete the 2nd page and rewrite it . if i need to delete bond then i rewrite on 1st page

    2. why those service enable function are stored in flash . i found these in ble_peripheral_uart and also in BAS service enable and disable function.

    how to stop writing this in flash

    3. Any example codes are there for direct address flash storage

    if bond management is based on softdevice means how to control it . and function to delete the bond functionality

  • Sunil,

    Pairing data is written to the flash by controller as the SMP requests it. I do not know the internals of the size but most likely a page is reserved for this. I think it might be possible to increase the number of pages that the controller uses but might not be possible to remove it over all if you want bonding/pairing to work.

     

    I found that some data is writing on the flash . Its like increase the size of the flash . i need to control the unwanted storage . how it is possible

     It is possible for you to trace the calls back to the caller of the flash write functions if you put breakpoints to the flash API and start your application in debugger. For now, I do not have those internal details readily avaailable..

  • Yes, I found that using SMP the pairing data is written.

    How to delete completely the pair data.

    I found that some data is writing on the flash . Its like increase the size of the flash . i need to control the unwanted storage . how it is possible

    I found that CCCD CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE is enabled because when power cycle the device . its auto connect but not giving key report (ble_keyboard).

    beacuse of enabling CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE it writes the CCCD enable and disable to flash storage.

    is it possible to write only CCCD enable to flash storage ?

Reply Children
No Data
Related