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.

LL_ENC_AES128_Encrypt Hangs while calling GAP_PasscodeUpdate

Other Parts Discussed in Thread: CC2541

Hello All,


I am facing a situation described in the following post

http://e2e.ti.com/support/wireless_connectivity/f/538/p/349177/1222776


In my case the situation is triggered when I try to pair the second time. Note that I do not disconnect before requesting for GAP Authentication again. This occurs on a cc2541 device running a modified version of SimpleBlePeripheral. HAL_AES= TRUE and HAL_AES_DMA=TRUE. I am not using UART in that project.

Before calling GAP_PasskeyUpdate, I use the Aes library calls to generate a passcode.

It works fine the first time. On second attempt (without terminating the link and re establishing) it hangs in LL_ENC_AES128_Encrypt call as shown in the call stack while debugging.

If I terminate the link. Establish the link again and try to authenticate. It again works for the first time.

I am using BTool with a FOB running HostTestRelease as the central device.

Also If I dont use Aes call before calling the GAP_PasscodeUpdate api, this scenario doesn't occur. So something in the Aes DMA calls triggers this issue.


I have run out of ideas. Any help would be appreciated.

regards

Ankit

  • Hi Ankit,

    Once your device is paired, the AES/DMA keeps being used to encrypt/decrypt the packets. Your call to the AES function might not have been made safely if it happened in the middle of the AES module's job requested by other part of the stack.

    Does the problem occur every time? Can you increase the connection interval and the slave latency to the maximum and see what happens?

    By the way, generally it is not recommended to access low level functions directly from the application.

    - Cetri
  • Hello Cetri,


    This happens everytime on the second attempt as mentioned in the earlier post.

    No I am not calling the low level functions. My application calls GAP_PasscodeUpdate which is eventually calls LL_ENC_AES128_Encrypt as shown in the call stack.

    regards

    Ankit

  • Hi Ankit,

    Please refer to this post: e2e.ti.com/.../409102

    - Cetri