Install the Adlink PCI-7841 CAN card

From SubfireWiki

Jump to: navigation, search

Installing the driver and support software

  1. Download the PCI-7841/cPCI-7841 Source code driver from http://www.adlinktech.com/PD/web/PD_Driver.php?PDNo=145&id=&sid=&swKind=DR
    • You may need to give them your email address.
    • Firefox will put it in hwtester's home
    • Create a 'downloaded_drivers' folder and a 'drivers' folder in hwtester's home
    • Open the drivers folder
  2. Extract the contents to the drivers folder.
  3. Move the .tar.gz file to the downloaded_drivers folder.
  4. Open a terminal and execute these commands:
    1. cd drivers/7841src/driver
    2. cat 7841_inst.pl | sed 's#/drivers/p7841.o#/driver/p7841.o#' > 7841_inst-tweaked.pl
    3. chmod a+x 7841_inst-tweaked.pl
    4. cd ../lib
      • Note: the include directory is a ruse. The headers there don't compile. Use the commdef and pci_7841 headers from the lib directory
    5. sed 's/\(TRUE\|FALSE\)/ADLINK_\1/g' commdef.h > commdef-tweaked.h

Loading the driver

  • Manually loading the driver
    • Simply run su -c '/home/hwtester/drivers/7841src/driver/7841_inst-tweaked.pl 1 /home/hwtester/drivers/7841src'
  • To set up automatic loading:
    • Add "/home/hwtester/drivers/7841src/driver/7841_inst-tweaked.pl 1 /home/hwtester/drivers/7841src" to /etc/rc.local
  • Note: If there are two PCI 7841 cards, change 1 to 2 in the lines above.

Testing the card

  1. Open a terminal and run the following commands
    1. cd drivers/7841src/sample
    2. ./test7841
  2. If all goes well, you should see this:
[hwtester@csi-lear-1 sample]$ ./test7841
Start Transmit 32 messages Through PORT1 and PORT2....
Get Receive Message PORT1 32  PORT2 32
examine 32 patterns
test ok!!
Press any key to exit the program...
Personal tools