S32K31XEVB-Q100FlexCAN0 — Loopback works fine, but no reception with external CANoe Tool 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. Loopback mode test (working): I first implemented and tested FlexCAN0 in internal loopback mode. This worked successfully — messages transmitted were correctly received back through my "void CanIf_RxIndication(const Can_HwType* Mailbox, const PduInfoType* PduInfoPtr )" handling function, confirming that my basic FlexCAN0 configuration (clock setup, bit timing, message buffer initialization) is functioning correctly. External communication test (not working): I then moved to testing external CAN communication: Configure PTA6 and PTA7 pin in pin configuration. Connected Vector CANoe to the board via the J8 connector. In CANoe configuration, I unchecked "CAN Loopback Mode." Attach 12 V Adapter Started CANoe transmission — CANoe shows it is sending CAN frames. However, on the S32K311 side, nothing is received — CanIf_RxIndication(the same function that worked correctly in loopback mode) is never called/triggered. For debugging i use segger RTT viewer using JTAG Configuration 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. Re: S32K31XEVB-Q100FlexCAN0 — Loopback works fine, but no reception with external CANoe Tool Hello @Sami2098,
Could you share RTD version you are currently using?
There are some examples in our community you can use as reference:
Re: CAN Example for S32K311 - NXP Community
Example S32K312 CAN Transmit & Receive Using Polling mode DS3.5 RTD300
[RTD600 MCAL & IP] S32K3X4EVB-T172 FlexCAN Example Interrupt/Polling
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 Re: S32K31XEVB-Q100FlexCAN0 — Loopback works fine, but no reception with external CANoe Tool 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: How these bit timing parameters (Prescaler, Prop Seg, PS1, PS2, SJW) relate to and are derived for different target baud rates. Recommended sample point ranges for different baud rates in an automotive/industrial context. Any official NXP application note or reference specific to the S32K3xx FlexCAN MCAL (AUTOSAR) configuration tool for bit timing calculation. 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. Re: S32K31XEVB-Q100FlexCAN0 — Loopback works fine, but no reception with external CANoe Tool 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
記事全体を表示