This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

More issues porting simpleblecentral with multiple slaves to ble stack v2.1

Edit: Problem has been solved, the issue was MAX_NUM_BLE_CONNS was getting set to 3 on both the periph and central. Only the central should have this set to 3 while the periph should have it set to 1.

I have again run into a problem in my effort to port my simpleBLEcentral which connects to multiple simpleBLEperipherals (2). I have gotten both peripherals successfully connected and get the initial parameter updates. Following this I am having some problems:

first, when performing a connection update from the central, I get a "INSTANT PASSED" 0x28 error code from GAPCentralRole_UpdateLink()

second, when attempting to send a gatt request to the peripheral server via status = GATT_ReadCharValue(connHandle[ii], &req, selfEntity); I am getting a response of 0x16 (blePending) (and the request does not appear to be seen at the peripheral.

I tried flashing the peripherals back to the old V2.0 stack and the entire system functions as normal so I believe the problem lies on the peripheral side and not the central side. 

I see some notes on the forums about instant passed but nothing that really helps me out much, any ideas?

EDIT:  I did a test with the BLEstack v2.1 unmodified central and peripheral projects, it seems I am able to connect them to eachother and send data using the up button but if I press the 'right' button for connection update soon after connection I get disconnected with reason '40' (0x28 instant passed). So it seems this problem is special to 2.1

  • I have confirmed the bug does not appear with V2.0 of the BLEstack with the unmodified central/peripheral projects. Pressing the connupdate button repeatedly is successful everytime.

    I am now focusing on V2.1 unmodified central/periph projects, I connect the devices and then press the 'right' button for connupdate, wait a few seconds, press it again, wait a few seconds, press it again. On the third try it results in the devices disconnecting with the instant passed error code. I have the following pictures of the packet sniffer, first showing the packets when the conn update was successful, and secondly showing when the connupdate failed. As you can see, it appears to be caused by a Unexpected New Seq Number error which results in the repeated re-transmission of the connupdate packet until the provided instant has passed

    the first button press that successfully updated the connection parameters:

    The subsequent connection update that resulted in eventual disconnection(noted by advertising restarting):

    Also for reference, a working connection update from the V2.0 stack:

  • Another update, after testing my app that uses 2 slaves with one master and attempting to do a single gatt_readcharvalue from both c, the same 'Unexpected NESN' error occurs. The first read request after connection works successfully (always as far as I have seen) and the second one always results in the unexpected NESN which causes a continuous retransmission of the packets (see the end of the log).BLEstack21ReadReqFailure.psd

  • I found the issue and luckily its not a problem with the stack! Turns out that setting MAX_NUM_BLE_CONNS to 3 in the bleUserConfig file is fine for the central app but the peripheral also uses this same file and thus does not like this parameter being set to 3. The easy fix is setting MAX_NUM_BLE_CONNS as a preprocessor define separately in each project.
  • Thanks for letting us know! Good to hear that you resolved your problem!