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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

809 Views
carl-magnusmoon
Contributor I

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

0 Kudos
Reply
1 Reply

626 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Calle:

I can reproduce your issue in my side, this seems related with event, and it can't init twice, let me check it and update you later. Thank you for reporting this,

Best regards

Daniel

0 Kudos
Reply