Hello,
Using two nrf52 Dev Kit boards for Central / Peripheral.
Using Softdevice S132, , peer manager and Segger on Win7.
I have modified ble_uart_and ble_uart_c using ble_app_hrs and ble_app_hrs_c.
My program works, but will normally not bond when I use SEC_OPEN in the nus_service.
Now to the strange part: If I run ble_app_hrs and using ble_app_hrs_c first , and then run ble_uart_and ble_uart_c (on the same respective boards) my program bonds.
I can then even set SEC_JUST_WORKS in the nus service. The following is part of my Debug transcript:
and my peer manager event handler then shows the following Log Info (that I have added):
<info> app: NRF_BLE_SCAN_EVT_WHITELIST_ADV_REPORT
<info> app: NRF_BLE_SCAN_EVT_CONNECTED
<info> app: ----> pm_evt_handler called
<info> app: Connected to a previously bonded device.
<info> app: ----> pm_evt_handler called
<info> app: --> Connection Count = 1
<info> app: ----> pm_evt_handler called
<info> app: ----> pm_evt_handler called
<info> app: ----> pm_evt_handler called
<info> app: Data length for connection 0x0 updated to 251.
<info> app: GATT ATT MTU on connection 0x0 changed to 247.
<info> app: Ble NUS max data length set to 0xF4(244)
<info> app: ----> pm_evt_handler called
<info> app: Connection secured: role: 2, conn_handle: 0x0, procedure: 0.
<info> app: Data length for connection 0x0 updated to 251.
<info> app: ---> Discovery complete:
<info> app: Connected to device with Nordic UART Service.
<info> app: Number of Bounded Peers = 1
<info> app: data_len = 8
<info> app: Received Peripheral Temperature: 23.34 C
<info> app: Received Peripheral Humidity: 38.76 %
I have copied sdk_config.h from ble_app_hrs and ble_app_hrs_c into ble_uart_and ble_uart_c to make sure no settings are different there.
I have also copied all project settings from ble_app_hrs and ble_app_hrs_c to ble_uart_and ble_uart_c including the common>> preprocessor settings.
However, if i erase the ram of both dev boards, and run again, the program runs, but with no security or bonding!
Please help, I have used several days to figure this out but are completely lost now...