Pairing failed, security failed when using central uart example, additionally I cannot see data on the central side sent by peripheral

Hello,

I am trying to established a Bluetooth communication between nrf52840dk and Fanstel BLG840F. nrf52840dk acts as peripheral device and Fanstel BLG840F acts as central device. 

For peripheral device, I am using ble_peripheral -> ble_app_uart example from nRF5_SDK_17.

For central device, I am using bluetooth -> central_uart example from nRF SDK Connect. 

I am sending some dummy data from peripheral to central. But, I am stuck on pairing which is constantly failing if I use security. I get below error.

And if I remove the below security, the I can see the peripheral device led stops blinking. And, on central side terminal window, I can verify it getting disconnected but, I didn't receive any data on central side. I am guessing this is because ble_data_received() is not getting executed (as I have given a print statement which is not printed on the central terminal). 

Fullscreen
1
2
3
4
5
6
err = bt_conn_set_security(conn, BT_SECURITY_L1);
if (err) {
LOG_WRN("Failed to set security: %d", err);
gatt_discover(conn);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The code for central device:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
* Copyright (c) 2018 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
/** @file
* @brief Nordic UART Service Client sample
*/
#include <errno.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/printk.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The code for peripheral device:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* Copyright (c) 2014 - 2021, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


I would greatly appreciate help from the community or Nordic's staff.