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.

CCS/CC2640R2F: GAP_LINK_ESTABLISHED_EVENT status error 33 / 0x21 (bleUnexpectedRole?)

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Tool/software: Code Composer Studio

Hi,

An unit based on multi role kept giving this error `GAP_LINK_ESTABLISHED_EVENT` status error 33 / 0x21. It started on the callback following a `GAPRole_EstablishLink` on a BLE server that was not available, usually it returns the code `bleGAPConnNotAcceptable`, but this time it kept giving 0x21 and would not connect anymore when the BLE server was back and advertising. 

According to swru393d, error 0x21 means `bleUnexpectedRole`, could you please confirm as there's no mention of it in the stack? SDK 1.40.0.45

Please explain what is 0x21, how did it arrive there, how to avoid it, how to recover? Thank you.

Jerome

  • Hi Jerome,

    Are you using the out of box multi-role example or have you made changes to your code? Have you tried running your program with a newer version of the SDK?

    Is the "Original question" thread the locked thread you are referring to? If not, can you link the thread that was locked if it is relevant to this post?
  • Hi Jessica,

    We have made changes to the example, we have not ran the program with a newer version of the SDK as this would require substantial testing, for example you can look at unrelated thread e2e.ti.com/.../2286166 to see the kind of bugs we are finding in your SDK and locked while left unanswered.

    Again, the issue is that is generally doesn't give this error, so we don't know how to reproduce it, but it has been recorded and we would like to get down to the root cause.
    Please explain what is error 0x21, how did it arrive there, how to avoid it, how to recover? Thank you.
  • Hi Jerome,

    The SDK you are using is fairly old and there have been many bug fixes since it's release. I highly advise you to upgrade to SDK v2.30.00.28. Please see our Release Notes for more information.  I also would like to point out that swru393d is for CC2640, not CC2640R2 which it appears you are using. I recommend checking out the device specific CC2640R2 User's Guide instead. ( v2.30.00.28 User's Guide and v1.40.00.45 User's Guide)

    To explain this error, I will need more information from you to figure out why you are receiving it. Are you running TI's multi-role example when you experience it or your own example? What callback do you notice this error code and which function returns it? You mention "GAPRole_EstablishLink" but this function has no return code for 0x21.

  • Hi Jessica,

    Unfortunatelly the "SimpleLink CC2640R2 SDK 2.30.00.28 Release Notes" do not have the list of fixed bugs, please help us to locate it.

    The "device specific CC2640R2 User's Guide" does not have any information regarding this error code.

    The multi role example has been modified but is still calling GAPRole_EstablishLink() which generate the following callback:

    GAP_LINK_ESTABLISHED_EVENT with status error 0x21 

  • Hi Jerome,

    Sorry for the delay due to the holidays. A better link for the release notes specifically is:
    CC2640R2 BLE 4.2 release notes: dev.ti.com/.../release_notes_ble3stack_3_02_01_28.html
    CC2640R2 BLE 5 release notes: dev.ti.com/.../release_notes_ble5stack_1_01_03_28.html

    These are the release notes for the BLE stacks and they include a list of "Fixed Issues". If you look at release notes for all BLE stack versions between 1.40 and 2.30 you'll find the list gets quite extensive. We would definitely recommend migrating to the latest version if possible. The Migration guides included in the BLE user's guide will have detailed instructions for changes needed to port between versions.

    Regards,
    Katie Pier
  • I have now upgraded to the latest BLE 4.2 stack, unfortunately the RAM footprint has raised due to BLE_V42_FEATURES now having SECURE_CONNS_CFG enabled and cannot be disabled anymore, so our program doesn't fit in, is there a way to disable BLE_V42_FEATURES or SECURE_CONNS_CFG?
  • Hi Jerome,

    I think this post might be helpful: e2e.ti.com/.../2313042

    Regards,
    Katie
  • Hi Katie,
    Not sure if I understood properly to "stub out", I commented out the code in ECCROMCC26XX.c ECCROMCC26XX_Params_init() and ECCROMCC26XX_genDHKey() by returning '-1', but that saved only 30 bytes out of the the additional 1KB of RAM.
    NULLing those pointers in the eccDriverTable, or NULLing the eccDrvTbl from the driverTable doesn't seem to work either as this results in an instant crash.