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
  • I have this config:

    #define NRF_LOG_ENABLED 1

    and 

    #define NRF_LOG_BACKEND_RTT_ENABLED 1

    I'm looking in the window called "Debug Terminal" in the image below.

    I've also started the RTT viewer, and although it seems to get a connection, there is no output from the various printouts like the ones in main.c:

    printf("\r\nUART started.\r\n");
    NRF_LOG_INFO("Debug logging for UART over RTT started.");

    I find this very confusing. Where is the printf and NRF_LOG_INFO supposed to end up, and why are both used??

    Oh, hang on... if I put a breakpoint before the NRF_LOG_INFO statement and wait a few seconds before continuing execution, the RTT viewer actually prints. So it needs some time to start up then. Problem solved!

    I have seen the RAM and FLASH guide. What I did was to take the value from p_app_ram_start, when in fact I should have taken the value from *p_app_ram_start, i.e. the value it's pointing to. Once I realized that, it seems to be working! Yeah!

    Thanks for the speedy help.

Reply
  • I have this config:

    #define NRF_LOG_ENABLED 1

    and 

    #define NRF_LOG_BACKEND_RTT_ENABLED 1

    I'm looking in the window called "Debug Terminal" in the image below.

    I've also started the RTT viewer, and although it seems to get a connection, there is no output from the various printouts like the ones in main.c:

    printf("\r\nUART started.\r\n");
    NRF_LOG_INFO("Debug logging for UART over RTT started.");

    I find this very confusing. Where is the printf and NRF_LOG_INFO supposed to end up, and why are both used??

    Oh, hang on... if I put a breakpoint before the NRF_LOG_INFO statement and wait a few seconds before continuing execution, the RTT viewer actually prints. So it needs some time to start up then. Problem solved!

    I have seen the RAM and FLASH guide. What I did was to take the value from p_app_ram_start, when in fact I should have taken the value from *p_app_ram_start, i.e. the value it's pointing to. Once I realized that, it seems to be working! Yeah!

    Thanks for the speedy help.

Children
No Data
Related