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:
On the other instances it looks different:
Does anyone knows why CAN1...7 are not enabled correctly? The MCR registers of the modules are the same:
Thanks a lot!
Solved! Go to Solution.
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
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
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).
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
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.