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

BLE Peripheral connected to multiple Central devices on nrf52840 DK and SDK V16.0.0 (revisited)

Hello.

I am running Segger studio 4.5 on Windows 10 and the ble_app_uart example project that works fine with one connected central device (i.e. iPhone with nRF Toolbox running UART).

Now I would like to have two such connections.

I found this exact question answered here:
https://devzone.nordicsemi.com/f/nordic-q-a/58710/ble-peripheral-nus-connected-to-multiple-central-devices-on-nrf52840-s140-and-sdk-v16-0-0/239409#239409 

And while that thread solved the problem that time, it does not work for me now...

I have changed RAM size and location as suggested, and BOTH link counts in sdk.config.h.
(Stopping at NRF_LOG_WARNING("Change the RAM start location... etc. and set the following in the project options:
RAM_START=0x2000002C
RAM_SIZE=0x3FFD4)

For some reason I get no output in the "Debug Terminal" window during debugging, even though I set this in config:
#define NRF_LOG_ENABLED 1
#define NRF_LOG_DEFAULT_LEVEL 4

However, the code crashes during ble_stack_init() in nrf_drv_clock.c::sd_state_evt_handler() when trying to do CRITICAL_REGION_EXIT.

I have also run the project that was kindly made available as a zip-file in the thread above, but it crashes at the exact same spot.

Any ideas what's going on?

Thanks,

Anders.

Parents
  • Thanks for you swift reply.

    This is what I already have, and no output:

    #define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0

    I assume you mean NRF_SDH_BLE_PERIPHERAL_LINK_COUNT?? ble_app_uart starts on 1 and I increased it to 2.

    I have:

    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 2

    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 2

    I don't know how much RAM the SoftDevice requires other than to set a breakpoint at:

    NRF_LOG_WARNING("Change the RAM start location... in nrf_sdh_ble_enable() and get the variable values which gives me:

    RAM_START=0x2000002C
    RAM_SIZE=0x3FFD4

    No complaint about the RAM size during execution after that...

Reply
  • Thanks for you swift reply.

    This is what I already have, and no output:

    #define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0

    I assume you mean NRF_SDH_BLE_PERIPHERAL_LINK_COUNT?? ble_app_uart starts on 1 and I increased it to 2.

    I have:

    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 2

    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 2

    I don't know how much RAM the SoftDevice requires other than to set a breakpoint at:

    NRF_LOG_WARNING("Change the RAM start location... in nrf_sdh_ble_enable() and get the variable values which gives me:

    RAM_START=0x2000002C
    RAM_SIZE=0x3FFD4

    No complaint about the RAM size during execution after that...

Children
No Data
Related