This is to update on completion of Milestone 2 of the project which involved communication on the CAN network with real CAN devices.
The major work done in this Milestone involved :
Bring UP the CTUCAN device enumerated in first Milestone. Update of Litex interfaces was needed to make CAN interface UP and running.
Use ip utilites of linux which treats CAN as network device and make it up. Support was added to buildroot to include needed utilities for CAN and make it part of bootup script.
Below image shows CAN bus coming up on system restart and can-utils is used for communication over CAN network :
Now when CAN IP is up, we needed a CAN transceiver to connect to CAN network. SN65HVD230 CAN Board is used for this purpose.
can_tx and canrx are are mapped to ck_io pins exposed on J4 of Arty Board. https://github.com/disdi/linux-on-litex-vexriscv/blob/master/soc_linux.py#L34
They are connected to CAN RX and CAN TX of transceiver with 3.3V to power it. Connection between FPGA board and CAN transceiver is shown below :
Considerable testing is done over different CAN devices to confirm CTUCAN IP is able to comunicate over CAN network. PCAN-USB adapter is used to emulate CAN device over development computer.
Connection between PCAN-USB adapter with DB9 connector and CAN transceiver is shown below :
CANH and CANL of transceiver is attached to (pin2 and pin7) DB9 connector. For DB9 Connector pinout for CAN, refer : https://documentation.help/NI-CAN/High-Speed_CAN_Pinout_Cable.html
PCAN-View software run on development computer is to analyze the CAN network to check for the protocal conformity and errors.