Hello,
I am trying to enable FlexCAN2 on the S32K148 while working with the Eclipse OpenBSW project.
FlexCAN0 is working correctly, but FlexCAN2 does not transmit valid frames.
Configuration:
MCU: S32K148
CAN instance: FlexCAN2
Pins:
PB12 → CAN2_RX (ALT4)
PB13 → CAN2_TX (ALT4)
External transceiver: MCP2551 powered at 5V
Bus termination: total ~60 Ω
Bitrate: 500 kbps (Classical CAN)
Observed behavior:
Only error frames are observed on the bus
Bit stuffing errors occur
No ACK is received
Questions:
Is MCP2551 (5V transceiver) compatible with S32K148 FlexCAN I/O levels?
Are PB12/PB13 ALT4 the correct pins for FlexCAN2?
Are there specific clock or configuration differences between FlexCAN0 and FlexCAN2 that should be considered?
Any guidance would be appreciated.
Thank you.
Hi @sousou54,
1. I see no issues with MCP2551 compatibility.
2. Yes.
3. No additional configuration. CAN0/1/2 are clocked the same.
You can try testing your node by steps...
Try connecting TX/RX pins together without transceiver and send a message. You should see message repeatedly due to missing ACK. TX error counter is 0x80 and module is in error passive. If you see anything else, you have wrong pin settings.
Connect TX/RX pins to transceiver normally and have it unconnected from the bus. Send a message. You should see the same as above. If not, transceiver could be disabled or it is not terminated.
I can see from MCP2551 datasheet that you must select high-speed mode by connecting Rs pin to Vss.
Connect transceiver to the bus with other nodes (e.g. CAN tool), send/receive messages. If any error is detected most probably the CAN bit timing is not right. Be sure all nodes use same bitrate and sample point.
You can use the following tool: MPC5xxx/S32Kxx/LPCxxxx: CAN / CAN FD bit timing calculation.
Lastly, is this a custom board, or are you using S32K148EVB? If this is a custom board, please check connections as described in AN5426: Hardware Design Guidelines for S32K1xx.
Best regards,
Julián