11/4/2013 I. Software Setup A. Kernel Assuming a phyCORE-Vybrid PD13.1.0 Linux BSP base: * Apply the CAN patches, 0002-mvf-fixed-flexcan-driver-and-added-support-for-flexc.patch and 0003-pcm052-added-flexcan-support-for-the-phyCORE-Vybrid.patch. cd build_armv7l-timesys-linux-gnueabi/linux-3.0/ patch -p1 < 0002-mvf-fixed-flexcan-driver-and-added-support-for-flexc.patch patch -p1 < 0003-pcm052-added-flexcan-support-for-the-phyCORE-Vybrid.patch * Rebuild the kernel: make kernel-restage; make kernel-build; make kernel-install-image B. Root filesystem The root filesystem must include iproute2 and can-utils * From the factory directory: make menuconfig ¦ -> Target Software ¦ ¦ -> Software Packages ¦ ¦ -> Networking ¦ ¦ -> Miscellaneous ¦ ¦ [*] iproute2 ---> ¦ -> Target Software ¦ ¦ -> Software Packages ¦ ¦ -> Networking ¦ ¦ CAN Bus ---> ¦ ¦ [*] canutils ---> * Build these packages make II. Test the CAN interface using PCAN-View Software and PCAN-USB in the following way: We recommend using PCAN-USB and PCAN-View to test the CAN interface: * Be sure to download the device driver for PCAN-USB: http://www.peak-system.com/PCAN-USB.199.0.html?&L=1 * Open PCAN-View, install from here: http://www.peak-system.com/PCAN-View.242.0.html?&L=1 (set to 1Mbit/s) Setup the CAN interface on the Vybrid, from the Linux target console run: ip link set can0 down ip link set can0 type can bitrate 1000000 triple-sampling on ip link set can0 up A. Transmit a message From the target console: cansend can0 222 173 190 239 202 254 186 190 On PCAN 'Recieve': Should view the following: Message DLC Data 01h 8 DE AD BE EF CA FE BA BE B. Receive a message From the target console: candump [CTRL+C to quit can dump] On PCAN 'Transmit': 1. Right Click -> New Message 2. Create a message 3. Click OK 4. Double Click the message in the 'Transmit' window 5. When running candump - should see the message in target console CAN not working? See this message: "ip: either "dev" is duplicate, or "type" is garbage" http://www.armadeus.com/wiki/index.php?title=CAN_bus_Linux_driver Solution: Run "which ip", if it states "/bin/ip" - make sure you are using the correct filesystem (iproute2) -- should result in "/sbin/ip"