Hello,
I am porting S32K344 WB's "s32k3_wb_can" project code to my project. The CAN0's TX and RX pin is same with the WB's design(CAN0_RX: PTA6 and CAN0_TX: PTA7 ). The CAN0 work in CAN Classic mode, but the CANBox can't detect any CAN signal.
I try to debug the "s32k3_wb_can" project, and find "CAN0_ISRCallback" function is never called. I check the s32k144 demo code, it seems the "CAN0_Callback_Func" function is called and installed with "CAN_InstallEventCallback(&can_pal0_instance,&CAN0_Callback_Func,(void*)0);", but S32K344's "s32k3_wb_can" project seems no such install procedure.
I have no S32K344 WB board, so I can't verify the WB's real running status. I want to know how to let the can0 run in "s32k3_wb_can" project.
The attachment is my project "s32k3_wb_can.zip". To decrease the project size, I remove the "Debug_FLASH" subfolder. My can is sample 8-pin can chip and the STB is default low, so I only manipulate CAN0_RX/CAN0_TX. Please help me check what's the problem. Thanks.
Hi @Jimmybai,
The CAN0 work in CAN Classic mode, but the CANBox can't detect any CAN signal.
Could you clarify what do you mean by this? Is CAN Classic working, but CAN FD not? Or how are you confirming CAN Classic functionality.
I try to debug the "s32k3_wb_can" project, and find "CAN0_ISRCallback" function is never called. I check the s32k144 demo code, it seems the "CAN0_Callback_Func" function is called and installed
You can use the following APIs to enable FlexCAN's IRQ and handler:
IntCtrl_Ip_EnableIrq(FlexCAN0_1_IRQn);
IntCtrl_Ip_InstallHandler(FlexCAN0_1_IRQn, CAN0_ORED_0_31_MB_IRQHandler, NULL_PTR);
However, this should already be enabled by the initialization of the IntCtrl driver you are doing:
retCode = IntCtrl_Ip_Init(&IntCtrlConfig_0);
retCode = IntCtrl_Ip_ConfigIrqRouting(&intRouteConfig);
Callback installation is done within FlexCAN's initialization, to whichever callback you've declared:
Julin_AragnM_0-1780594748273.png
Another reason your callback is never triggered may be that no valid Rx frames are being received. Have you tried scoping the CAN bus through an oscilloscope?
Instead of testing the wb_can example, have you tried using FlexCAN_Ip_Example_S32K344 included in RTD package?
Or some of the examples shared in community:
Best regards,
Julián
By the way, the example project come from S32K344 WB's example folder---S32K344_Whiteboard_Example(LLD)_RTM_1.0.0