Board: S32K311-EVB
Module: FlexCAN0
Tool: Vector CANoe connected via J8 connector
Debug probe: J-Link
I am implementing the CAN protocol on the S32K311-EVB using FlexCAN0.
Sami2098_0-1789478804307.pngSami2098_0-1789478804307.pngSami2098_0-1789478804307.png
Sami2098_1-1789478831337.pngSami2098_1-1789478831337.pngSami2098_1-1789478831337.png
Sami2098_2-1789478911944.pngSami2098_2-1789478911944.pngSami2098_2-1789478911944.png
Sami2098_3-1789478932611.pngSami2098_3-1789478932611.pngSami2098_3-1789478932611.png
Best regards.
Hello @Sami2098,
Could you share RTD version you are currently using?
There are some examples in our community you can use as reference:
FlexCAN configuration overall looks OK. Can you confirm PTA6/7 are configured as input and output, respectively, and you are indeed calling Siul2_Port_Ip_Init() API to initialize Port?
Julin_AragnM_2-1789514266922.pngJulin_AragnM_2-1789514266922.pngJulin_AragnM_2-1789514266922.pngJulin_AragnM_2-1789514266922.png
Since you are using S32K1XEVB, transceiver used is FS23, and when the FS23 is in Debug mode, the CAN transceiver is set to Active mode by default, thus there is no need to set CAN_MODE = 0b1x.
I would also suggest checking that the bitrate and sampling point configured is the same between S32K311<->CANoe.
Lastly, if you have a logic analyzer or an oscilloscope, could you share the CANTXD, CANRXD, CANH and CANL signals?
Best regards,
Julián
Hi Julián_AragónM
Thanks for looking into this. I found the root cause — it was actually a CANoe channel bus configuration issue on my end, not a problem with the S32K311 CAN driver configuration. After correcting the CANoe Vector configuration, reception is working fine now.
Follow-up question:
I'm currently running at 500 kbps, and I understand that if I switch to a different baud rate (e.g., 125 kbps), several dependent parameters need to be recalculated — such as the Prescaler, Propagation Segment, Phase Segment 1, Phase Segment 2, and Resync Jump Width — to maintain correct bit timing and sample point relative to the CAN peripheral clock.
Could someone point me to a reference/guide document that explains:
I'm using the MCAL layer in AUTOSAR mode (S32 Configuration Tool for Can driver configuration), so a guide aligned with this configuration flow (rather than register-level FlexCAN programming alone) would be especially helpful.
Thanks in advance for your guidance.
Hello @Sami2098,
1. The chapter 73.3.10.8 (Protocol timing) from S32K3XX Reference Manual Rev. 12 explains bit timing configuration, and its various parameters.
2. This really depends on your application and configuration; however, nominal bitrates include 125 kbps, 250 kbps, and 500 kbps.
3. You can refer to our FlexCAN bit timing calculation sheet. You can also refer to the S32K3XX FlexCAN with RTD Training sildes.
Best regards,
Julián