From 0c78b10251206073be8c5b5ea7ed4d30dabe5235 Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 25 Sep 2007 06:30:01 +0000 Subject: [PATCH] Updated manual for msys/mingw build Cleaned up commited makefiles --- doc/manual/en/.cvsignore | 4 ++ doc/manual/en/manual.tex | 124 ++++++++++++++++++++++++++++++++++ drivers/timers_win32/Makefile | 62 ----------------- drivers/win32/Makefile | 84 ----------------------- 4 files changed, 128 insertions(+), 146 deletions(-) delete mode 100755 drivers/timers_win32/Makefile delete mode 100755 drivers/win32/Makefile diff --git a/doc/manual/en/.cvsignore b/doc/manual/en/.cvsignore index 610b009..21c4cb4 100644 --- a/doc/manual/en/.cvsignore +++ b/doc/manual/en/.cvsignore @@ -1 +1,5 @@ manual.lyx +manual.out +manual.pdf +manual.toc +manual.aux diff --git a/doc/manual/en/manual.tex b/doc/manual/en/manual.tex index 8ce567c..3cc40bf 100644 --- a/doc/manual/en/manual.tex +++ b/doc/manual/en/manual.tex @@ -654,6 +654,130 @@ directory, and run the test program: {\ttfamily TestMasterSlave.exe {}-l can\_peak\_win32.dll} +\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.html +and follow instructions in order to install driver on your system. +Install MSYS and MingW as required, and the driver for your Peak CAN +device. 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 +): + +\texttt{wget http://www.peak-system.com/files/usb.zip}~\\ + + +Extract its content into your MSYS's home (it will create a \char`\"{}Disk\char`\"{} +directory): + +\texttt{unzip usb.zip}~\\ + + +Configure CanFestival3 providing path to the desired PcanLight implementation: + +\texttt{cd CanFestival-3} + +\texttt{export PCAN\_INCLUDE=\~{ }/Disk/PCAN-Light/Api/} + +\texttt{export PCAN\_HEADER=Pcan\_usb.h} + +\texttt{export PCAN\_LIB=\~{ }/Disk/PCAN-Light/Lib/Visual\textbackslash{} +C++/Pcan\_usb.lib} + +\texttt{./configure -{}-can=peak\_win32} + +\texttt{make}~\\ + + +In order to test, you have to use another CanFestival node, connect +with a CAN cable. + +\texttt{cp \~{ }/Disk/PCAN-Light/Pcan\_usb.dll .} + +\texttt{./examples/TestMasterSlave/TestMasterSlave \textbackslash{}} + +\texttt{-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll \textbackslash{}} + +\texttt{-S 500K -M none}~\\ + + +Then, on the other node : + +\texttt{./TestMasterSlave -l my\_driver.so -S none -M 500K -m 0} + +Now messages are beeing 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 +): + +\texttt{wget http://www.peak-system.com/files/pccard.zip}~\\ +\\ +Extract its content into your MSYS's home (it will create a \char`\"{}Disk\char`\"{} +directory): + +\texttt{unzip pccard.zip}~\\ +\\ +The configure CanFestival3 providing path to the desired PcanLight +implementation:\\ + + +\texttt{export PCAN\_INCLUDE=\~{ }/Disk/PCAN-Light/Api/} + +\texttt{export PCAN\_HEADER=Pcan\_pcc.h} + +\texttt{export PCAN\_LIB=\~{ }/Disk/PCAN-Light/Lib/Visual\textbackslash{} +C++/Pcan\_pcc.lib} + +\texttt{export PCAN2\_HEADER=Pcan\_2pcc.h} + +\texttt{export PCAN2\_LIB=\~{ }/Disk/PCAN-Light/Lib/Visual\textbackslash{} +C++/Pcan\_2pcc.lib}~\\ + + +In order to test, just connect together both CAN ports of the PCMCIA +card. Don't forget 120ohms terminator. + +\texttt{cp\~{ }/Disk/PCAN-Light/Pcan\_pcc.dll ~.} + +\texttt{cp \~{ }/Disk/PCAN-Light/Pcan\_2pcc.dll ~.} + +\texttt{./examples/TestMasterSlave/TestMasterSlave \textbackslash{}} + +\texttt{-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll -m 0 -s +1}~\\ + + +Messages are then exchanged between master and slave node, both inside +TestMasterSlave's process. + \section{Motorola HCS12} The examples have been tested on a MC9S12DG255 mounted on a Elektronikladen HCS12 T{}-board. diff --git a/drivers/timers_win32/Makefile b/drivers/timers_win32/Makefile deleted file mode 100755 index 7b98ae1..0000000 --- a/drivers/timers_win32/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -#! gmake - -# -# Copyright (C) 2006 Laurent Bessard -# -# This file is part of canfestival, a library implementing the canopen -# stack -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -CC = mingw32-g++ -OPT_CFLAGS = -O2 -CFLAGS = $(OPT_CFLAGS) -PROG_CFLAGS = -OS_NAME = MINGW32 -ARCH_NAME = x86 -PREFIX = /usr/local -TARGET = win32 -CAN_DRIVER = can_peak_win32 -TIMERS_DRIVER = timers_win32 - -INCLUDES = -I../../include -I../../include/$(TARGET) -I../../include/$(CAN_DRIVER) -I../../include/$(TIMERS_DRIVER) - -OBJS = $(TIMERS_DRIVER).o - -SRC_HFILES = ../../include/$(TIMERS_DRIVER)/timerscfg.h - -TARGET_HFILES = $(PREFIX)/include/canfestival/timerscfg.h - -all: driver - -driver: $(OBJS) - -%o: %cpp - $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $< - -install: - mkdir -p $(PREFIX)/include/canfestival - cp $(SRC_HFILES) $(PREFIX)/include/canfestival - -uninstall: - rm -f $(TARGET_HFILES) - -clean: - rm -f $(OBJS) - -mrproper: clean - - diff --git a/drivers/win32/Makefile b/drivers/win32/Makefile deleted file mode 100755 index 3dba867..0000000 --- a/drivers/win32/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -#! gmake - -# -# Copyright (C) 2006 Laurent Bessard -# -# This file is part of canfestival, a library implementing the canopen -# stack -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -CC = mingw32-g++ -OPT_CFLAGS = -O2 -CFLAGS = $(OPT_CFLAGS) -PROG_CFLAGS = -OS_NAME = MINGW32 -ARCH_NAME = x86 -PREFIX = /usr/local -TARGET = win32 -CAN_DRIVER = can_peak_win32 -TIMERS_DRIVER = timers_win32 -ENABLE_DLL_DRIVERS = 1 - -INCLUDES = -I../../include -I../../include/$(TARGET) -I../../include/$(TIMERS_DRIVER) - -OBJS = $(TARGET).o - -# add timers driver if any -ifneq ($(TIMERS_DRIVER),timers_) -OBJS += ../$(TIMERS_DRIVER)/$(TIMERS_DRIVER).o -endif - -SRC_HFILES = ../../include/$(TARGET)/applicfg.h ../../include/$(TARGET)/canfestival.h - -TARGET_HFILES = $(PREFIX)/include/$(TARGET)/applicfg.h $(PREFIX)/include/$(TARGET)/canfestival.h - -all: driver - -driver: $(OBJS) - - -%o: %cpp - $(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $< - -#../$(TIMERS_DRIVER)/$(TIMERS_DRIVER).o: -# $(MAKE) -C ../$(TIMERS_DRIVER) driver - -#../$(CAN_DRIVER)/$(CAN_DRIVER).o: -# $(MAKE) -C ../$(CAN_DRIVER) driver - -libcanfestival_$(TARGET).a: $(OBJS) - @echo Building [libcanfestival_$(TARGET).a] - ar rc $@ $(OBJS) - ranlib $@ - -install: libcanfestival_$(TARGET).a - mkdir -p $(PREFIX)/lib/ - mkdir -p $(PREFIX)/include/canfestival - cp libcanfestival_$(TARGET).a $(PREFIX)/lib/ - cp $(SRC_HFILES) $(PREFIX)/include/canfestival - -uninstall: - rm -f $(PREFIX)/lib/libcanfestival_$(TARGET).a - rm -f $(TARGET_HFILES) - -clean: - rm -f $(OBJS) - rm -f libcanfestival_$(TARGET).a - -mrproper: clean - - -- 2.39.2