Changes between Version 58 and Version 59 of Developer/Simulators/QEMU/CANEmulation


Ignore:
Timestamp:
08/27/13 16:52:55 (11 years ago)
Author:
Jinyang
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Simulators/QEMU/CANEmulation

    v58 v59  
    330330
    331331
    332 
    333 
    334 
    335 =  Step 2: Build a Basic PCI-CAN device in qemu  =
     332=  Step 2: Introduce SocketCAN and SJA1000  =
     333
     334We have built a minimal linux environment now. Before we built the PCI-CAN device in QEMU, we will introduce the Linux driver SocketCAN and CAN device SJA1000.
     335=  SocketCAN  =
     336
     337The SocketCAN package is an implementation of CAN protocols (Controller Area Network) for Linux. You can get a manual from the source of Linux Kernel at Documention/networking/can.txt .
     338
     339Simplely, we only need to insert the vcan module. Following is what we need to do.
     340  $ sudo insmod /lib/modules/`uname -r`/kernel/drivers/net/can/vcan.ko
     341  $ sudo ip link add type vcan
     342  $ sudo ip link set vcan0 up
     343
     344Then you can check the CAN interface using command ''ifconfig vcan0'' . You can test the can networking using can-utils, that you can get from https://gitorious.org/linux-can/can-utils .
     345  ./candump vcan0  # Observe vcan0
     346  ./cangen vcan0   # Generate CAN message
     347=  SJA1000  =
     348
     349The SJA1000, a stand-alone CAN controller, is produced by Philips Semiconductors which is more than a simple replacement of the PCA82C200. You can get more useful information from [http://www.nxp.com/documents/data_sheet/SJA1000.pdf SJA1000 Datasheet] and [http://www.mct.net/download/philips/can_appnote.pdf SJA1000 Application Note].
     350
     351SJA1000 is intended to replace the PCA82C200 because it is hardware and software compatible. It has two modes including BasicCAN mode and PeliCAN mode.
     352
     353
     354=  Step 3: Build a Basic PCI-CAN device in qemu  =
     355
     356
     357
     358
     359
    336360Based upon http://jin-yang.github.io/2013/07/25/add-pcidevice-to-qemu.html,
    337361