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: Multi Role Project Issue

Part Number: CC2640R2F
Other Parts Discussed in Thread: SYSBIOS

Hi Support,

my customer is facing two issues with Multi Role project with BLE stack v3 working with CC2640R2F.

A.

They want to use just peripheral role and be able to be connectable by more devices at once. However in multi.c function linkDB_NumConns is returning number 2. Is there a possibility to enlarge this number (f.e. enlarge heap memory size?)

 

B.

They are able to connect with 2 centrals (mobile phones) to their peripheral device. However they are automatically being disconnected after approximately 1 minute. Is there some timer that is forcing disconnect? I was trying to track the initiator of disconnect but I just found the place where

typedef struct

{

  osal_event_hdr_t  hdr;   //!< @ref GAP_MSG_EVENT and status

  uint8 opcode;            //!< @ref GAP_LINK_TERMINATED_EVENT

  uint16 connectionHandle; //!< connection Handle

  uint8 reason;            //!< termination reason from LL, defined in ll.h

} gapTerminateLinkEvent_t;

 

 

Is the reason wht they are getting = LL_STATUS_ERROR_LL_TIMEOUT_PEER

Why does this timeout? It happens cca after 30 seconds. Even if they interact with device – write/read from characteristic.

 

The message from stack

GAP_LINK_TERMINATED_EVENT

 

In gapRole_processGAPMsg  is processed.

Thanks for your help,

Best regards,

Alberto

 

 

  • Let me add more details, in order to better reach the goal.

    1) They are testing BLE5 project: \ble5stack\multi_role
    2) For testing purposes they are using BLE scanner mobile app (BLE version 4.0) from Google play.
    3) if they try to add services generated with Bluetooth developer studio, they receive an error: HAL_ASSERT_CAUSE_ICALL_TIMEOUT. I'm not sure if this is related to the main issue, but I think it's relevant to report in that case.
    4) Again on these services generated in BDS, compiler in IAR project is unable to find icall_api.h header file. This are lines from source code generated from BDS.
    #ifdef ICALL_LITE
    # include "icall_api.h" // Only exists for 3.x stack version, so use ifdef.
    #endif

    Please provide feedback as the issue is now urgent.
    Thanks,
    Alberto
  • Hi Alberto,

    A. Did they change the compiler predefine? MAX_NUM_BLE_CONNS=2 (Go to Options -> Runtime Checking -> C/C++ Compiler -> Defined Symbols).

    B. LL_STATUS_ERROR_LL_TIMEOUT_PEER normally means the peer (here: the phone) has timed out. Could you post a sniffer log of the devices connecting and disconnecting? It would help analyze what's going on.

    Also, the TI plugin for BDS has not been updated for the ble5 stack yet. This is probably why they get errors with bds-generated services.
  • Marie,

    thanks for helping us in solving the issue.

    Ok, if BDS is not updated for BLE5 they will not continue further in this.

    However can they continue using BDS for BLE v4.2?

    In fact using BLE v4.2 they are able to build the project, they can see device advertising, but after attempting to  connect to device, it seems controller layer of stack freezes.

    Even when setting breakpoint to Event_pend function it does not wake this part of the code after attempting to connect – I guess no message is being sent from Controller

    static void multi_role_taskFxn(UArg a0, UArg a1)

    {

     // Initialize application

     multi_role_init();

     // Application main loop

     for (;;)

     {

       uint32_t events;

       // Waits for an event to be posted associated with the calling thread.

       // Note that an event associated with a thread is posted when a

       // message is queued to the message receive queue of the thread

       events = Event_pend(syncEvent, Event_Id_NONE, MR_ALL_EVENTS,

                           ICALL_TIMEOUT_FOREVER);

    Thanks,

    Alberto

  • Marie,

    also please find Packet Sniffer Screenshots that may help you in better understanding the root of the issue.

    And then all the time this packet (0x0C LL_VERSION_IND). I think it freezes on this packet…

    Please let me know your feedback.

    Thanks and regards,

    Alberto

  • Hi Alberto,

    What HW are they running on? Have they verified that the RTC timing is accurate?

    Regards,
    Fredrik
  • Fredrik,

    customer is doing tests on CC2640R2F Launch Pad, testing MultiRole project from SDKv3, with BTv4.2.
    I assume this will help restricting the evaluations more on SW side.

    Thanks,
    Alberto
  • Alberto,

    That definitely takes out a bit of uncertainty.

    Regards,
    Fredrik
  • Hi Alberto,

    There are some debug things that can be checked. Please see dev.ti.com/.../ble-debugging.html

    When it's frozen, and they have halted execution to look around, I'd like to see what's reported in the BIOS-> Scan for errors dialog, as well as the Task->Detailed tab. In case there is an exception, it's good to also check Hwi-> Exception. (This is described further down in the documentation chapter).

    Best regards,
    Aslak
  • Hi AslaK,

    Alberto asked me to continue in this discussion. My name is Peter Langer, I am his customer, working in Honeywell and responsible for development of BLE.

    I have done what You suggest:
    A.
    BIOS-> Scan for errors:
    ti.sysbios.family.arm.cc26xx.Timer Device (0x20000208) N/A
    Caught exception in view init code: "C:/ti/xdctools_3_50_00_10_core/packages/xdc/rov/StructureDecoder.xs", line 547: java.lang.Exception: Target memory read failed at address: 0x40092000, length: 20


    B.
    Task->Detailed:
    Target memory read failed at address: 0x20001230, length: 76
    This read is at a VALID address according to the application's section map, but the DebugServer memory read failed.

    C.
    Hwi-> Exception:
    Target memory read failed at address: 0x200010f0, length: 24
    This read is at a VALID address according to the application's section map, but the DebugServer memory read failed.

    How can I proceed now?
    Thx a lot for a support!
    Peter

  • Hi Peter,

    Hm, this is not ideal. The ROV tool itself just doesn't work. Either that, or the debug connection has failed for some reason.

    Did you stop/break execution before doing this?
    Can you look at registers or memory when it's like this?
    If you try to look at these things *before* it crashes, does it still say memory read failed?

    Which IDE are you using? IAR or CCS? And which version?

    Also, i see mention of BDS generated services. Can I take it that the multi_role project works as expected before adding these services?

    The BDS plugin does not output an application example for multi-role; how have you added and used the generated services?

    Best regards,
    Aslak

  • Hi Aslak,

    sorry I dod not stop debugger before doing those steps.

    now I do not see exceptions...

    just this seems interesting:

    Task->Detailed:

    I am using IAR 7.80.4. As I wrote to Alberto, I was using multiroll project for BLE v4.2. Without modifying I was able to connect by mobile phone, but got auto disconnect after cca. 30 seconds. After I removed periodic timer I got stable connection for up to 2 devices.

    Then I generated code for services using BDS. I took files for the services and added them into the IAR project. I then copied out some parts of code from simple perihperal file generated by BDS and pasted them into multi roll project.

    And In this state I am experiencing difficulties. I could suggest that I did something wrong, It could be. But anyway without changing a line of code I got disconnect using multiroll project before. So I suggest something wrong will be in SDK itself...

    Thx. For help!

    thx.

    Peter