[MPC5748G] CAN FD Multiple Instances

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

[MPC5748G] CAN FD Multiple Instances

Jump to solution
892 Views
BenMW
Contributor I

Hi, for my project I want to use all of the 8 Flexcan Modules. When I use the first instance like in the example project, the physical bus works fine with interrupt/error handling. 

During initialization I can see that the ESR1 registers of CAN1...7 are not changing any values. CAN0 instance is set to SYNC and IDLE.

The initialization of every instance is performed by the FLEXCAN_DRV_Init() function:

/* Initialize FlexCAN driver */
FLEXCAN_DRV_Init(INST_FLEXCAN1, &flexcan1_State, &flexcan1_InitConfig0);
FLEXCAN_DRV_Init(INST_FLEXCAN2, &flexcan2_State, &flexcan2_InitConfig0);
FLEXCAN_DRV_Init(INST_FLEXCAN3, &flexcan3_State, &flexcan3_InitConfig0);
FLEXCAN_DRV_Init(INST_FLEXCAN4, &flexcan4_State, &flexcan4_InitConfig0);
FLEXCAN_DRV_Init(INST_FLEXCAN5, &flexcan5_State, &flexcan5_InitConfig0);
FLEXCAN_DRV_Init(INST_FLEXCAN6, &flexcan6_State, &flexcan6_InitConfig0);
FLEXCAN_DRV_Init(INST_FLEXCAN7, &flexcan7_State, &flexcan7_InitConfig0);
FLEXCAN_DRV_Init(INST_FLEXCAN8, &flexcan8_State, &flexcan8_InitConfig0); 

The structures for init are the same and they're generated by Processor Expert. After FLEXCAN_Enable(base) is called, ESR1 of CAN0 looks like the following:

BenMW_0-1629804174229.png

On the other instances it looks different:

BenMW_1-1629804316672.png

Does anyone knows why CAN1...7 are not enabled correctly? The MCR registers of the modules are the same:

BenMW_2-1629804576283.png

 

BenMW_3-1629804603586.png

Thanks a lot!

0 Kudos
1 Solution
883 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

to be able to send anything, module must be synchronized to the bus and see it as idle, that is RDX pin must be high. Also module must see own transmitted signal. Transceiver ensures this.
For simple test without transceiver you can do external loopback connection, TXD to RXD. This way you can test proper pin initialization.

BR, Petr

View solution in original post

0 Kudos
4 Replies
890 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

do you have pins configured as well in the pin_mux component for other CAN modules?
Moreover CAN modules must be connected with CAN transceivers.

BR, Petr 

0 Kudos
885 Views
BenMW
Contributor I

I know that I need transceivers for every CAN, but is it neccessary for initialization? In the first step I want to try error handling if transmitting a CAN frame is not possible. But because of the problem during initialization there is no interrupt generated (e.g. NACK).

0 Kudos
884 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

to be able to send anything, module must be synchronized to the bus and see it as idle, that is RDX pin must be high. Also module must see own transmitted signal. Transceiver ensures this.
For simple test without transceiver you can do external loopback connection, TXD to RXD. This way you can test proper pin initialization.

BR, Petr

0 Kudos
881 Views
BenMW
Contributor I

Thanks for this information, it solves my problem!

It works if you just configure the pins for transceiver in the pinMux peripheral. No physical transceiver needed to check just error interrupt handling.

0 Kudos