📄 manual.tex
字号:
\paragraph{LinCan}\begin{verbatim} ./configure --can=lincan\end{verbatim}\paragraph{Virtual CAN interfaces (for test/debug)}\begin{verbatim} ./configure --can=virtual or, for kernel space: ./configure --can=kernel_virtual\end{verbatim}Virtual CAN interface use Unix pipes to emulate a virtual CAN network.Each message issued from a node is repeat to all other nodes. Currentlyonly works with nodes running in the same process, and does not supportwork with Xenomai or RTAI.\paragraph{VScom}\begin{verbatim} ./configure --can=vscom\end{verbatim}The VSCAN API archive will be automatically downloaded and decompressed (unzip required). See \href{http://www.vscom.de/1_1_05.htm}{www.vscom.de} for available adapters.\subsubsection{LSS services}Canfestival optionally supports LSS services but they must be enabled.\begin{verbatim} ./configure --enable-lss\end{verbatim}Additionally, the FastScan LSS service can also be enabled.\begin{verbatim} ./configure --enable-lss --enable-lss-fs\end{verbatim}\subsection{Testing your CanFestival installation}\subsubsection{User space}Sample provided in /example/TestMasterSlave is installed into yoursystem during installation.\begin{verbatim} TestMasterSlave\end{verbatim}Default CAN driver library is libcanfestival\_can\_virtual.so., whichwill simply pass CAN messages through Unix pipes between Master andSlave.You may also want to specify different can interface and define someCAN ports. Another example using Peak{\textquotesingle}s dual PCMCIA(configure and install with --can=peak) :\begin{verbatim} TestMasterSlave -l libcanfestival_can_peak.so -s 40 -m 41\end{verbatim}If the LSS services are enabled the sample provided in /example/TestMasterSlaveLSS will be also installed. It behaves the same as TestMasterSlave except that there are 2 slave nodes without a valid nodeID so the the initializations is done via the LSS services. If FastScan optional service is enabled the example will use it. \subsubsection{Kernel space}\begin{verbatim} example/kerneltest\end{verbatim}It's based on TestMasterSlave exampleand has the same functionality. Uses virtual can driver as defaulttoo. After successful installation you can insert the module by typing:modprobe canf\_ktest Module control is done by simple console 'canf\_ktest\_console'which is used to start/stop sending data.\section{Windows Targets}CanFestival can be compiled and run on Windows platform. It is possibleto use both Cygwin and win32 native runtime environment.\subsection{Object Dictionary Editor GUI installation.}Please refer to \hyperlink{a821UsingDictionaryEditorGUIoutline}{8.2.1)UsingDictionary Editor GUI}\subsection{CYGWIN}\subsubsection{Requirements}Cygwin have to be installed with those packages :\begin{enumerate}\item gcc \item unzip \item wget \item make \end{enumerate}Currently, the only supported CAN devices are PeakSystems ones, withPcanLight driver and library.Please download driver at \href{http://www.peak-system.com/themen/download_gb.html}{http://www.peak-system.com/themen/download\_gb.html} \ and follow instructionsin order to install driver on your system.Install Cygwin as required, and the driver for your Peak CAN device.Open a Cygwin terminal, and follow those instructions:\subsubsection{Cygwin configuration and compilation}\paragraph{A single node with PcanLight and Peak CAN -USB adapter}Download the PCAN-Light Zip file for your HW ( URL from downloadpage ):\begin{verbatim} wget http://www.peak -system.com/files/usb.zip\end{verbatim}Extract its content into your cygwin home (it will create a {}``Disk''directory):\begin{verbatim} unzip usb.zip\end{verbatim}Configure CanFestival3 providing path to the desired PcanLight implementation:\begin{verbatim} cd CanFestival -3 export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/ export PCAN_HEADER=Pcan_usb.h export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_usb.lib ./configure --can=peak_win32 make\end{verbatim}In order to test, you have to use another CanFestival node, connectwith a CAN cable.\begin{verbatim} cp ~/Disk/PCAN-Light/Pcan_usb.dll . ./examples/TestMasterSlave/TestMasterSlave \ -l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll \ -S 500K -M none\end{verbatim}Then, on the other node :\begin{verbatim} ./TestMasterSlave -l my_driver.so -S none -M 500K\end{verbatim}Now messages are being exchanged between master and slave node.\paragraph{Two nodes with PcanLight and Peak dual PCMCIA -CAN adapter}Download the PCAN-Light Zip file for your HW ( URL from downloadpage ):\begin{verbatim} wget http://www.peak-system.com/files/pccard.zip\end{verbatim}Extract its content into your cygwin home (it will create a {}``Disk''directory):\begin{verbatim} unzip pccard.zip\end{verbatim}The configure CanFestival3 providing path to the desired PcanLightimplementation:\begin{verbatim} export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/ export PCAN_HEADER=Pcan_pcc.h export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_pcc.lib export PCAN2_HEADER=Pcan_2pcc.h export PCAN2_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_2pcc.lib\end{verbatim}In order to test, just connect together both CAN ports of the PCMCIAcard. Don{\textquotesingle}t forget 120ohms terminator.\begin{verbatim} cp ~/Disk/PCAN-Light/Pcan_pcc.dll . cp ~/Disk/PCAN-Light/Pcan_2pcc.dll . ./examples/TestMasterSlave/TestMasterSlave \ -l drivers/can_peak_win32/cygcan_peak_win32.dll\end{verbatim}Messages are then exchanged between master and slave node, both insideTestMasterSlave{\textquotesingle}s process.\subsection{Visual Studio C++}\subsubsection{Requirements}Minimal Cygwin installation is required at configuration time in orderto create specific header files (config.h and cancfg.h). Once thisfiles created, cygwin is not necessary any more.Project and solution files have been created and tested with VisualStudio Express 2005. Be sure to have installed Microsoft PlatformSDK, as recommended at the end of Visual Studio installation.\subsubsection{Configuration with cygwin}Follow instructions given at \hyperlink{Cygwin configuration and compilation}{Cygwinconfiguration and compilation}, but do neither call make nor do tests,just do configuration steps. This will create headers files accordinglyto your configuration parameters, and the desired CAN hardware.\subsubsection{Compilation with Visual Studio}You can either load independent {}``{*}.vcproj'' project filesalong your own projects in your own solution or load the provided{}``CanFestival -3.vc8.sln'' solution files directly.Build CanFestival -3 project first.\paragraph{PcanLight and the can\_peak\_win32 project.}Chosen Pcan\_xxx.lib and eventually Pcan\_2xxx.lib files must be addedto can\_peak\_win32 \ \ project before build of the DLL.\subsubsection{Testing}Copy eventually needed dlls (ie : Pcan\_Nxxx.lib) into Release orDebug directory, and run the test program:\begin{verbatim} TestMasterSlave.exe -l can_peak_win32.dll\end{verbatim}\subsection{MSYS}\subsubsection{Requirements}Download from : http://sourceforge.net/project/showfiles.php?group\_id=2435\begin{enumerate}\item MSYS-1.0.10.exe \item MinGW-5.1.3.exe \item mingwPORT (which contains wget-1.9.1) \end{enumerate}Please download driver at http://www.peak-system.com/themen/download\_gb.htmland follow instructions in order to install driver on your system.Install MSYS and MingW as required, and the driver for your Peak CANdevice. Open a MSYS terminal, and follow those instructions:\\\begin{itemize}\item extract wget-1.9.1-mingwPORT.tar.bz2 \item copy wget.exe in c:\textbackslash{} msys\textbackslash{} 1.0\textbackslash{}bin\textbackslash{} \item start MSYS and check the file /etc/fstab contain the line c:/MinGW/mingw \end{itemize}\subsubsection{MSYS configuration and compilation}Instructions for compilation are nearly the same as CYGWIN part.\paragraph{A single node with PcanLight and Peak CAN-USB adapter}Download the PCAN-Light Zip file for your HW ( URL from download page):\begin{verbatim} wget http://www.peak-system.com/files/usb.zip\end{verbatim}Extract its content into your MSYS's home (it will create a \char`\"{}Disk\char`\"{} directory):\begin{verbatim} unzip usb.zip\end{verbatim}Configure CanFestival3 providing path to the desired PcanLight implementation:\begin{verbatim} cd CanFestival-3 export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/ export PCAN_HEADER=Pcan_usb.h export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_usb.lib ./configure --can=peak_win32 make\end{verbatim}In order to test, you have to use another CanFestival node, connectwith a CAN cable.\begin{verbatim} cp ~/Disk/PCAN-Light/Pcan_usb.dll . ./examples/TestMasterSlave/TestMasterSlave \ -l drivers/can_peak_win32/cygcan_peak_win32.dll \ -S 500K -M none\end{verbatim}Then, on the other node :\begin{verbatim} ./TestMasterSlave -l my_driver.so -S none -M 500K -m 0\end{verbatim}Now messages are being exchanged between master and slave node.\paragraph{Two nodes with PcanLight and Peak dual PCMCIA-CAN adapter}Download the PCAN-Light Zip file for your HW ( URL from download page):\begin{verbatim} wget http://www.peak-system.com/files/pccard.zip\end{verbatim}Extract its content into your MSYS's home (it will create a \char`\"{}Disk\char`\"{} directory):\begin{verbatim} unzip pccard.zip\end{verbatim}The configure CanFestival3 providing path to the desired PcanLightimplementation:\begin{verbatim} export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/ export PCAN_HEADER=Pcan_pcc.h} export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_pcc.lib export PCAN2_HEADER=Pcan_2pcc.h export PCAN2_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_2pcc.lib\end{verbatim}In order to test, just connect together both CAN ports of the PCMCIAcard. Don't forget 120ohms terminator.\begin{verbatim} cp~/Disk/PCAN-Light/Pcan_pcc.dll ~. cp ~/Disk/PCAN-Light/Pcan_2pcc.dll ~. ./examples/TestMasterSlave/TestMasterSlave \ -l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll -m 0 -s 1\end{verbatim}Messages are then exchanged between master and slave node, both insideTestMasterSlave's process.\section{Motorola HCS12}The examples have been tested on a MC9S12DG255 mounted on a ElektronikladenHCS12 T -board.Beware that there are few differences in the MSCAN module of the 68HC12and HCS12 microcontroller. For a HC12, you must adapt the driver thatwe provide for \ the HCS12.For the difference MSCAN HC12/HCS12, see the Motorola applicationnote AN2011/D.Configure switch:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -