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.

CC2640R2F-Q1: Question about SDK 5.30 and issue EXT_EP-10291 Crypto driver causes connection termination

Part Number: CC2640R2F-Q1
Other Parts Discussed in Thread: CC2640, LAUNCHXL-CC2640R2

Hello,

in the release notes for SimpleLink CC2640R2 SDK 5.30.00.03 the issue https://sir.ext.ti.com/jira/browse/EXT_EP-10291 is listed as fixied.

But in the issue description itself only the devices CC26X2R1 and SimpleLink CC13x2-26x2 SDK BLE5 Stack are listed as affected.

My questions are:

  1. Is this bug realy fixied in the SimpleLink CC2640R2 SDK 5.30.00.03?
  2. In the source code of the crypto driver I see changes in lines around 890-895. Is this change the fix for the issue? Or is it located in an other file in SDK?

The background of my questions is that we are facing exactly this failure behaviour with connection termination. We are using crypto driver for encryption/decryption in the application.

Thank you.

Best regards

Andreas

  • Hi Andreas,

    I will ask internally and get back to you.

    Best,

    Nate

  • Hello Nathan,

    thank you. I found the ticket with the same issue related to CC2640 devices sir.ext.ti.com/.../EXT_EP-10616. So the link to the issue in the release notes of the BLE Stack seems to be wrong (software-dl.ti.com/.../release_notes_ble3stack_3_03_08_00.html).

    Anyway I tested our application (based on multi_role example from SDK 1.50, later updated to SDK 3.40) with the new SDK 5.30 and have still the same problem:

    We are using encrypted link. We use crypto driver to encrypt/decrypt our data additionaly. The more often I send messages, the more is the possibility that connection will be dropped due to MIC error. E.g. if sending messages every 200 ms the error occurs after less then 1 minute. With 1 second as sending interval it can run for much longer time (5, 10, 30 minutes).
    If I remove calling the function CryptoCC26XX_transact() and echos received messages back to the client (smartphone), it runs for ours without an error.

    BR,

    Andreas

  • Hi Andreas,

    Thank you for the additional details. I will report this bug to the Software R & D staff to see if we can try to replicate it. The internal notes I see seem to indicate they tested this on the 5.30 stack, but maybe there is a difference between their setup and yours? What hardware are you running on? And can you replicate this with very few modifications to the multi_role example?

    Best,

    Nate

  • Hi Nate,

    What hardware are you running on?

    It is a custom board. But the error occurs also on LAUNCHXL-CC2640R2.

    And can you replicate this with very few modifications to the multi_role example?

    I can try to do it, but I'm not sure if it is done with few changes, the application became larger and differs a lot from basic example.

    Can you say me where is the fix placed in the SDK code?

    BR,

    Andreas

  • Hi Andreas,

    The fix is in source/ti/blestack/controller/cc26xx_r2/ll/ll.enc.

    Best,

    Nate

  • Hi Nate,

    thanks.

    It looks like the folder source/ti/blestack/controller/cc26xx_r2/ll is not part of the oficial release? I see only the inc folder there.

    BR,

    Andreas

  • Hi Andreas,

    I believe this is a file that is built into ROM, so you may not be able to view it.

    Best,

    Nate

  • HI Nate,

    That was my thought too.

    BR,

    Andreas

  • Hi Nate,

    I can cause link termination due to timeout (0x08) or MIC error (0x3D) by stress of the crypto module. Combination of often calling transaction function, an encrypted link and fast sending data over GATT leads to link termination with an error (timeout in apprx. 90% and MIC error in 10% cases).

    Tested with modified multi_role example from SDK 5.30

    As client I used LightBlue application on Android, subscribing to Characteristic 4 from Simple Gatt Profile.

    I wanted to attach the modified file multi_role.c from multi role example, but couldn't find a possibility to do it.

    BR

    Andreas

  • Hi Andreas,

    You should be able to drop the file in through the chat box. I'm using chrome and I can attach files this way. If you drop the code in with detailed comments explaining it I'll take a look.

    Best,

    Nate

  • Hi Nate,

    thank you for the info, it works for me too. multi_role.c is attached.

    Test HW is launchxl board.

    BR,

    Andreas

    8228.multi_role.c

  • Hi Andreas,

    Thank you for the file. I see that you're calling the crypto drivers in multi_role_performPeriodicTask. Can you be more specific about your failure case though? I don't completely understand what you're asking for here.

    I can cause link termination due to timeout (0x08) or MIC error (0x3D) by stress of the crypto module. Combination of often calling transaction function, an encrypted link and fast sending data over GATT leads to link termination with an error (timeout in apprx. 90% and MIC error in 10% cases).

    Best,

    Nate

  • Hi Nate,

    yes I call transaction function periodically to simulate our use case (encryption/decryption of incoming and outgoing messages).

    The failure path is:
    1. Run multi_role application, that calls CryptoCC26XX_transact() periodically
    2. Establish secure connection from an application on smartphone (with passkey)
    3. Subscribe for notification for a characteristic (here characteristic 4 from simple profile) to produce traffic over radio
    4. After short time (few minutes or even faster) the link is terminated with reason 0x08 (Timeout) or 0x3D (MIC).

    If you comment out line with CryptoCC26XX_transact() then the link remains for very long time.

    BR,
    Andreas

  • Hi Andreas,

    Can you monitor your memory usage as the program runs? This behavior sounds like a potentially a memory leak to me. See this page for monitoring the heap (I know it's for CC26XX but it should be fine). You could also consider increasing the MAX_NUM_PDU if you think encrypting may be increasing the amount of data sent back and forth.

    Best,

    Nate

  • Hi Nate,

    I don't see any failures in the heap memory. I watched heap metrics previously many times . Changing MAX_NUM_PDU has no influence, the error occurs with the same possibility.

    BR

    Andreas