I am modifying the "Can_example_S32G399A_M7" to:
1. use both FlexCan0 and FlexCan1, both send one CAN message, and receiving is also ready.
a. I use the loop back for both CAN controllers.
Both CAN controller share the same CanIf_TxConfirmation callback and CanIf_RxIndication callback
Both CAN controller sent 1 message each, (I can see the CanIf_u8TxConfirmCnt went to 2 if I sent 2, only went up to 1 if I sent one message). Looks good for Tx part.
But only Controller0 will have the RxIndication callback, the other controller does not have the RxIndication callback being invoked, In the RxIndication, the mailbox show controller0 only. If message is on controller1, the RxIndication callback will never enter, no mailbox for controller1. what was the issue here? My CanIf configure as below, is it correct?
b. When I unselect the "Can loop Back Mode", recompile and run, nothing happened, no TxConfirmation and no RxIndication.
I plug in the 20 pair connector come with gold box. Two black ground wires connect to ground. For FlexCan0 and FlexCan1, I twist green wires together and white wires together, with 120ohm resistor connect the green and white wire. which I consider it as a CAN bus.
My question is why I do not even have TxConfirmation?
I assume say for FlexCan0 connect to Tja1043. the Flex_CAN0_EN and FLEX_CAN0_STB if both are 1, Tja1043 should in normal working mode.
Flex_CAN0_EN and FLEX_CAN0_STB are connected to P2.x of PCALxxxxx
the default power on value is all 1 for output port.
So I assume all the Tja1043 should be set to normal mode.
Summary, please let me know:
1. why I don't have Controller1's RxIndication callback while controller0 has it.
2. why my external CAN bus not Tx/Rx normally.
Thanks,
已解决! 转到解答。
Hi @vsong,
For 1st question, Our internal team tried to reproduce the issue and can't reproduce the same, Maybe please check the configuration again.
For 2nd question, you need to configure the port and execute port initialization in the main function(for example, FlexCAN0 -> PB01/PB02) if not using loopback mode, and then it will go to "CanIf_TxConfirmation"
Hope this helps.
Thanks,
Mayank S Patel
Hi @vsong,
Thank you for your patience.
I am unable to test the configuration with multiple CAN controllers locally. I have created a ticket with the internal team and I will get back to you on this.
Thanks,
Mayank S Patel
Hi @vsong,
For 1st question, Our internal team tried to reproduce the issue and can't reproduce the same, Maybe please check the configuration again.
For 2nd question, you need to configure the port and execute port initialization in the main function(for example, FlexCAN0 -> PB01/PB02) if not using loopback mode, and then it will go to "CanIf_TxConfirmation"
Hope this helps.
Thanks,
Mayank S Patel
Thank you for the answer.
For question 1, I figure it out, when I configure the CAN object1 (receiving object), I didn't use the correct CAN controller.
For question 2, Thank you for the answer. I realize I did not set the pin for Rxd and Txd for Can0 and Can1 in PIN configuration. After I configure the pin, and add Suil2_port driver, then in main.c add port init. the external loop working.
Thanks,