AnsweredAssumed Answered

Impossible to use several CAN channels at the same time with fsl_flexcan driver kinetis K70

Question asked by Carl-Magnus Moon on Aug 12, 2015
Latest reply on Aug 20, 2015 by Daniel Chen

Hello,

 

 

I have problems with flexcan_init in MQX4.1 for kinetis K70. It seems impossible to use several CAN channels at the same time. The first flexcan_init works fine. The second call to flexcan_init returns -4010 (MQX_EINVAL). If i look in the code for the flexcan driver I can see that there is only one global event defined in fsl_flexcan.c. The following code in flexcan_init will fail the second time flexcan_init is called even if I use different instance numbers as the one and only global event is already initialized.

 

  

From fsl_flexcan_driver.c:

 

     // Set up an event group

    result = _lwevent_create(&event, LWEVENT_AUTO_CLEAR);

    if (result != MQX_OK) {

        printf("\nCannot create lwevent");

        return result;

    }

 

 

Is it impossible to use several CAN channels at the same time with the fsl_flexcan driver?

 

 

The code seems to be identical in MQX 4.2.

 

 

This question seems very similar to the link below but the answers does not seem correct. The problem is not solved in MQX4.2 and it is not an electrical issue. The problem is in the driver.

Flexcan K70 with CAN0 and CAN1 with Mqx driver

 

Regards,

Calle

Outcomes