Hi Nordic Team!
I have bought nRF52 DK and my aim is to create BLE application for a peripheral that it would be possible to connect multiple centrals (for example android smartphones) to it. I use SEGGER Embedded Studio for ARM V3.34b 64bit to flash my device with SoftDevice s132_nrf52_6.0.0 and with multiperipheral example from nRF5_SDK_15.0.0_a53641a.
The example has got very limited functionality but I believe this will be my base application to work with. I want to extend and develop it. The first thing I want do add is the pairing and bonding (so using persistent memory).
I followed the guide:
https://devzone.nordicsemi.com/tutorials/b/software-development-kit/posts/migrating-to-peer-manager
and added to nRF_BLE group the following:
- [sdk]/components/ble/peer_manager/ (all source files)
- [sdk]/components/ble/common/ble_conn_state.c (it was already there)
Added to nRF_Libraries group the following:
- [sdk]/components/libraries/fds/fds.c
- [sdk]/components/libraries/fstorage/fstorage.c (nrf_fstorage.c was in the folder, not fstorage.c)
- [sdk]/components/libraries/util/sdk_mapped_flags.c
- [sdk]/components/libraries/fstorage/nrf_fstorage_sd.c
I hadn’t to add the directories:
- [sdk]/components/ble/peer_manager/
- [sdk]/components/libraries/fds
- [sdk]/components/libraries/fstorage
- [sdk]/components/libraries/experimental_section_vars
because they were already there.
Added:
to main.c file.
Then I “borrowed” some functions from Heart Rate Service Sample Application from the same SDK:
and added the call:
Then I got into sdk_config.h file and changed some defines:
#define PEER_MANAGER_ENABLED 0 to #define PEER_MANAGER_ENABLED 1
#define FDS_ENABLED 0 to #define FDS_ENABLED 1
#define NRF_FSTORAGE_ENABLED 0 to #define NRF_FSTORAGE_ENABLED 1
and changed
static void advertising_start(void) to void advertising_start(void)
in main.c file (there was an error during compilation without this change).
According to: https://devzone.nordicsemi.com/b/blog/posts/segger-embedded-studio-a-cross-platform-ide
I have checked the flash_placement.xml but the below lines already were there:
FLASH: ...
<ProgramSection alignment="4" keep="Yes" load="Yes" name=".fs_data" inputsections="*(.fs_data*)" runin=".fs_data_run"/>
...
RAM: ...
<ProgramSection alignment="4" keep="Yes" load="No" name=".fs_data_run" address_symbol="__start_fs_data" end_symbol="__stop_fs_data" />
...
I have imported thumb_crt0.s (to have own copy in project folder, not use the shared one from SDK) and added:
The program compiles and flashed without any error. I am able to connect more than one smartphone to it, so multiconnection works. When I hit "bond" on nRF Connect mobile app I get DC and message on puTTY terminal saying:
<error> app: Fatal error
<warning> app: System reset
My question is: what have I done wrong or what changes have to be done additionally? I don't know whether the problem is with the peer manager or the flash data storage.
thanks,
Pawel