Hello
I'm able to receive and transmit from one controller to other by settings of MB, baud rate etc.
But I want to configure my CAN to receive from an unknown source. I'm facing issue there I have configured my CAN0 pins (E4 and E5) and connected these pins to external CAN transceiver. The CANH and CANL pins from transceiver is given to a CAN analyzer. I test with the CAN Analyzer to send and receive data to my controller. I'm successfully able to transfer data; but I'm not able to receive any. I have attached the snippets of the settings and code.
Kindly, let me know what would be possibly going wrong Regards
Hello PetrS
i observe that the MB2 is not getting updated, And i made the changes as if(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, MB2) == STATUS_SUCCESS to print data
Kindly let me know, where I may be going wrong
Thank you
do you see any errors detected on MCU and/or CAN tool? If not message is received by module and ACKed back, but it is not moved into MB2 due to
- MB is not free-to-receive. Could be inactive or locked
- MB is not set to accept ID send by CAN tool, check MB setting and mask register
BR, Petr
Hi,
unfortunately I am not able to view pictures. Could you please share the code in different way.
Did you try to test any demo code either from S32DS or posted here? e.g.
https://community.nxp.com/docs/DOC-343091
BR, Petr
Hello PetrS
Sorry for the delay,
Here are the images
Hope you would be able to view the screenshots now.
Kindly let me know, where I might be going wrong.
Also suggest an example where flexCAN is used for both (reception and transmission) Rx and Tx of CAN messages
Thank you
Hi,
the configuration looks normal, so what does not work on RX side? MB2 is never updated with receive data?
Or do you see any errors detected on MCU and/or CAN tool?
Is the TX frame in the CAN tool defined to have standard or extended ID (0x123)?
The "dataInfo" in the code specifies if MB will accept std or ext ID, unless it is masked.
Also the usage of
if(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, MB2) == STATUS_BUSY) is little bit weird.
Should not be there "while" instead of "if" to pass after MB2 receives a frame? or at least use
if(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, MB2) == STATUS_SUCCESS to print data after MB2 is updated.
BR, Petr