Scanner doesn't work on NRF52832/SDK 14

Hi,

We have custom board with STM32F407 as an application chip and BL652-SC-01 as a connectivity chip. When we worked on SDK 13 and softdevice 4.0.2 or 4.0.4 we had problem with connection mentioned here but didn't have any problems with concurrent scanner/peripheral modes operation. Trying to migrate code from SDK 13 to SDK 14 we faced the problem: the connectivity chip works improperly until we disable scanner mode.

During debugging the function sd_ble_gap_scan_start(&m_scan_params) we receive success but after that there are no events from connectivity chip. We watched UART RX line of the application chip and didn't see any activity on it. Here's scanner init structure:

#define SCAN_INTERVAL                   0x00A0 
#define SCAN_WINDOW                     0x0050
#define SCAN_TIMEOUT                    0

static ble_gap_scan_params_t const m_scan_params = {
  active : 1,
  use_whitelist : 0,
  adv_dir_report : 0,
  interval : SCAN_INTERVAL,
  window : SCAN_WINDOW,
  timeout : SCAN_TIMEOUT
};

There is one note: scanner doesn't work even if we don't start advertising. On the other hand, If scanner is enabled, advertising works but we are not able to connect to the device. The same issue is reproduced on NRF52 DK if we connect it to our custom board using 4 UART wires.

Regarding NRF_SDH_BLE_PERIPHERAL_LINK_COUNT and NRF_SDH_BLE_TOTAL_LINK_COUNT - we tried to increase those values but it didn't help. Here's the values we tried so far:

#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1
#define NRF_SDH_BLE_TOTAL_LINK_COUNT 2

Update #1

I've attached project which includes SDK files and BLE logic. Readme.txt file describes all changed that were applied to launch serialization.

project_periph_central.zip

  • Strange. Do you have a project that reproduces this behavior that you can share with me?

  • Hi Petter,

    I've attached the project files to my initial message under Update #1 title.

  • So if you haven't called sd_ble_gap_scan_start() everything is fine, advertising is working, and connection is established?

    And if sd_ble_gap_scan_start() is called you don't get any events on the application chip? Or you don't get any BLE_GAP_EVT_ADV_REPORT events? But advertising still works? But you are not able to connect? What happens if you try to connect?

    I think I would try to do some more debugging on the connectivity firmware, have you checked that you don't get an error somewhere? Have you tried to set a breakpoint inside app_error_handler()?

  • "So if you haven't called sd_ble_gap_scan_start() everything is fine, advertising is working, and connection is established?" - right.

    "And if sd_ble_gap_scan_start() is called you don't get any events on the application chip? Or you don't get any BLE_GAP_EVT_ADV_REPORT events? But advertising still works? But you are not able to connect? What happens if you try to connect?" - 1) If we work in runtime (don't stop running in the debugger), we don't get any errors but don't get any events from connectivity chip either. If we try to connect using nRF Connect, app is stuck showing "Discovering services". 2) If we step through commands sd_ble_gap_scan_start() and ble_advertising_start() consequentially in debugger the application hangs on ser_sd_rsp_wait() func ser_softdevice_handler.c file when we start advertising.

  • "I think I would try to do some more debugging on the connectivity firmware, have you checked that you don't get an error somewhere? Have you tried to set a breakpoint inside app_error_handler()?" - during initialization we don't get any errors. We have breakpoint in app_error_fault_handler func if debugging is active:

    void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info) { if (CoreDebug->DHCSR & 1) { __BKPT (0); } }

    So if there were some errors we would see them in the debugger.