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

Error in pc ble driver example code

I am trying to connect my Ubuntu machine with my nrf52 custom board
my setup is as follows,
Ubuntu machine --> FTDI USB2UART --> HCI interface of nrf52
I can see on my logic analyzer that Ubuntu machine sends packets over UART but nrf52 doesn't send response and example code fails with error 0x0D.
What I did next is I tried compiling from SDK source according to installation steps, I had to lower the optimization level from my Keil so that it could work, and I finally can get a response from nrf52 and I can see on my logic analyzer.

Now my first question is how can I connect the reset signal if I am not using Jlink and I am instead using USB2UART or connecting the device to a raspberry pi.

My second problem is the Heart Rate Monitor example is still failing but with another error
```
Serial port used: /dev/ttyUSB0
Baud rate used: 1000000
Info: Successfully opened /dev/ttyUSB0. Baud rate: 1000000. Flow control: none. Parity: none.

Status: 6, message: Target Reset performed
Status: 7, message: Connection active
Status: 4, message: Error sending packet to target. Code #13
sd_ble_cfg_set() failed when attempting to set BLE_GAP_CFG_ROLE_COUNT. Error code: 0x03
Status: 4, message: Error sending packet to target. Code #13
Failed to set advertisement data. Error code: 0x03

```
and here is a detailed debug info
```
Serial port used: /dev/ttyUSB0
Baud rate used: 1000000
Info: Successfully opened /dev/ttyUSB0. Baud rate: 1000000. Flow control: none. Parity: none.

Debug: State change: STATE_START -> STATE_RESET

Debug: 1 -> []
type: RESERVED_5 reliable: no seq#:0 ack#:0 payload_length:0 data_integrity:0 err_code:0
Status: 6, message: Target Reset performed
Debug: State change: STATE_RESET -> STATE_UNINITIALIZED

Debug: 2 -> [01 7e ]
type: LINK_CONTROL_PACKET reliable: no seq#:0 ack#:0 payload_length:2 data_integrity:0 err_code:0
[SYNC]
Debug: 1/ 0 <- [02 7d ]
type: LINK_CONTROL_PACKET reliable: no seq#:0 ack#:0 payload_length:2 data_integrity:0 err_code:0
[SYNC_RESP]
Debug: State change: STATE_UNINITIALIZED -> STATE_INITIALIZED

Debug: 3 -> [03 fc 11 ]
type: LINK_CONTROL_PACKET reliable: no seq#:0 ack#:0 payload_length:3 data_integrity:0 err_code:0
[CONFIG [ sliding-window-size:1 out-of-frame:0 data-integrity-check-type:1 version-number:0 ]]
Debug: 2/ 0 <- [01 7e ]
type: LINK_CONTROL_PACKET reliable: no seq#:0 ack#:0 payload_length:2 data_integrity:0 err_code:0
[SYNC]
Debug: 4 -> [02 7d ]
type: LINK_CONTROL_PACKET reliable: no seq#:0 ack#:0 payload_length:2 data_integrity:0 err_code:0
[SYNC_RESP]
Debug: 5 -> [03 fc 11 ]
type: LINK_CONTROL_PACKET reliable: no seq#:0 ack#:0 payload_length:3 data_integrity:0 err_code:0
[CONFIG [ sliding-window-size:1 out-of-frame:0 data-integrity-check-type:1 version-number:0 ]]
Debug: 3/ 0 <- [04 7b 11 ]
type: LINK_CONTROL_PACKET reliable: no seq#:0 ack#:0 payload_length:3 data_integrity:0 err_code:0
[CONFIG_RESP [ sliding-window-size:1 out-of-frame:0 data-integrity-check-type:1 version-number:0 ]]
Debug: State change: STATE_INITIALIZED -> STATE_ACTIVE

Status: 7, message: Connection active
Debug: 6 -> [00 69 40 00 00 00 01 01 01 01 ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:0 payload_length:a data_integrity:1 header_checksum:92 err_code:0
Debug: 7 -> [00 69 40 00 00 00 01 01 01 01 ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:0 payload_length:a data_integrity:1 header_checksum:92 err_code:0
Debug: 8 -> [00 69 40 00 00 00 01 01 01 01 ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:0 payload_length:a data_integrity:1 header_checksum:92 err_code:0
Debug: 4/ 0 <- [03 fc 11 ]
type: LINK_CONTROL_PACKET reliable: no seq#:0 ack#:0 payload_length:3 data_integrity:0 err_code:0
[CONFIG [ sliding-window-size:1 out-of-frame:0 data-integrity-check-type:1 version-number:0 ]]
Debug: 9 -> [04 7b 11 ]
type: LINK_CONTROL_PACKET reliable: no seq#:0 ack#:0 payload_length:3 data_integrity:0 err_code:0
[CONFIG_RESP [ sliding-window-size:1 out-of-frame:0 data-integrity-check-type:1 version-number:0 ]]
Debug: 10 -> [00 69 40 00 00 00 01 01 01 01 ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:0 payload_length:a data_integrity:1 header_checksum:92 err_code:0
Debug: 11 -> [00 69 40 00 00 00 01 01 01 01 ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:0 payload_length:a data_integrity:1 header_checksum:92 err_code:0
Debug: 12 -> [00 69 40 00 00 00 01 01 01 01 ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:0 payload_length:a data_integrity:1 header_checksum:92 err_code:0
Status: 4, message: Error sending packet to target. Code #13
sd_ble_cfg_set() failed when attempting to set BLE_GAP_CFG_ROLE_COUNT. Error code: 0x03
Debug: 13 -> [00 60 ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:0 payload_length:2 data_integrity:1 header_checksum:12 err_code:0
Debug: 5/ 0 <- []
type: ACK reliable: no seq#:0 ack#:1 payload_length:0 data_integrity:0 err_code:0
Debug: 6/ 0 <- [01 60 00 00 00 00 ]
type: VENDOR_SPECIFIC reliable:yes seq#:0 ack#:1 payload_length:6 data_integrity:1 header_checksum:ca err_code:0
Debug: 14 -> []
type: ACK reliable: no seq#:0 ack#:1 payload_length:0 data_integrity:0 err_code:0
Debug: 15 -> [00 72 10 01 0b 09 4e 6f 72 64 69 63 5f 48 52 4d 03 03 0d 18 00 00 ]
type: VENDOR_SPECIFIC reliable:yes seq#:1 ack#:1 payload_length:16 data_integrity:1 header_checksum:c8 err_code:0
Debug: 16 -> [00 72 10 01 0b 09 4e 6f 72 64 69 63 5f 48 52 4d 03 03 0d 18 00 00 ]
type: VENDOR_SPECIFIC reliable:yes seq#:1 ack#:1 payload_length:16 data_integrity:1 header_checksum:c8 err_code:0
Debug: 17 -> [00 72 10 01 0b 09 4e 6f 72 64 69 63 5f 48 52 4d 03 03 0d 18 00 00 ]
type: VENDOR_SPECIFIC reliable:yes seq#:1 ack#:1 payload_length:16 data_integrity:1 header_checksum:c8 err_code:0
Debug: 18 -> [00 72 10 01 0b 09 4e 6f 72 64 69 63 5f 48 52 4d 03 03 0d 18 00 00 ]
type: VENDOR_SPECIFIC reliable:yes seq#:1 ack#:1 payload_length:16 data_integrity:1 header_checksum:c8 err_code:0
Debug: 19 -> [00 72 10 01 0b 09 4e 6f 72 64 69 63 5f 48 52 4d 03 03 0d 18 00 00 ]
type: VENDOR_SPECIFIC reliable:yes seq#:1 ack#:1 payload_length:16 data_integrity:1 header_checksum:c8 err_code:0
Debug: 20 -> [00 72 10 01 0b 09 4e 6f 72 64 69 63 5f 48 52 4d 03 03 0d 18 00 00 ]
type: VENDOR_SPECIFIC reliable:yes seq#:1 ack#:1 payload_length:16 data_integrity:1 header_checksum:c8 err_code:0
Status: 4, message: Error sending packet to target. Code #13

```

Related