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

Merge projects of ble_app_uart and flash_fstorage

Hi,

I would like to build a project with functions below.

  1. Support BLE uart service
  2. Support CLI with uart interface for the communication with terminal, like TeraTerm.
  3. Has the ability to access persistent memory

After looking for the sdk examples i found two projects, flash_fstorage and ble_app_uart, are suitable for the requirement.(The locations of the two projects are listed after the signature.) Then i try to merge the two together, simply compare the difference between the two and adding miss files from one to the other. With some try and including paths, it builds successfully. Then i run the merged project on pca10040 board and do some simple tests before going ahead.

  1. Can it repeat the result of flash_fstorge: build and run merged project with main.c copied from flash_fstorge project, the results of the merged project and flash_fstorage are the same. it can erase, write and read persistent memory successfully.
  2. Can it repeat the result of ble_app_uart: build and run merged project with main.c copied from ble_app_uart project. It failed and shown the following message by RTT viewer.

0> app: ERROR 4 [NRF_ERROR_NO_MEM] at ......\main.c:221

After digging into more i found it failed on sd_ble_uuid_vs_add() with error number NRF_ERROR_NO_MEM. I wonder if i need change some parameters but i don't know how, any suggestion on it?

Thanks, Wayne

flash_fstorage project:

nRF5_SDK_14.2.0_17b948a\examples\peripheral\flash_fstorage\pca10040\s132\arm5_no_packs\flash_fstorage_example_s132_pca10040.uvprojx

ble_app_uart project:

nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_uart\pca10040\s132\arm5_no_packs\ble_app_uart_pca10040_s132.uvprojx
  • rd and do some simple tests

    Sorry for the late reply, seems your question have fallen through to cracks somehow.

    When NRF_ERROR_NO_MEM is returned from sd_ble_uuid_vs_add() it is usually because you haven't configured the SoftDevice to reserve memory for enough base UUIDs. In ble_app_uart NRF_SDH_BLE_VS_UUID_COUNT is used to set how many base UUIDs you want to support. This is 1 in the ble_app_uart example. Is it 1 in your example? If it isn't, set it to 1, if it is, try to increase it to 2 and see if that changes anything.

    I would also recommend having a look at FDS. This is a file system that uses Fstorage as a backend.

Related