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

Concurrent connections ble_app_hrs issue

Arm Gcc (using Eclipse Neon) | SDK 13.0 | nrf52 DK (PCA10040) | tried soft device 4.0.2 and 4.0.4

I can successfully compile and run the example -ble peripheral- ble_app_hrs. Everything works as it should including bonding.

I want to add concurrent connections (nrf is peripheral - nrf has no central). I am referencing the experimental multiperipheral example (which works and compiles fine on its own - just no bonding or peer manager). When I change the following lines in the ble_app_hrs example, I get error 4 on softdevice_enable.

Under // Configure the maximum number of connections , I change the default to:

ble_cfg.gap_cfg.role_count_cfg.periph_role_count  = 2;

I think error 4 means a memory error. So I put some breakpoints in softdevice_handler.c where it throws error 4 and get the correct memory origin (original was 0x20002558, it now says it should be 0x20002c98. I change the linker to have the origin as 0x20002c98 instead of 0x20002558. I clean the project and erase the chip and recompile and flash and the program does not start. When I go to debug, I get an 0x0 error window open in the debugger and the program never starts.

What am I missing? Any help would be appreciated! Bryan

Parents
  • FormerMember
    0 FormerMember

    When changing the memory settings, do you change the size as well, not only the start address?

    To add support for multiple peripheral links, both the softdevice and the application will have to be set to handle it. It means that:

    • the softdevice has to be configured to support multiple links, like you already do.
    • the application will have to handle multiple connections. For how to make the application handle multiple connections, I would recommend you to have a look at the (experimental_)ble_app_multiperipheral example in the SDK. I would think the easiest is to add the HRS functionality to the multiperipheral_example. This answer explains the steps for adding the UART service to the multilink example (central), however, the steps will be the same for in the "peripheral" case.
  • When I am accessing the breakpoints in the sofdevice_handler.c to determine the RAM start, I also look at the line that says" RAM size should be adjusted to ...". In my case, it recommended the size not change by just changing the ble_cfg.gap_cfg.role_count_cfg.periph_role_count to 2 from 1. Not sure how to proceed from there.

    I understand that I will need to add the application handling of multiple connections. I plan to add that from the multiperipheral example but I can't get past the memory issue to even set the application changes up. I would assume the program would still boot and act as normal with a single connection.

    Please try just changing this one line in the example (change ble_cfg.gap_cfg.role_count_cfg.periph_role_count value to 2) and see if it give you the same results. I am puzzled at this point. I am using the 10040 DK.

    Thanks for your help!

Reply
  • When I am accessing the breakpoints in the sofdevice_handler.c to determine the RAM start, I also look at the line that says" RAM size should be adjusted to ...". In my case, it recommended the size not change by just changing the ble_cfg.gap_cfg.role_count_cfg.periph_role_count to 2 from 1. Not sure how to proceed from there.

    I understand that I will need to add the application handling of multiple connections. I plan to add that from the multiperipheral example but I can't get past the memory issue to even set the application changes up. I would assume the program would still boot and act as normal with a single connection.

    Please try just changing this one line in the example (change ble_cfg.gap_cfg.role_count_cfg.periph_role_count value to 2) and see if it give you the same results. I am puzzled at this point. I am using the 10040 DK.

    Thanks for your help!

Children
No Data
Related