PYNQ-Z1 CAN-Controller activation fails!

Dear all!

I am working on a project that I have to connect PS through CAN protocol to outer world. I am using PYNQ-Z1 board that has 2 integrated CAN-Controller. I made a block design in Vivado 2019.2 and activated both can0 and can1, defined them as EMIO and connected the rx and tx of can0 and can1 together (made a loop to check if I can access CAN-Controller). I run the overlay of my design on board, and try to access the can-controller through python-can. I cannot find any available CAN-channel.

The overlay works fine. In system log I recieve:
pynq kernel: fpga_manager fpga0: writing can_loop_wrapper.bin to Xilinx Zynq FPGA Manager

does someone know how can I connect to PS CAN-Controller?

Kind Regards,
BPe

Do you have a software driver for the CAN?

Cathal

Hi Cathal,

thank you for you replay. I installed can-utils. Sorry if my question is too simple. Should I install extra driver? If yes, could you please let me know when I can find the correct driver?

I followed the instruction of enabling SocketCan:

By default, the SocketCAN device drivers are not automatically loaded by Linux at boot time on all systems: you may need to enable the relevant linux kernel modules. You can manually load these modules with the following command:

sudo modprobe can
sudo modprobe vcan
sudo modprobe slcan

While modprobe can works, modprobe vcan and modprobe slcan cause following error:

modprobe: FATAL: Module vcan not found in directory /lib/modules/4.19.0-xilinx-v2019.1
modprobe: FATAL: Module slcan not found in directory /lib/modules/4.19.0-xilinx-v2019.1

Shouldn’t I still be able to see my can ip by ip link show?
Many regards
BPe

OK so it looks like you don’t have a driver. I’m not sure the best way to try resolve this. You may need to recompile the kernel with the CAN drivers installed, or you may be able to install a driver to the PYNQ image.
This isn’t really a PYNQ question. You may be better posting on Xilinx/Linux forums for info on how to install this package properly.
Sorry I can’t be of more help at this point.

Cathal

1 Like

Thank you so much for your reply. I posted the same question in Xilinx/Embedded Linux forum. I hope there someone could answer my question. I tried also Dynamic device-tree overlay to activate can0 and can1 status. But I got an error which I could not solved.

Regards,
BPe