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.

CC2541: Link Layer error on CC2541F256TRHaRQ1

Part Number: CC2541

Hi, I am Tomás

I have  a question about BLE stack 4.2 for CC2541F256T

Using this microcontroller as peripehal and central appears a error (0x13) in Link Layer on Central side.

The peripheral is a node which goes to sleep periodically and notificates temperature and timestamp.

This error notification is resolved as "Remote User Terminated Connection".

Could be this error appear due to time breach from peripheral?

 

My question is:

it is possible to force this error in the application layer? or does is controller by TI stack api?

It is to ensure that the problem is generated by the low-level stack and nothing described in the application could have forced this error by any user function.

In case of that, does it report any information about this fail? (Application Note..).

 Thanks for your time, Tomás. 

 

  • Hi Tomás,

    An Error Code of 0x13 indicates that the Remote User (peripheral device since error appears on central) Terminated the Connection. Had the connection timed out, you should have seen an Error Code of 0x08. For more information regarding HCI Error Codes, please see the Bluetooth Core Specification, V4.0.0, Vol. 2, Part D.

    This indicates that the peripheral caused this error, most likely in the application layer, by terminating the connection. The GAP API that would likely be responsible for this is GAPRole_TerminateConnection. This API may also be called due to a bad GAPRole_SendUpdateParam call, where handleFailure is set to GAPROLE_TERMINATE_LINK. I would double-check your application for these functions and what might cause them to occur; further debug could be performed by using a sniffer to search for bad param updates.

    For more information for GAP Role APIs, please see the SDK's BLE Software Developer's Guide, Chapter B. Peripheral GAP role API definitions can be found in Projects\ble\Profiles\Roles\CC254x\peripheral.c

    Best,
    Joe

  • Hi, Joseph thanks a lot for your information. I sent you a private msg.

    This makes sense, but I would like to know how the central controller is able to realise that the peripheral has been disconnected.
    Would it be possible to misuse these functions that you mention in the central controller and produce the same effect, or in this case the message 0x13 should be given by the peripheral.

    I'm doing a low level frame sniffing, that's why I saw this message in the link layer.

    I understand that it can be produced by:
    a) the application layer itself by forcing the GAPRole_TerminateConnection function, I understand that this function should not be called arbitrarily.
    b) during the call to GAPRole_SendUpdateParam some parameter is not correct.
    although looking at the frames it seems that in general this process performs it correctly.

    kind regards, TC

  • Hi Tomás,

    The central device is reporting an error code of 0x13 because the peripheral sent a connection termination packet. You are correct that options a) and b) (on the peripheral device) would be what would typically cause this termination.

    I just sent you an update over email, so I will go ahead and close the thread. If you have any follow ups that need to be handled outside of email, we can reopen this thread then.

    Best,
    Joe