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

adding 'scan' to ble_app_uart example (cocurrent BLE central and peripheral)

Hi, all.

I'm using nrf52840, s140, pca10056

I also want to add a scanning instance to the ble_app_uart example.


So, refer to the example of ble_app_uart_c, I added functions db_discovery_init / nus_c_init / scan_init / scan_start.

I've modified and added various variables and settings,

I enabled NRF_SDH_BLE_CENTRAL_LINK_COUNT to 1 in sdk_config.h file.

This resulted in an error in the ble_stack_init,  err_code = nrf_sdh_ble_enable(&ram_start); which is 0x04 error.

What else should I set to add 'scanning' to the ble_uart peripheral example? What did I miss?

BR,

Lyrics

Parents Reply
  • Try settting the define DEBUG and debug your code. You should get some log output something similar to this:

    nrf_sdh_ble: RAM start should be adjusted to 0x20002968.

    nrf_sdh_ble: RAM size should be adjusted to 0xD698.

    nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM. app: Fatal

    (This is just an example, the adjusted values in your project might be different)

    How did you change it?

    You can change it in Segger Embedded Studio like this:

    1. On the left pane, Right-click on your project -> "Options..."

    2. Change from "Debug/Release" to "Common" in the upper-left drop-down box.

    3. Under "Code", click on "Linker" -> Click the "..." on the right of "Section Placement Macros".

    4. Increase RAM_START and change RAM_SIZE accordingly.

Children
Related