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

Issue adding FDS module from BLE stack to the Mesh application

Hello, I'm trying to add a Peer Manager functionality to the Mesh Provisioner application.

I'm using nRF52832 devkit, Segger Embedded Studio, nRF5 SDK for Mesh 2.0.0 and nRF5 SDK 15.1.0.

Currently I've managed to add some BLE functionality to the Mesh application: connection and services. But to add password in order to secure the connection it's required to use the Peer Manager module, which in turn uses FDS library. Mesh uses its own flash library Flash Manager, so I applied a fix from the Infocenter (coexistence with nRF5 SDK BLE functionality) and added the following code in nrf_mesh_config_app.h:

#include "fds.h"
#include "fds_internal_defs.h"
#define FLASH_MANAGER_RECOVERY_PAGE_OFFSET_PAGES FDS_PHY_PAGES
The behavior is now the following: after reflashing the kit, the program crashes shortly after pm_init() with no error message, but after 3 manual restarts it proceeds further. 
I've discovered that function causing this behavior is fds_init(). It turns out that mesh initialization doesn't matter. Even if I try to simply initialize FDS like this in a mesh app, the program crashes:
fds_register(fds_evt_handler); // some user-defined handler
ERROR_CHECK(fds_init());
Could somebody explain what is causing such behavior and how to correctly use FDS in a mesh application? Thanks.
Parents
  • Hi,

    May I ask why you are using sdk v15.1 with mesh sdk v2.0.0? I believe all v2 releases of the mesh sdk require nRF5 SDK v15.0.0 as seen here.That might be a reason you are running into problems. Also, make sure to change the SDK_ROOT in SES like this: go to the Tools tab -> Options -> Building tab -> change SDK_ROOT global macro to point to the path to sdk 15.0.0.

    Did you make sure that the flash areas are not overlapping? As the infocenter documentation states, overlapping flash areas might lead to errors. I would also recommend to at least upgrade to mesh sdk v2.0.1, as this is the first sdk with a qualified mesh stack.

    If possible, I would recommend taking a look at the new flash manager in the latest mesh sdk v2.2.0. The flash manager has been updated significantly. This & this case may also be helpful.

    Kind Regards,

    Bjørn

Reply
  • Hi,

    May I ask why you are using sdk v15.1 with mesh sdk v2.0.0? I believe all v2 releases of the mesh sdk require nRF5 SDK v15.0.0 as seen here.That might be a reason you are running into problems. Also, make sure to change the SDK_ROOT in SES like this: go to the Tools tab -> Options -> Building tab -> change SDK_ROOT global macro to point to the path to sdk 15.0.0.

    Did you make sure that the flash areas are not overlapping? As the infocenter documentation states, overlapping flash areas might lead to errors. I would also recommend to at least upgrade to mesh sdk v2.0.1, as this is the first sdk with a qualified mesh stack.

    If possible, I would recommend taking a look at the new flash manager in the latest mesh sdk v2.2.0. The flash manager has been updated significantly. This & this case may also be helpful.

    Kind Regards,

    Bjørn

Children
  • Thanks for your answer.

    I know that mesh examples use SDK 15.0.0, but I've decided to transfer it to use 15.1.0 because of all of the updates and no visible difficulties apart from changing paths and including files into the projects. So maybe I will also transfer it to newer mesh SDK.

    So, now I've reworked my example on top of ble_app_proximity_coexist, which uses Peer Manager, and managed to initialize FDS in Peer Manager. Secure connections work correctly now with BLE functionality, but it's still not clear enough why FDS couldn't start in example where there was no Peer Manager to begin with. 

    I assumed that the fix provided here is enough to avoid overlapping of the BLE, but maybe it's not depending on the actual project. The difference from the coexist examples is that they use mesh client/server and not provisioner with Flash Manager like my app. 

Related