BLE Bug

Hi,

I have two Nano 33 BLE Sense, one as central and one peripheral. After central disconnects the peripheral, initiates scan, and connect, discoverService() always fail.

However, the BLE scanner on my phone is still able to connect and read values, so clearly the problem is in the central/Arduino.

Attached are the sketches.

Also, if central goes down while connected, peripheral hangs. BLECharacteristic.writeValue never turns from function call.

Lastly, if peripheral goes down while connected, central still thinks it's connected, so it's stuck in the infinite loop. If a timeout is implemented, and if central disconnected, the next time it connects, central no longer can discoverService.

Below is the debug output for the central.

I think there are bugs in Arduino BLE, not in my code. Any ideas? I've exhausted everything.

HCI COMMAND TX -> 010C20020001
HCI EVENT RX <- 040E04010C2000
HCI COMMAND TX -> 010B200701100010000000
HCI EVENT RX <- 040E04010B2000
HCI COMMAND TX -> 010C20020100
HCI EVENT RX <- 040E04010C2000
HCI EVENT RX <- 043E2102010000C48744B8B9E115020106110655554444333322221111CDAB78563412C0
HCI EVENT RX <- 043E0C02010400C48744B8B9E100C0
Found e1:b9:b8:44:87:c4
12345678-abcd-1111-2222-333344445555
HCI COMMAND TX -> 010C20020000
HCI EVENT RX <- 040E04010C2000
Connecting ...HCI COMMAND TX -> 010D2019600030000000C48744B8B9E10006000C000000C80004000600
HCI EVENT RX <- 040F0400010D20
connected.
Discovering service ...HCI ACLDATA TX -> 02000007000300040002F700
HCI EVENT RX <- 0413050100000100
HCI EVENT RX <- 043E13010001000000C48744B8B9E108000000C80007
failed!
HCI COMMAND TX -> 01060403000013
HCI EVENT RX <- 040F0400010604
HCI COMMAND TX -> 010C20020001
HCI EVENT RX <- 040E04010C2000
HCI COMMAND TX -> 010B200701100010000000
HCI EVENT RX <- 040E04010B2000
HCI COMMAND TX -> 010C20020100
HCI EVENT RX <- 040E04010C2000
HCI EVENT RX <- 043E1A020100011767BBEFB8670E02011A0AFF4C0010051318653F97B0
HCI EVENT RX <- 043E0C020104011767BBEFB86700B0
HCI EVENT RX <- 043E1A020100013AA2108A9D450E02011A0AFF4C001005071CED648BC1
HCI EVENT RX <- 043E0C020104013AA2108A9D4500C1

buggy_central.ino (2.06 KB)

buggy_peripheral.ino (1.47 KB)