Hi everyone:
First of all, my purpose is implement the can function on s32k358, and I am trying to modify by Can_Example_S32K358 for now. This example is can internal loopback test, I want to use it to modify to Can sent message then use PCAN-VIEW to check can message if the can sent message successful.
I already create the port configuration for VCU_CAN, pin "PTB0" & "PTB1", and the following is my main function, I can't get message by PCAN-VIEW, do anyone have idea or experience on this, I really need some help for this, thanks.
Hi @BillWen,
If the FlexCAN module is being configured as loopback, you will not see anything on the pins. The module needs to be configured for normal/user operation. Also, please confirm if the CAN transceiver need to be configured firstly in your board, there are various demo codes in the community to use as reference:
Also check if the PCAN-VIEW is configured with the correct values for baud rate, sampling point, etc.
Best regards,
Julián
Hi Julian :
Thanks for your reply.
Now, I can get CAN message from PCAN-VIEW by "Phy_665a_example_S32K358_CANFD_DS/Phy_665a_example_S32K358_CANFD_DS" this example code. So my purpose is set up a new can function in new project.
I already set up the Dio, platform, Port, Mcu, Can_43_flexcan, these MCAL setting, but still cannot get signal. Do you know what else I need to set? I use BJB_CAN to test, so I think I don't need to set up the SPI, right?
If you have any idea, please tell me, thanks a lot.
Thanks
BR, BillWen
Hi @BillWen,
Are you using the evaluation boards for this example? Please keep in mind the connections for this project:
The CAN bus is configured at 500kbps and a CAN ID of 4. If you are using BJB_CAN, then SPI is not needed. Could you clarify what are you referring to when saying "cannot get signal"?
Are you unable to send or receive messages with the MCU? Or the PCAN tool?
Best regards,
Julián
Hi Julian:
Thanks for your reply.
My hardware environment is the following EVB board, and pin define is S32K358_172MQFP
1. I can use "Phy_665a_example_S32K358_CANFD_DS" this example code to sent Can tx message by BJB_CAN, and I can get signal from PCAN-VIEW can analyzer.
2. I want to create a can function just like "Phy_665a_example_S32K358_CANFD_DS" on a new project, so I need to create port, platform, canif, Dio, Flexcan... setting. After I create these MCAL setting, I can't get can signal by can analyzer
3. About the Can transceiver work on normal mode, I only need to write "Dio_WriteChannel(DioConf_DioChannel_BJB_CAN_STBY, STD_LOW)" if I want to use BJB_CAN, right?
What information I need to provide to you and let you help me to figure out what's the problem? I stuck here for many days, please help me, thanks.
Thanks a lot
BR, BIll
Hi @BillWen,
Yes, in order to enable the CAN transceiver, the BJB CAN Standby pin needs to be driven to low. Also, keep in mind that a small delay is added after initializing the transceiver:
Dio_WriteChannel(DioConf_DioChannel_BJB_CAN_STBY, STD_LOW);
OsIf_Wait(500U);
/* Initialize CanIf driver */
CanIf_Init(NULL_PTR);
/* Initialize Can driver */
Can_43_FLEXCAN_Init(NULL_PTR);
If you are not specifically using the MC33665ACANFDEVB, you can also use the Can_Example_S32K358 from the RTD package, which does configure the CAN instance as loopback, but you can change it back to user mode and test it with the analyzer.
If this is still not working, please double-check the FlexCAN configuration differences between your project and the Phy_665a_example_S32K358_CANFD_DS. You can also share your project through here (or private message) to compare the differences in configuration.
Best regards,
Julián