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.

LAUNCHXL-CC26X2R1: CMDSTA_CONTEXT_ERR on any connection

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SYSCONFIG

Project: multi-role, heavily modified.
Sysconfig disabled.

Hello,

After upgrading our modified multi-role project from SDK 4.40 to SDK 5.20 we experience a CMDSTA_CONTEXT_ERR immediately after any connection establishment attempt, either peripheral or central. 

Sysconfig is disabled and the files were copied from multi-role SDK 5.20.

The main changes that stand out are radio overrides in 'ti_radio_config.c'

This is the only documentation I was able to find regarding CMDSTA_CONTEXT_ERR:

> An immediate or direct command was issued in a context where it is not supported.

Our source hasn't changed though. 

How could we locate the "direct command" responsible for the crash? 

Is there any comprehensive documentation in regards with CMDSTA_CONTEXT_ERR? 

Thank you.
Best regards,
Jerome

  • Hi Jerome,

    Can you pause execution of the program and look into the call stack to see where the error occurred? Sometimes this gives relevant information but not always. In the meantime, I'll refer your question to one of our experts.

    Best,

    Nate

  • Hi Jerome,

    To complete Nate's comments, make sure to leverage our debugging guide, this will help you to locate the error.

    Best regards,

  • As I'm sure you know already, CMDSTA_CONTEXT_ERR is a HCI_BLE_HARDWARE_ERROR_EVENT_CODE that comes from RF core via Hci Msg, thus there is no error nor exception or call stack to analyse... I confirmed this indeed using the techniques described in the linked debugging guide. 
    Which brings us back to my question, could you please share a
     comprehensive documentation in regards with CMDSTA_CONTEXT_ERR? 

  • Hi Jerome,

    So far I haven't managed to reproduce your issue. May I ask you if you are only using the BLEStack or if there are other Stacks enabled? In general, the ContextError status is expected and handled (often ignored) by the Stack or the Application.

    Have you looked into the CC13x2, CC26x2 SimpleLinkTm Wireless MCU Technical Reference Manual, especially section §25.3.2.2?In addition, you can review the radio commands in order to see when "ContextError"  is being returned. I guess it will give you more insights to analyze the issue.

    Best regards,

  • Sorry, this didn't solve my issue, I just clicked "solved" by mistake instead of the reply button, no way to undo??
    We only use the BLE5Stack. 

    So far I was unable to obtain the value from the register.

    I noticed something else: SDK 5.20 includes a new fix for my previous issue that was solved offline (BLE_AGAMA_2068, EXTSYNC-2951, https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/881823/ccs-cc2652r-missing-gap_link_terminated_event-and-wrong-linkdb-info )
    However, as above, we get CMDSTA_CONTEXT_ERR but *also* the connection fails and linkDB_NumActive equals to '1' when it should be '0', which is exactly the issue that was supposed to be fixed...

  • Hi,

    Sorry, this didn't solve my issue, I just clicked "solved" by mistake instead of the reply button, no way to undo??

    I will continue answering on this thread. If it get dropped at one point, please basically open a new one.

    So far I was unable to obtain the value from the register.

    Please try again reading the register contents after initialization of the radio. You could set a break-point in SimplePeripheral_init() function and  verify the status of the radio registers. If the issue is still there, then please open a new thread to discuss it.

    I noticed something else: SDK 5.20 includes a new fix for my previous issue

    It could be interesting to see if the status "CMDSTA_CONTEXT_ERR" get raised with SDK 5.10.

    the connection fails and linkDB_NumActive equals to '1' when it should be '0', which is exactly the issue that was supposed to be fixed...

    Could you verify with the out of the box project (or any project that does not raise the "CMDSTA_CONTEXT_ERR" issue) based on SDK 5.20 to see if you manage to reproduce this observation?

    Best regards,

  • Since last communication we have provided you with our modified multi-role project, it should be possible to flash this to the lauchpad and check directly in CCS any question you may still have. I hope this helps, let me know if, in order to solve this issue, there is any further question that you are unable to answer with what we provided so far. Thank you. 

  • Hi Jerome,

    I confirm I have received your code.
    However, I would recommend you to run the tests I have suggested earlier. This would speed-up the debugging process.

    Thank you for your comprehension.

    Best regards,