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