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

SDK 14 - adding concurrent connections to HRS peripheral example

This is to build upon a previous question i had here.

This time, I am having issues with SDK 14. I can compile and run the BLE peripheral HRS example fine. With SDK 14, you can simply change the sdk_config file to add more concurrent peripheral connections (I do understand there is more to the code than this to get this working properly). My problem is when I change the following items

NRF_SDH_BLE_PERIPHERAL_LINK_COUNT

NRF_SDH_BLE_TOTAL_LINK_COUNT

in sdk_config to 3 (both were 1 to start), I get memory issues when starting the soft device.

I set break points in nrf_sdh_ble.c after it checks where the ram starts (NRF_LOG_WARNING that says RAM start should be adjusted to...) and I am getting different numbers than what are in the linker file. For example: The working example with nothing changed has linker file as:

MEMORY { FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x61000
RAM (rwx) : ORIGIN = 0x20002558, LENGTH = 0xdaa8 }

In nrf_sdh_ble.c - app_ram_start says it is 0x20002a58. Origin in the ld file is 0x20002a58. *p_app_ram_start in nrf_sdh_ble.c (this is what the "Ram should be adjusted to") says it should be 0x2000ffd4.

When I change the link counts to 3, and re-compile, it gives me error 4 but app_ram_start and *p_app_ram_start are the same.

What is the proper way to set the ld file settings (both ORIGIN and LENGTH) in SDK 14 with the new softdevice handler using GCC (and Eclipse)? I had no problem onc Kristin helped me in SDK 13 - I can't figure it out in SDK 14.

  • Hi,

    The working example with nothing changed has linker file as: MEMORY { FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x61000 RAM (rwx) : ORIGIN = 0x20002558, LENGTH = 0xdaa8 }

    I'm not seeing these numbers. For ble_app_hrs example the default settings in SDK 14 are

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x23000, LENGTH = 0x5d000
      RAM (rwx) :  ORIGIN = 0x20002a58, LENGTH = 0xd5a8
    }
    

    When I change the NRF_SDH_BLE_PERIPHERAL_LINK_COUNT and NRF_SDH_BLE_TOTAL_LINK_COUNT to 3, i got this output from the logger :

    <warning> nrf_sdh_ble: RAM start should be adjusted to 0x20004C18.
    <warning> nrf_sdh_ble: RAM size should be adjusted to 0xB3E8.
    

    After applying these changes, i.e. RAM (rwx) : ORIGIN = 0x20004C18, LENGTH = 0xB3E8, everything worked fine here.

  • I had a typo when putting in the numbers for ble_app_hrs example the default settings in SDK 14. Mine were the same as yours (it was 0x20002a58 NOT 0x20002558).

    I still could not get NRF_LOG to show the numbers you did after changing the link counts, so I decided to re-install the SDK again and now it is working properly. Thank you for your help!

Related