09-19-2017 06:00 PM - edited 09-19-2017 06:01 PM
I have been working with AXI CANFD soft IP of Xilinx in Zynq 7000 (ZYBO board). Standalone works great. But when I tried the same using Linux, I am not able to receive messages in the rx fifo even though rx fifo status register (FSR) identifies data coming to it. Basically I think the data is not getting stored in rx fifo buffer , even though I have configured acceptance filter ID and mask properly. Then I noticed that xilinx linux driver page of CAN says Frame work won't support Acceptance filters. How is the CAN protocol expected to work if driver does not support basic acceptance filter? I am sorry if I am wrong. My understanding of CAN protocol is limited.
09-20-2017 05:36 AM
There are essentially two kinds of acceptance filters:
The hardware filtering is usually very limited. For example the old SJA1000 controller from Phillips could operate in either single or dual mode, basically it could match one or two addresses.
In contrast, the socketcan driver in linux kernel employs a hash table and allows something like 2048 addresses to be matched.
I suspect that the Xilinx soft IP does not implement hardware filtering. However software filtering is part of socketcan and should work. Caveat: I have not actually tried this on Zynq, I am just making some guesses based on experience with other similar designs.
09-20-2017 04:14 PM
Hi @rfs613 ,
Apparently, I think the opposite way about Xilinx CANFD IP, as its datasheet clearly mention about Acceptance Filter pair registers, Acceptance filter Mask Registers (AFMR) and Accpetance Filter ID Registers (AFIR). But SocketCan is something I have never explored.
While the driver I mentioned says it wont support Acceptance Filter Framework, Does it mean software level acceptance filter or as i suspected, I cant even do acceptance filter in the soft IP I am using?
Problem I see is , CANFD IP datasheet says, if you do not use acceptance filter, none of the messages will be stored in RXFIFO ( Thisis what I am seeing now).
While AXI CAN or Zynq's hard IP CAN datasheets say, if you do not use acceptance filter, all the messages will be stored in RXFIFO. If this is the case, I would rather try AXI CAN or zynq's hard IP CAN since it allows to save all messages even if acceptance filters are disabled.
I am basically trying to get a CAN protocol up and running between two ZYBO boards (Zynq). I am using this transeiver .
09-20-2017 05:10 PM
09-22-2017 01:24 PM
Thanks for the input @rfs613.
For the time being, moved into Hard CAN IP inside PS side of Zynq, until CANFD IP of Xilinx gets mature. Transeiver is working fine with CAN peripheral at address 0xe0008000 inside zynq. Linux side: Using the same Xilinx driver only. Have not actually tested with different acceptance filters. Now, only tested rx of everything of what is sent from tx. Will try using accpetance filters with the same driver, and will update here.