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.

CC2642R-Q1: Questions about connection monitor real-time performance and CAN driver

Part Number: CC2642R-Q1

Tool/software:

My customer is using connection monitor on CC2642R-Q1 with the latest SDK7.41. They found that the real-time performance is impacted by the CAN bus data handling. The application is as below:

1. In MicroCmApp_taskFxn, initialize CAN:

2. When data comes in from the CAN bus, a GPIO interrupt will be triggered and the application will send data in the interrupt handler. Then the received data will be processed in MicroCmApp_processMicroCmAppMsg:

3. The application also has a periodic clock to send some CAN data, which is also processed in MicroCmApp_processMicroCmAppMsg.

4. The receiving and transmitting of a CAN data takes about 1ms to 3ms.

The problem is that the part of case MICRO_CM_APP_CM_EVT in MicroCmApp_processMicroCmAppMsg is found impacted by the added code for CAN data processing. It looks every time MicroCmApp_processCmMsg is found delayed by the CAN data processing, and the connection monitor eventually lost track of the connection.

The questions are:

1. Does the MicroCmApp_processMicroCmAppMsg function have a strong requirement for real-time operation? Is it allowed to execute user application which may preempt the execution of MicroCmApp_processCmMsg?

2. If the answer to question 1 is yes, is there a way to calculate the time to the next connection event so that the user application can hold the CAN data processing for later to avoid impacting the real-time performance?

Best regards,

Shuyang

  • Hello Shuyang,

    I will need some more time to look into this, please expect a response by Monday 09/30. 

    I apologize for the delay. 

    Thanks, 
    Isaac

  • Hello Shuyang, 

    When the data is coming in from the CAN bus is this data related to the initial data received when starting connection monitor. This includes the access address, connection interval, hop value, etc.? Additionally, what is BLE_CONSECUTIVE_MISSED_CONN_EVT_THRES set to in the application? 

    Connection monitor needs to be able to scan during the calculated timeframe to catch each connection event. More information about this is available Micro BLE Stack - Application Layer. If these scan events are missed, and BLE_CONSECUTIVE_MISSED_CONN_EVT_THRES is reached, the connection monitor will lose the connection. 

    Please let me know for the question above, and I will continue looking into the behavior. 

    Thanks, 

    Isaac