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

pc-ble-driver sd_ble_gap_sec_params_reply got error 0x10 NRF_ERROR_INVALID_ADDR

Just continue my work on implementing LESC MITM on hear_rate_collector (Please check my development environment settings here as well).

Since sd_api_v6 on pc-ble-driver doesn't work with sd_ble_gap_authenticate on PCA10059. I switched to sd_api_v3.

Then sd_ble_gap_authenticate returns OK.

Then I added sd_ble_gap_sec_params_reply as such:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/examples/heart_rate_collector/main.c b/examples/heart_rate_collector/main.c
index 3ee6c9c..8aa379a 100644
--- a/examples/heart_rate_collector/main.c
+++ b/examples/heart_rate_collector/main.c
@@ -104,6 +104,15 @@ enum
#define STRING_BUFFER_SIZE 50
+#define SEC_PARAM_BOND 1 /**< Perform bonding. */
+#define SEC_PARAM_MITM 1 /**< Man In The Middle protection not required. */
+#define SEC_PARAM_LESC 1 /**< LE Secure Connections enabled. */
+#define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */
+#define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY /**< No I/O capabilities. */
+#define SEC_PARAM_OOB 0 /**< Out Of Band data not available. */
+#define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */
+#define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */
+
typedef struct
{
uint8_t * p_data; /**< Pointer to data. */
@@ -166,6 +175,21 @@ static const ble_gap_conn_params_t m_connection_param =
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Then I got error 16 which is NRF_ERROR_INVALID_ADDR:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
$ ./heart_rate_collector_v3 /dev/ttyACM0
Serial port used: /dev/ttyACM0
Baud rate used: 1000000
Info: Successfully opened /dev/ttyACM0. Baud rate: 1000000. Flow control: none. Parity: none.
Status: 6, message: Target Reset performed
Status: 7, message: Connection active
Scan started
Received advertisement report with device address: 0xF69EF1EC5743
Connection established
sd_ble_gap_authenticate succeeded
BLE_GAP_EVT_SEC_PARAMS_REQUEST received: Security parameters reply failed, err_code 0x0010
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I also tried PCA10040 with sd_api_v3 connectivity firmware but got the same error.

BR/Chencheng

  • Hi, I am interested to know how your SDH can send out sec params reply successfully to peripheral.

    My SDH is simply rejecting with 0x10.

    Anyhow my implementation is 2450.Secure-HRSC_v6_master.patch.

    And I will try the link you provided. I will get back to you with updates.

  • Hi again,

    By looking at the LESC example you provided, I realized that I have not specifically allocated memory for s_sec_keyset.keys_peer.p_pk.

    Now I fix the problem.

    Thanks for you information!

    Best regards,

    Chencheng

1 2 3 4