
etisserant@249: \documentclass[a4paper,12pt]{book}
nico@208: \usepackage[ascii]{inputenc}
nico@208: \usepackage[T1]{fontenc}
nico@208: \usepackage[french,english]{babel}
nico@208: \usepackage{amsmath,amssymb,amsfonts,textcomp}
nico@208: \usepackage{color}
nico@208: \usepackage{calc}
nico@208: \usepackage{longtable}
nico@208: \usepackage{hyperref}
nico@208: \usepackage{graphics}
nico@208: \usepackage{graphicx}
nico@208: \DeclareGraphicsExtensions{.jpg}
nico@208: \DeclareGraphicsExtensions{.png}
nico@208: \hypersetup{colorlinks=true, linkcolor=blue, filecolor=blue, pagecolor=blue, urlcolor=blue}
nico@208: 
nico@208: %%%%\%%%%%%%% titre, auteurs, date, etc...%%%%%%%%%%%%%%%%%%
etisserant@249: \title{\Huge The CanFestival CANOpen stack manual}
nico@208: \author{Edouard TISSERANT}
nico@208: \date{\today}
nico@208: 
nico@208: % Text styles
etisserant@249: %\newcommand\textstyleTeletype[1]{\texttt{#1}}
nico@208: % Outline numbering
nico@208: \setcounter{secnumdepth}{5}
nico@208: \renewcommand\thesection{\arabic{section} -}
nico@208: \renewcommand\thesubsection{\arabic{section}.\arabic{subsection})}
nico@208: \renewcommand\thesubsubsection{\arabic{section}.\arabic{subsection}.\arabic{subsubsection})}
nico@208: \renewcommand\theparagraph{\alph{paragraph})}
nico@208: \renewcommand\thesubparagraph{\roman{subparagraph})}
nico@208: % List styles
nico@208: \newcommand\liststyleLi{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLii{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLiii{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLiv{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLv{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLvi{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLvii{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLviii{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLix{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLx{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLxi{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLxii{%
nico@208: \renewcommand\labelitemi{{--}}
nico@208: \renewcommand\labelitemii{{--}}
nico@208: \renewcommand\labelitemiii{{--}}
nico@208: \renewcommand\labelitemiv{{--}}
nico@208: }
nico@208: \newcommand\liststyleLxiii{%
nico@208: \renewcommand\labelitemi{{\textbullet}}
nico@208: \renewcommand\labelitemii{{\textbullet}}
nico@208: \renewcommand\labelitemiii{{\textbullet}}
nico@208: \renewcommand\labelitemiv{{\textbullet}}
nico@208: }
etisserant@249: 
nico@208: \begin{document}
etisserant@249: 
etisserant@249: {\centering\sffamily\Huge The CanFestival CANOpen stack manual.}
etisserant@249: 
etisserant@249: \renewcommand\contentsname{CanFestival v3.0 Manual}
nico@208: \setcounter{tocdepth}{2}
nico@208: \tableofcontents
nico@208: \section{Introduction}
etisserant@249: CanFestival is an OpenSource (LGPL and GPL) CANOpen framework.
nico@208: 
nico@208: \subsection{The CanFestival project}
nico@208: This project, initiated by Edouard TISSERANT in 2001, as grown thanks to
nico@208: Francis DUPIN and other contributors.
nico@208: 
nico@208: Today, CanFestival focuses on providing an ANSI{}-C platform independent
nico@208: CANOpen stack that can be implemented as master or slave nodes on PCs,
nico@208: Real{}-time IPCs, and Microcontrollers.
nico@208: 
nico@208: CanFestival is a project supported by Lolitech.
nico@208: 
nico@208: \subsection{What is CANopen}
nico@208: CANopen is a CAN based high level protocol. It defines some protocols to
nico@208: :
nico@208: 
nico@208: \liststyleLi
nico@208: \begin{enumerate}
nico@208: \item Configure a CAN network.
nico@208: \item Transmit data to a specific node or in broadcast.
nico@208: \item Administrate the network. For example detecting a not responding
nico@208: node.
nico@208: \end{enumerate}
nico@208: The documentation can be found in the Can in automation website :
nico@208: 
nico@208: \href{http://www.can-cia.de/canopen}{http://www.can{}-cia.de/canopen}
nico@208: 
nico@208: The most important document about CANopen is the normative CiA Draft
nico@208: Standard 301, version 4.02. You can now download with no cost the
nico@208: specification in Can in automation website.
nico@208: 
nico@208: To continue reading this document, let us assume that you have read some
nico@208: papers introducing CANopen.
nico@208: 
nico@208: \section{CanFestival Features}
nico@208: \subsection{Tools }
nico@208: The CANopen library is coming with some tools :
nico@208: 
nico@208: \liststyleLii
nico@208: \begin{enumerate}
nico@208: \item Object Dictionary editor GUI. WxPython Model{}-View{}-Controler
nico@208: based GUI, that help a lot in generating object dictionary source code
nico@208: for each node.
nico@208: \item A configure script, that let you chose compile time options such
nico@208: as target CPU/HOST, CAN and TIMER drivers.\newline
nico@208: This script have not been generated with autoconf, it have been made
nico@208: keeping micro{}-controller target in mind.
nico@208: \end{enumerate}
nico@208: \subsection{Standard conformance}
nico@208: \paragraph{Multi{}-Platform}
nico@208: \liststyleLiii
nico@208: \begin{enumerate}
nico@208: \item Library source code is C{}-ANSI.
nico@208: \item Driver and examples coding conventions merely depend on target
nico@208: specific contributor/compiler.
nico@208: \item Unix compatible interfaces and examples should compile and run on
nico@208: any Unix system (tested on GNU/Linux and GNU/FreeBSD).
nico@208: \end{enumerate}
nico@208: \paragraph{CanOpen conformance}
nico@208: {\bfseries\upshape
nico@208: DS{}-301}
nico@208: 
nico@208: \liststyleLiv
nico@208: \begin{enumerate}
nico@208: \item Should conform to DS301. V.4.02 13 february 2002.
nico@208: \item Master and Slave functionality implemented.
nico@208: \item Sending SYNC implemented.
nico@208: \item 1 SDO server per node. (update: more than one possible. To be more
nico@208: tested)
nico@208: \item Unlimited SDO client.
nico@208: \item SDO transmission mode : normal, expedited download and upload.
nico@208: \item Unlimited PDO receive.
nico@208: \item Unlimited PDO transmit.
nico@208: \item Object Data type implemented : 8, 16, 32 bits values, and fixed
nico@208: length strings.
nico@208: \item Slave state full implemented.
nico@208: \item NMT to change slave{\textquotesingle}s state implemented.
nico@208: \item PDO transmission mode : on request, every reception of 0 to n
nico@208: SYNC, on event.
nico@208: \item NMT Heartbeat implemented : A node can be either heartbeat
nico@208: producer or receiver.
nico@208: \item NMT NodeGuard implemented : Not fully implemented.
nico@208: \item TIME (time Stamp) : Not implemented.
luis@284: \item EMCY (emergency objects) : Sending and reception of EMCY objectos (without manufacturer specific error field).
nico@208: \item PDO Mapping bit per bit implemented.
nico@208: \end{enumerate}
nico@208: {\bfseries\upshape
nico@208: DS{}-302}
nico@208: 
nico@208: \liststyleLiv
nico@208: \begin{enumerate}
etisserant@249: \item Concise \space DFC : implemented.
nico@208: \end{enumerate}
nico@208: \section{How to start}
nico@208: \subsection{Host requirements}
nico@208: What you need on your development workstation.
nico@208: 
nico@208: \subsubsection{Object Dictionary Editor GUI}
nico@208: \liststyleLv
nico@208: \begin{enumerate}
nico@208: \item Python, with 
nico@208: \item wxPyhon modules installed (at least version 2.6.3). 
nico@208: \item Gnosis xml tools. (Optional can also be installed locally to the
nico@208: project automatically will the help of a Makefile. Please see
nico@208: \hyperlink{a91UsingDictionaryEditorGUIoutline}{9.1) Using Dictionary
nico@208: Editor GUI} )
nico@208: \end{enumerate}
etisserant@249: \subsubsection[\space Linux and Unix{}-likes]{\space Linux and Unix{}-likes}
nico@208: \liststyleLv
nico@208: \begin{enumerate}
nico@208: \item Linux, FreeBSD, Cygwin or any Unix environment with GNU toolchain.
nico@208: \item The GNU C compiler (gcc) or any other ANSI{}-C compiler for your
nico@208: target platform.
nico@208: \item Xpdf, and the official 301\_v04000201.pdf file in order to get GUI
etisserant@249: context sensitive help. Download the ds301 at\newline
nico@208: \href{http://www.can-cia.org/downloads/ciaspecifications/?1390}{http://www.can{}-cia.org/downloads/ciaspecifications/?1390}.
nico@208: \item GNU Make
nico@208: \item Bash and sed
nico@208: \end{enumerate}
nico@208: \subsubsection{Windows (for native win32 target)}
nico@208: \liststyleLv
nico@208: \begin{enumerate}
nico@208: \item Visual Studio Express 2005 or worst.
nico@208: \item Microsoft platform SDK (requires Genuine Advantage)
nico@208: \item Cygwin (for configuration only)
nico@208: \end{enumerate}
nico@208: \subsection{How to get CanFestival}
nico@208: Please always use CVS, this is the best way to get the most reactive
nico@208: support from the developer community :
nico@208: 
nico@208: cvs {}-d:pserver:anonymous@lolitech.dyndns.org:/canfestival
nico@208: login\newline
nico@208: (type return, without entering a password) 
nico@208: 
nico@208: Then, enter : \newline
nico@208: cvs {}-z3 {}-d:pserver:anonymous@lolitech.dyndns.org:/canfestival co
nico@208: {}-P CanFestival{}-3
nico@208: 
nico@208: \section{Understanding Canfestival}
nico@208: \subsection{CanFestival Project tree layout}
nico@208: Simplified directory structure.
nico@208: 
nico@208: {\ttfamily\bfseries
nico@208: ./src ANSI{}-C source of CANOpen stack}
nico@208: 
nico@208: {\ttfamily\bfseries
etisserant@249: \space /include Exportables Header files}
nico@208: 
nico@208: {\ttfamily\bfseries
nico@208: ./drivers Interfaces to specific platforms/HW}
nico@208: 
nico@208: {\ttfamily
nico@208: ./drivers/unix Linux and Cygwin OS interface}
nico@208: 
nico@208: {\ttfamily
nico@208: ./drivers/win32 Native Win32 OS interface}
nico@208: 
nico@208: {\ttfamily
nico@208: ./drivers/timers\_xeno Xenomai timers/threads (Linux only)}
nico@208: 
nico@208: {\ttfamily
nico@208: ./drivers/timers\_unix Posix timers/threads (Linux, Cygwin)}
nico@208: 
nico@208: {\ttfamily
nico@208: ./drivers/can\_peak\_linux PeakSystem CAN library interface}
nico@208: 
nico@208: {\ttfamily
nico@208: ./drivers/can\_peak\_win32 PeakSystem PCAN{}-Light interface}
nico@208: 
nico@208: {\ttfamily
nico@208: ./drivers/can\_uvccm\_win32 Acacetus{\textquotesingle}s RS232
nico@208: ``CAN{}-uVCCM'' interface}
nico@208: 
nico@208: {\ttfamily
nico@208: ./drivers/can\_virtual Fake CAN network (Linux, Cygwin)}
nico@208: 
nico@208: {\ttfamily
nico@208: ./drivers/hcs12 HCS12 full target interface}
nico@208: 
nico@208: {\ttfamily\bfseries
nico@208: ./examples Examples}
nico@208: 
nico@208: {\ttfamily
nico@208: ./examples/TestMasterSlave 2 nodes, NMT SYNC SDO PDO, win32+unix}
nico@208: 
nico@208: {\ttfamily
nico@208: ./examples/TestMasterMicroMod 1 node, control Peak I/O Module, unix}
nico@208: 
nico@208: {\ttfamily
nico@208: ./examples/gene\_SYNC\_HCS12 Just send periodic SYNC on HCS12}
nico@208: 
nico@208: {\ttfamily
nico@208: ./examples/win32test Ask some DS301 infos to a node (\textbf{win32)}}
nico@208: 
nico@208: {\ttfamily\bfseries
nico@208: ./objdictgen Object Dictionary editor GUI}
nico@208: 
nico@208: {\ttfamily
nico@208: ./objdictgen/config Pre{}-defined OD profiles}
nico@208: 
nico@208: {\ttfamily
nico@208: ./objdictgen/examples Some examples/test OD}
nico@208: 
nico@208: {\ttfamily\bfseries
nico@208: ./doc Project and CanOpen doc}
nico@208: 
nico@208: \subsection{Implement CanFestival in your application}
nico@208:  
nico@208:  \begin{center}
etisserant@249:    \includegraphics[width=12cm]{Pictures/10000201000003F9000002CF880931E7.png}
nico@208: \end{center}
nico@208: 
nico@208: \bigskip
nico@208: 
nico@208: \subsection{CanFestival CAN interfaces}
nico@208: Because most CAN controllers and drivers implement FIFOs, CanFestival
nico@208: consider sending message as a non bloking operation.
nico@208: 
nico@208: In order to prevent reentrent calls to the stack, messages reception is
nico@208: implemented differently on {\textmu}C and OS.:
nico@208: 
nico@208: \liststyleLvi
nico@208: \begin{enumerate}
nico@208: \item {\textmu}C must provide interuption masking for timer and can
nico@208: receive IT\newline
nico@208:  \begin{center}
etisserant@249:    \includegraphics[width=12cm]{Pictures/10000201000003CA0000016604E6A5EF.png}
nico@208: \end{center}
nico@208: \item OS must provide a receive thread, a timer thread and a mutex. CAN
nico@208: reception is a bloking operation.\newline
nico@208: \begin{center}
etisserant@249:    \includegraphics[width=12cm]{Pictures/10000201000003F9000002CF8B0CDAEA.png}
nico@208: \end{center}
nico@208: \end{enumerate}
nico@208: \subsection{CanFestival events scheduling}
nico@208: A CanOpen node must be able to take delayed actions.
nico@208: 
nico@208: As exemples, periodic sync emission, heartbeat production or SDO timeout
nico@208: need to set some alarms that will be called later and do the job.
nico@208: 
nico@208: {\textmu}C generaly do not have enough free timers to handle all the
nico@208: CanOpen needs directly. Moreover, CanFestival internal data may be
nico@208: corrupt by reentrant calls. 
nico@208: 
nico@208: CanFestival implement a micro{}-scheduler (timer.c). It uses only one
nico@208: timer to mimic many timers. It manage an alarm table, and call alarms
nico@208: at desired time.
nico@208: 
nico@208: \begin{center}
etisserant@249:    \includegraphics[width=12cm]{Pictures/100000000000022C000000DEDAD2140C.png}
nico@208: \end{center}
nico@208: 
nico@208: Scheduler can handle short clock value ranges limitation found on some
nico@208: {\textmu}C. As an example, value range for a 16bit clock counter with
nico@208: 4{\textmu}s tick is crossed within 0.26 seconds... Long alarms must be
nico@208: segmented.
nico@208: 
nico@208: Chronogram illustrate a long alarm (A) and a short periodic alarm (B),
nico@208: with a A value {\textgreater} clock range {\textgreater} B value.
nico@208: Values t0...t8 are successive setTimer call parameter values. t1
nico@208: illustrates an intermediate call to TimeDispatch, caused by a delay
nico@208: longer than clock range. Because of long alarm segmentation, at the end
nico@208: of t1, TimeDispatch call will not trig any alarm callback.
nico@208: 
nico@208: \begin{center}
etisserant@249:    \includegraphics[width=12cm]{Pictures/1000000000000396000000FFC42573DA.png}
nico@208: \end{center}
nico@208: 
nico@208: \section{Linux Target}
nico@208: Linux target is default configure target.
nico@208: 
nico@208: \subsection{Linux Compilation and installation}
nico@208: Call ./configure {--}help to see all available compile time options.
nico@208: 
nico@208: After invoking ./configure with your platform specific switches, just
nico@208: type make.
nico@208: 
nico@208: {\ttfamily
nico@208: ./configure [options]}
nico@208: 
nico@208: {\ttfamily
nico@208: make}
nico@208: 
nico@208: {\ttfamily
etisserant@249: make install}
nico@208: 
nico@208: \subsubsection{Standard Linux node}
nico@208: Configure switch:
nico@208: 
nico@208: {\ttfamily
nico@208:  {}-{}-timers=unix}
nico@208: 
nico@208: To do a CANopen node running on PC{}-Linux, you need :
nico@208: 
nico@208: \liststyleLvii
nico@208: \begin{enumerate}
nico@208: \item A working linux distribution
nico@208: \item One or more Peak system PC CAN interface and the last Peak Linux
nico@208: driver installed.
nico@208: \end{enumerate}
nico@208: \subsubsection{Real{}-Time Linux node}
nico@208: Configure switch:
nico@208: 
nico@208: {\ttfamily
nico@208:  {}-{}-timers=xeno}
nico@208: 
nico@208: To do a CANopen node running on PC{}-Linux, you need :
nico@208: 
nico@208: \liststyleLviii
nico@208: \begin{enumerate}
nico@208: \item A working Linux distribution patched with XENOMAI 2.1 or greater.
nico@208: \item One or more Peak system PC CAN interface and the last Peak Real
nico@208: Time Linux driver installed.
nico@208: \end{enumerate}
nico@208: \subsubsection{CAN devices}
nico@208: Curently supported CAN devices and corresponding configure switch:
nico@208: 
nico@208: \paragraph{Peak systems}
nico@208: Configure switch:
nico@208: 
nico@208: {\ttfamily
nico@208: {}-{}-can=peak\_linux}
nico@208: 
nico@208: PeakSystems CAN interface is automatically chosen as default CAN
nico@208: interface if libpcan is present in the system.
nico@208: 
nico@208: Please download driver at
nico@208: \href{http://www.peak-system.com/linux}{http://www.peak{}-system.com/linux}
nico@208: and follow instructions in order to install driver on your system.
nico@208: 
nico@208: \paragraph{Socket{}-Can (http://socketcan.berlios.de)}
nico@208: Configure switch:
nico@208: 
nico@208: {\ttfamily
nico@208: {}-{}-can=socket}
nico@208: 
nico@208: \paragraph{LinCan}
nico@208: Configure switch:
nico@208: 
nico@208: {\ttfamily
nico@208: {}-{}-can=lincan}
nico@208: 
nico@208: \paragraph{Virtual CAN interfaces (for test/debug)}
nico@208: Configure switch:
nico@208: 
nico@208: {\ttfamily
nico@208: {}-{}-can=virtual}
nico@208: 
nico@208: Virtual CAN interface use Unix pipes to emulate a virtual CAN network.
nico@208: Each message issued from a node is repeat to all other nodes. Currently
nico@208: only works with nodes running in the same process, and does not support
nico@208: work with Xenomai.
nico@208: 
nico@208: \subsection{Testing your CanFestival installation}
nico@208: Sample provided in /example/TestMasterSlave is installed into your
nico@208: system during installation.
nico@208: 
nico@208: {\ttfamily
nico@208: TestMasterSlave}
nico@208: 
nico@208: Default can driver library is libcanfestival\_can\_virtual.so., which
nico@208: will simply pass CAN messages through Unix pipes between Master and
nico@208: Slave. 
nico@208: 
nico@208: You may also want to specify different can interface and define some CAN
nico@208: ports. An other example using Peak{\textquotesingle}s dual PCMCIA
nico@208: (configure and install with {--}can=peak) :
nico@208: 
nico@208: {\ttfamily
nico@208: TestMasterSlave {}-l libcanfestival\_can\_peak.so {}-s 40 {}-m 41}
nico@208: 
nico@208: \section{Windows Targets}
nico@208: CanFestival can be compiled and run on Windows platform. It is possible
nico@208: to use both Cygwin and win32 native runtime environment.
nico@208: 
nico@208: \subsection{Object Dictionary Editor GUI installation.}
nico@208: Please refer to
nico@208: \hyperlink{a821UsingDictionaryEditorGUIoutline}{8.2.1)Using Dictionary
nico@208: Editor GUI}
nico@208: 
nico@208: \subsection{CYGWIN}
nico@208: \subsubsection{Requirements}
nico@208: Cygwin have to be installed with those packages :
nico@208: 
nico@208: \liststyleLix
nico@208: \begin{enumerate}
nico@208: \item gcc
nico@208: \item unzip
nico@208: \item wget
nico@208: \item make
nico@208: \end{enumerate}
nico@208: Currently, the only supported CAN devices are PeakSystems ones, with
nico@208: PcanLight driver and library. 
nico@208: 
nico@208: Please download driver at
nico@208: \href{http://www.peak-system.com/themen/download_gb.html}{http://www.peak{}-system.com/themen/download\_gb.html}
etisserant@249: \space and follow instructions in order to install driver on your system.
nico@208: 
nico@208: Install Cygwin as required, and the driver for your Peak CAN device.
nico@208: 
nico@208: Open a Cygwin terminal, and follow those instructions:
nico@208: 
nico@208: \subsubsection{Cygwin configuration and compilation}
nico@208: \paragraph{A single node with PcanLight and Peak CAN{}-USB adapter}
nico@208: Download the PCAN{}-Light Zip file for your HW ( URL from download page
nico@208: ): 
nico@208: 
nico@208: {\ttfamily
nico@208: wget http://www.peak{}-system.com/files/usb.zip}
nico@208: 
nico@208: Extract its content into your cygwin home (it will create a ``Disk''
nico@208: directory):
nico@208: 
nico@208: {\ttfamily
nico@208: unzip usb.zip}
nico@208: 
nico@208: Configure CanFestival3 providing path to the desired PcanLight
nico@208: implementation:
nico@208: 
nico@208: {\ttfamily
nico@208: cd CanFestival{}-3}
nico@208: 
nico@208: {\ttfamily
nico@208: export PCAN\_INCLUDE=\~{}/Disk/PCAN{}-Light/Api/}
nico@208: 
nico@208: {\ttfamily
nico@208: export PCAN\_HEADER=Pcan\_usb.h}
nico@208: 
nico@208: {\ttfamily
nico@208: export PCAN\_LIB=\~{}/Disk/PCAN{}-Light/Lib/Visual{\textbackslash}
nico@208: C++/Pcan\_usb.lib}
nico@208: 
nico@208: {\ttfamily
nico@208: ./configure {}-{--}can=peak\_win32}
nico@208: 
nico@208: {\ttfamily
nico@208: make}
nico@208: 
nico@208: In order to test, you have to use another CanFestival node, connect with
nico@208: a CAN cable.
nico@208: 
nico@208: {\ttfamily
nico@208: cp \~{}/Disk/PCAN{}-Light/Pcan\_usb.dll .}
nico@208: 
nico@208: {\ttfamily
nico@208: ./examples/TestMasterSlave/TestMasterSlave {\textbackslash}}
nico@208: 
nico@208: {\ttfamily
nico@208:   {}-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll
nico@208: {\textbackslash}}
nico@208: 
nico@208: {\ttfamily
nico@208:   {}-S 500K {}-M none}
nico@208: 
nico@208: Then, on the other node :
nico@208: 
nico@208: {\ttfamily
nico@208: ./TestMasterSlave {}-l my\_driver.so {}-S none {}-M 500K}
nico@208: 
nico@208: Now messages are beeing exchanged between master and slave node.
nico@208: 
nico@208: \paragraph{Two nodes with PcanLight and Peak dual PCMCIA{}-CAN adapter}
nico@208: Download the PCAN{}-Light Zip file for your HW ( URL from download page
nico@208: ): 
nico@208: 
nico@208: {\ttfamily
nico@208: wget http://www.peak{}-system.com/files/pccard.zip}
nico@208: 
nico@208: Extract its content into your cygwin home (it will create a ``Disk''
nico@208: directory):
nico@208: 
nico@208: {\ttfamily
nico@208: unzip pccard.zip}
nico@208: 
nico@208: The configure CanFestival3 providing path to the desired PcanLight
nico@208: implementation:
nico@208: 
nico@208: {\ttfamily
nico@208: export PCAN\_INCLUDE=\~{}/Disk/PCAN{}-Light/Api/\newline
nico@208: export PCAN\_HEADER=Pcan\_pcc.h\newline
nico@208: export PCAN\_LIB=\~{}/Disk/PCAN{}-Light/Lib/Visual{\textbackslash}
nico@208: C++/Pcan\_pcc.lib\newline
nico@208: export PCAN2\_HEADER=Pcan\_2pcc.\newline
nico@208: export PCAN2\_LIB=\~{}/Disk/PCAN{}-Light/Lib/Visual{\textbackslash}
nico@208: C++/Pcan\_2pcc.lib}
nico@208: 
nico@208: In order to test, just connect together both CAN ports of the PCMCIA
nico@208: card. Don{\textquotesingle}t forget 120ohms terminator.
nico@208: 
nico@208: {\ttfamily
nico@208: cp \~{}/Disk/PCAN{}-Light/Pcan\_pcc.dll .}
nico@208: 
nico@208: {\ttfamily
nico@208: cp \~{}/Disk/PCAN{}-Light/Pcan\_2pcc.dll .}
nico@208: 
nico@208: {\ttfamily
nico@208: ./examples/TestMasterSlave/TestMasterSlave {\textbackslash}}
nico@208: 
nico@208: {\ttfamily
nico@208:   {}-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll}
nico@208: 
nico@208: Messages are then exchanged between master and slave node, both inside
nico@208: TestMasterSlave{\textquotesingle}s process.
nico@208: 
nico@208: \subsection{Visual Studio C++}
nico@208: \subsubsection{Requirements}
nico@208: Minimal Cygwin installation is required at configuration time in order
nico@208: to create specific header files (config.h and cancfg.h). Once this
nico@208: files created, cygwin is not necessary any more.
nico@208: 
nico@208: Project and solution files have been created and tested with Visual
nico@208: Studio Express 2005. Be sure to have installed Microsoft Platform SDK,
nico@208: as recommended at the end of Visual Studio installation.
nico@208: 
nico@208: \subsubsection{Configuration with cygwin}
etisserant@249: Follow instructions given at 
etisserant@249: \hyperlink{Cygwin configuration and compilation}{Cygwin
nico@208: configuration and compilation}, but do neither call make nor do tests,
nico@208: just do configuration steps. This will create headers files accordingly
nico@208: to your configuration parameters, and the desired CAN hardware.
nico@208: 
nico@208: \subsubsection{Compilation with Visual Studio}
nico@208: You can either load independents ``*.vcproj'' project files along your
nico@208: own projects in your own solution or load the provided
nico@208: ``CanFestival{}-3.vc8.sln'' solution files directly.
nico@208: 
nico@208: Build CanFestival{}-3 project first.
nico@208: 
nico@208: \paragraph{PcanLight and the can\_peak\_win32 project.}
nico@208: Chosen Pcan\_xxx.lib and eventually Pcan\_2xxx.lib files must be added
etisserant@249: to can\_peak\_win32 \space \space project before build of the DLL.
nico@208: 
nico@208: \subsubsection{Testing}
nico@208: Copy eventually needed dlls (ie : Pcan\_Nxxx.lib) into Release or Debug
nico@208: directory, and run the test program:
nico@208: 
nico@208: {\ttfamily
nico@208: TestMasterSlave.exe {}-l can\_peak\_win32.dll}
nico@208: 
greg@282: \subsection{MSYS}
greg@282: 
greg@282: 
greg@282: \subsubsection{Requirements}
greg@282: 
greg@282: Download from : http://sourceforge.net/project/showfiles.php?group\_id=2435
greg@282: 
greg@282: \begin{enumerate}
greg@282: \item MSYS-1.0.10.exe
greg@282: \item MinGW-5.1.3.exe
greg@282: \item mingwPORT (which contains wget-1.9.1)
greg@282: \end{enumerate}
greg@282: Please download driver at http://www.peak-system.com/themen/download\_gb.html
greg@282: and follow instructions in order to install driver on your system.
greg@282: Install MSYS and MingW as required, and the driver for your Peak CAN
greg@282: device. Open a MSYS terminal, and follow those instructions:\\
greg@282: 
greg@282: 
greg@282: \begin{itemize}
greg@282: \item extract wget-1.9.1-mingwPORT.tar.bz2
greg@282: \item copy wget.exe in c:\textbackslash{}msys\textbackslash{}1.0\textbackslash{}bin\textbackslash{}
greg@282: \item start MSYS and check the file /etc/fstab contain the line c:/MinGW
greg@282: /mingw
greg@282: \end{itemize}
greg@282: 
greg@282: \subsubsection{MSYS configuration and compilation}
greg@282: 
greg@282: Instructions for compilation are nearly the same as CYGWIN part. 
greg@282: 
greg@282: 
greg@282: \paragraph{A single node with PcanLight and Peak CAN-USB adapter}
greg@282: 
greg@282: Download the PCAN-Light Zip file for your HW ( URL from download page
greg@282: ):
greg@282: 
greg@282: \texttt{wget http://www.peak-system.com/files/usb.zip}~\\
greg@282: 
greg@282: 
greg@282: Extract its content into your MSYS's home (it will create a \char`\"{}Disk\char`\"{}
greg@282: directory):
greg@282: 
greg@282: \texttt{unzip usb.zip}~\\
greg@282: 
greg@282: 
greg@282: Configure CanFestival3 providing path to the desired PcanLight implementation:
greg@282: 
greg@282: \texttt{cd CanFestival-3}
greg@282: 
greg@282: \texttt{export PCAN\_INCLUDE=\~{ }/Disk/PCAN-Light/Api/}
greg@282: 
greg@282: \texttt{export PCAN\_HEADER=Pcan\_usb.h}
greg@282: 
greg@282: \texttt{export PCAN\_LIB=\~{ }/Disk/PCAN-Light/Lib/Visual\textbackslash{}
greg@282: C++/Pcan\_usb.lib}
greg@282: 
greg@282: \texttt{./configure -{}-can=peak\_win32}
greg@282: 
greg@282: \texttt{make}~\\
greg@282: 
greg@282: 
greg@282: In order to test, you have to use another CanFestival node, connect
greg@282: with a CAN cable.
greg@282: 
greg@282: \texttt{cp \~{ }/Disk/PCAN-Light/Pcan\_usb.dll .}
greg@282: 
greg@282: \texttt{./examples/TestMasterSlave/TestMasterSlave \textbackslash{}}
greg@282: 
greg@282: \texttt{-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll \textbackslash{}}
greg@282: 
greg@282: \texttt{-S 500K -M none}~\\
greg@282: 
greg@282: 
greg@282: Then, on the other node :
greg@282: 
greg@282: \texttt{./TestMasterSlave -l my\_driver.so -S none -M 500K -m 0}
greg@282: 
greg@282: Now messages are beeing exchanged between master and slave node.
greg@282: 
greg@282: 
greg@282: \paragraph{Two nodes with PcanLight and Peak dual PCMCIA-CAN adapter}
greg@282: 
greg@282: Download the PCAN-Light Zip file for your HW ( URL from download page
greg@282: ):
greg@282: 
greg@282: \texttt{wget http://www.peak-system.com/files/pccard.zip}~\\
greg@282: \\
greg@282: Extract its content into your MSYS's home (it will create a \char`\"{}Disk\char`\"{}
greg@282: directory):
greg@282: 
greg@282: \texttt{unzip pccard.zip}~\\
greg@282: \\
greg@282: The configure CanFestival3 providing path to the desired PcanLight
greg@282: implementation:\\
greg@282: 
greg@282: 
greg@282: \texttt{export PCAN\_INCLUDE=\~{ }/Disk/PCAN-Light/Api/}
greg@282: 
greg@282: \texttt{export PCAN\_HEADER=Pcan\_pcc.h}
greg@282: 
greg@282: \texttt{export PCAN\_LIB=\~{ }/Disk/PCAN-Light/Lib/Visual\textbackslash{}
greg@282: C++/Pcan\_pcc.lib}
greg@282: 
greg@282: \texttt{export PCAN2\_HEADER=Pcan\_2pcc.h}
greg@282: 
greg@282: \texttt{export PCAN2\_LIB=\~{ }/Disk/PCAN-Light/Lib/Visual\textbackslash{}
greg@282: C++/Pcan\_2pcc.lib}~\\
greg@282: 
greg@282: 
greg@282: In order to test, just connect together both CAN ports of the PCMCIA
greg@282: card. Don't forget 120ohms terminator.
greg@282: 
greg@282: \texttt{cp\~{ }/Disk/PCAN-Light/Pcan\_pcc.dll ~.}
greg@282: 
greg@282: \texttt{cp \~{ }/Disk/PCAN-Light/Pcan\_2pcc.dll ~.}
greg@282: 
greg@282: \texttt{./examples/TestMasterSlave/TestMasterSlave \textbackslash{}}
greg@282: 
greg@282: \texttt{-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll -m 0 -s
greg@282: 1}~\\
greg@282: 
greg@282: 
greg@282: Messages are then exchanged between master and slave node, both inside
greg@282: TestMasterSlave's process.
greg@282: 
nico@208: \section{Motorola HCS12}
nico@208: The examples have been tested on a MC9S12DG255 mounted on a
nico@208: Elektronikladen HCS12 T{}-board.
nico@208: 
nico@208: Beware that there are a few differences in the MSCAN module of the
nico@208: 68HC12 and HCS12 microcontroller. For a HC12, you must adapt the driver
etisserant@249: that we provide for \space the HCS12.
nico@208: 
nico@208: For the difference MSCAN HC12/HCS12, see the Motorola application note
nico@208: AN2011/D.
nico@208: 
nico@208: Configure switch:
nico@208: 
nico@208: {\ttfamily
nico@208:  {}-{}-target=hcs12}
nico@208: 
nico@208: To do a CANopen node running on a microncontroller Motorola MC9S12DP256,
nico@208: you need :
nico@208: 
nico@208: \liststyleLx
nico@208: \begin{enumerate}
nico@208: \item The compiler GNU gcc for HC11, HC12, HCS12 : m6811{}-elf. \newline
nico@208: Download the \textbf{release 3.1} at :
etisserant@249: \space \href{http://m68hc11.serveftp.org/m68hc11_pkg_rpm.php}{http://m68hc11.serveftp.org/m68hc11\_pkg\_rpm.php}
nico@208: 
nico@208: \item A board with this chip. We are using the T{}-board from
nico@208: Electronikladden. 
nico@208: \item At least about 40 kBytes of program memory.
nico@208: \item A tool to flash the memory. (We are using the hight cost
nico@208: Lauterbach debugger).
nico@208: \end{enumerate}
nico@208: \subsection{Running a HCS12 node}
nico@208: \subsubsection{Compiling Canfestival:}
nico@208: {\ttfamily
nico@208: ./configure {--}target=hcs12}
nico@208: 
nico@208: \subsubsection{Compiling and building an example}
nico@208: Enter in the folder of an HCS12 example, 
nico@208: 
nico@208: {\ttfamily
nico@208: make all}
nico@208: 
nico@208: \subsubsection{Flashing the memory :}
nico@208: Use your prefered loader ! If you are using a debugger Lauterbach, you
nico@208: can load the bash file : trace32\_flash\_programmer.cmm. It loads
nico@208: directly the elf file.
nico@208: 
nico@208: \subsubsection{Connecting to a serial RS232 console :}
nico@208: Connect the portS(TxD0) of the HCS12 to a console configured at 19200
nico@208: bauds 8N1, via a Max232 chip to adapt the electricals levels. On Linux,
nico@208: you can use minicom. Connecting to a console is usefull to read the
nico@208: messages, but not required.
nico@208: 
nico@208: \subsubsection{Connecting to the CAN network :}
nico@208: Connect the port CAN0 (pin PM0, PM1) to the network via a CAN
nico@208: controller. On our board, the CAN controler is a PCA82C250 chip.
nico@208: 
nico@208: \subsubsection{starting the node :}
nico@208: Press the reset of your HCS12 board.
nico@208: 
nico@208: \section{Example and test program:}
nico@208: The ``examples'' directory contains some test program you can use as
nico@208: example for your own developments.
nico@208: 
nico@208: \subsection{TestMasterSlave}
nico@208: {\ttfamily
etisserant@249: **************************************************************\space}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space TestMasterSlave
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space A simple example for PC. It does implement 2 CanOpen \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space nodes in the same process. A master and a slave. Both \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space communicate together, exchanging periodically NMT, SYNC, \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space SDO and PDO. Master configure heartbeat producer time \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space at 1000 ms for slave node{}-id 0x02 by concise DCF.
etisserant@249: \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space Usage:
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space ./TestMasterSlave \space [OPTIONS]
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space OPTIONS:
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space \space {}-l : Can library
nico@208: [{\textquotedbl}libcanfestival\_can\_virtual.so{\textquotedbl}]
etisserant@249: \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space Slave:
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space \space {}-s : bus name [{\textquotedbl}0{\textquotedbl}]
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space \space {}-S : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space Master:
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space \space {}-m : bus name [{\textquotedbl}1{\textquotedbl}]
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space \space {}-M : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: **************************************************************}
nico@208: 
nico@208: 
nico@208: \bigskip
nico@208: 
nico@208: {\sffamily
nico@208: Notes for Concise DCF :}
nico@208: 
nico@208: 
nico@208: \bigskip
nico@208: 
nico@208: {\sffamily
etisserant@249:  In this example, Master configure \space heartbeat producer time at 1000 ms
nico@208: for slave node{}-id 0x02 by concise DCF according DS{}-302 profile. }
nico@208: 
nico@208: {\sffamily
nico@208:  }
nico@208: 
nico@208: {\sffamily
nico@208:  Index 0x1F22 , sub{}-index 0x00 of the master OD, correspond to the
nico@208: number of entries. This equal to the maximum possible nodeId (127).
nico@208: Each sub{}-index points to the Node{}-ID of the device, to which the
nico@208: configuration belongs. }
nico@208: 
nico@208: 
nico@208: \bigskip
nico@208: 
nico@208: {\sffamily
nico@208:  To add more parameters configurations to the slave, the value at
nico@208: sub{}-index 0x02 must be a binary stream (little{}-endian) following
etisserant@249: this structure :\newline
etisserant@249: \{
etisserant@249: (UNS32) nb of entries\newline
etisserant@249: (UNS16) index parameter 1\newline
etisserant@249: (UNS8) sub{}-index parameter 1\newline
etisserant@249: (UNS32) size data parameter 1\newline
etisserant@249: (DOMAIN) data parameter 1\newline
etisserant@249: (UNS16) index parameter 2\newline
etisserant@249: (UNS8) sub{}-index parameter 2\newline
etisserant@249: (UNS32) size data parameter 2\newline
etisserant@249: (DOMAIN) data parameter 2\newline
etisserant@249: \space \space \space \space \space ....\newline
etisserant@249: (UNS16) index parameter n\newline
etisserant@249: (UNS8) sub{}-index parameter n\newline
etisserant@249: (UNS32) size data parameter n\newline
etisserant@249: (DOMAIN) data parameter n\newline
etisserant@249: \}
etisserant@249: }
nico@208: 
nico@208: {\sffamily
nico@208:  So the binary value stream to configure heartbeat producer time must be
etisserant@249: :\newline
nico@208:     0100000017100002000000e803}
nico@208: 
nico@208: {\sffamily
nico@208: The slave node is configured just before the Master entering in
nico@208: Pre\_operational state.}
nico@208: 
nico@208: \subsection{gene\_SYNC\_HCS12 :}
nico@208: This is a simple CanOpen node that only send cyclic SYNC message. It
nico@208: demonstrate implementation on HCS12 based board.
nico@208: 
nico@208: 
nico@208: \bigskip
nico@208: 
nico@208: \subsection{TestMasterMicroMod }
nico@208: {\ttfamily
nico@208: **************************************************************}
nico@208: 
nico@208: {\ttfamily
etisserant@249: * \space TestMasterMicroMod
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space A simple example for PC.
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space A CanOpen master that control a MicroMod module:
etisserant@249: \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space {}- setup module TPDO 1 transmit type
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space {}- setup module RPDO 1 transmit type
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space {}- setup module hearbeatbeat period
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space {}- disable others TPDOs
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space {}- set state to operational
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space {}- send periodic SYNC
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space {}- send periodic RPDO 1 to Micromod (digital output) \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space {}- listen Micromod{\textquotesingle}s TPDO 1 (digital input)
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space {}- Mapping RPDO 1 bit per bit (digital input)
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space Usage:
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space ./TestMasterMicroMod \space [OPTIONS]
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space OPTIONS:
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space \space {}-l : Can library
nico@208: [{\textquotedbl}libcanfestival\_can\_virtual.so{\textquotedbl}]
etisserant@249: \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space Slave:
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space \space {}-i : Slave Node id format [0x01 , 0x7F]
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space Master:
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space \space {}-m : bus name [{\textquotedbl}1{\textquotedbl}]
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
etisserant@249: 
etisserant@249: {\ttfamily
etisserant@249: * \space \space \space \space {}-M : 1M,500K,250K,125K,100K,50K,20K,10K
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: *
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space *}
nico@208: 
nico@208: {\ttfamily
nico@208: **************************************************************}
nico@208: 
nico@208: \section{Developing a new node}
nico@208: Using provided examples as a base for your new node is generally a good
nico@208: idea. You can also use the provided *.od files as a base for your node
nico@208: object dictionary.
nico@208: 
nico@208: Creating a new CanOpen node implies to define the Object Dictionary of
nico@208: this node. For that, developer have to provide a C file. This C file
nico@208: contains the definition of all dictionary entries, and some kind of
nico@208: index table that helps the stack to access some entries directly.
nico@208: 
nico@208: \subsection{Using Dictionary Editor GUI}
nico@208: The Object Dictionary Editor is a WxPython based GUI that is used to
nico@208: create the C file needed to create a new CanOpen node. 
nico@208: 
nico@208: \subsubsection{Installation and usage on Linux}
nico@208: You first have to download and install Gnosis XML modules. This is
nico@208: automated by a Makefile rule.
nico@208: 
nico@208: {\ttfamily
nico@208: cd objdictgen}
nico@208: 
nico@208: {\ttfamily
nico@208: make}
nico@208: 
nico@208: Now start the editor.
nico@208: 
nico@208: {\ttfamily
nico@208: python objdictedit.py [od files...]}
nico@208: 
nico@208: \subsubsection{Installation and usage on Windows}
nico@208: Install Python (at least version 2.4) and wxPython (at least version
nico@208: 2.6.3.2).
nico@208: 
nico@208: Cygwin users can install Gnosis XML utils the same as Linux use. Just
nico@208: call make.
nico@208: 
nico@208: {\ttfamily
nico@208: cd objdictgen}
nico@208: 
nico@208: {\ttfamily
nico@208: make}
nico@208: 
nico@208: Others will have to download and intall Gnosis XML by hand :
nico@208: 
nico@208: {\ttfamily
nico@208: Gnosis Utils:}
nico@208: 
nico@208: {\ttfamily
nico@208: http://freshmeat.net/projects/gnosisxml/}
nico@208: 
nico@208: {\ttfamily
nico@208: http://www.gnosis.cx/download/Gnosis\_Utils.More/Gnosis\_Utils{}-1.2.1.win32{}-py24.exe}
nico@208: 
nico@208: {\ttfamily
nico@208: Get latest version.}
nico@208: 
nico@208: Download CanFestival archive and uncompress it. Use windows file
nico@208: explorer to go into CanFestival3{\textbackslash}objdicgten, and
nico@208: double{}-click on objdictedit.py.
nico@208: 
nico@208: \subsubsection{About}
nico@208: The Object Dictionary editor GUI is a python application that use the
nico@208: Model{}-View{}-Controller design pattern. It depends on WxPython to
nico@208: display view on any supported platform.
nico@208: 
nico@208:  \begin{center}
nico@211:    \includegraphics[width=7cm]{Pictures/10000201000001FC000001E5D65E8766.png}
nico@208: \end{center}
nico@208: 
nico@208: \subsubsection{Main view}
nico@208: Top list let you choose dictionary section, bottom left list is the
nico@208: selected index in that dictionary, and bottom right list are edited
nico@208: sub{}-indexes.
nico@208: 
nico@208:  \begin{center}
etisserant@249:    \includegraphics[width=12cm]{Pictures/10000201000003E7000001C7B0296577.png}
nico@208: \end{center}
nico@208: 
nico@208:  \begin{center}
nico@211:    \includegraphics[width=3cm]{Pictures/10000000000000B6000000DF1EDD1E73.png}
nico@208: \end{center}
nico@208:   \begin{center}
nico@211:    \includegraphics[width=3cm]{Pictures/10000000000000AC000000C9C3F53FA6.png}
nico@208: \end{center}
nico@208:  \begin{center}
nico@211:    \includegraphics[width=3cm]{Pictures/100000000000006D000000A31EC8CB54.png}
nico@208: \end{center}
nico@208:   \begin{center}
nico@211:    \includegraphics[width=3cm]{Pictures/10000000000000AA0000006014F74635.png}
nico@208: \end{center}
nico@208: 
nico@208: \subsubsection{New node}
nico@208: Edit your node name, ID and type. Choose your inherited specific
nico@208: profile.
nico@208: 
nico@208:  \begin{center}
nico@211:    \includegraphics[width=11cm]{Pictures/10000201000001CB0000015F4FC09B68.png}
nico@208: \end{center}
nico@208: 
nico@208: \subsubsection{Node info}
nico@208: Edit your node name, ID and type.
nico@208: 
nico@208:  \begin{center}
nico@211:    \includegraphics[width=7cm]{Pictures/10000201000001010000011DA724D25C.png}
nico@208: \end{center}
nico@208: 
nico@208: \subsubsection{Profile editor}
nico@208: Chose the used profile to edit.\newline
nico@208:  \begin{center}
nico@211:    \includegraphics[width=4cm]{Pictures/10000000000000AB000000C88F594413.png}
nico@208: \end{center}
nico@208: 
nico@208: Pick up optional chosen profile entries.\newline
nico@208:  \begin{center}
nico@211:    \includegraphics[width=11cm]{Pictures/10000201000002DE000001D82D89C224.png}
nico@208: \end{center}
nico@208: 
nico@208: \subsubsection{User types}
nico@208: Use User Types to implement value boundaries, and string lentgth\newline
nico@208:  \begin{center}
nico@211:    \includegraphics[width=11cm]{Pictures/10000201000001C40000010766961D7F.png}
nico@208: \end{center}
nico@208: 
nico@208: \subsubsection{Mapped variable}
nico@208: Add your own specific dictionary entries and associated mapped
nico@208: variables.\newline
nico@208:  \begin{center}
nico@211:    \includegraphics[width=11cm]{Pictures/10000201000001C4000000DD129D4661.png}
nico@208: \end{center}
nico@208: 
nico@208: \subsubsection{Integrated help}
nico@208: Using F1 key, you can get context sensitive help.\newline
nico@208:  \begin{center}
etisserant@249:    \includegraphics[width=12cm]{Pictures/10000201000002F30000020B23ED7F67.png}
nico@208: \end{center}
nico@208: 
nico@208: In order to do that, official 301\_v04000201.pdf file must be placed
nico@208: into doc/ directory, and xpdf must be present on your system.
nico@208: 
nico@208: F2 key open HTML CanFestival help.\newline
nico@208:  \begin{center}
etisserant@249:    \includegraphics[width=12cm]{Pictures/10000201000003440000025ACC3FD2F1.png}
nico@208: \end{center}
nico@208: 
nico@208: \subsection{Generating the object Dictionary}
nico@208: Once object dictionary has been edited and saved, you have to generate
nico@208: object dictionary C code for your CanFestival node.
nico@208: 
nico@208: \subsubsection{With GUI}
nico@208: Menu entry ``File/Build Dictionary''.
nico@208: 
nico@208:  \begin{center}
nico@211:    \includegraphics[width=4cm]{Pictures/10000201000000B7000000C66AF89CD5.png}
nico@208: \end{center}
nico@208: 
nico@208: Choose C file to create or overwrite. Header file will be also created
nico@208: with the same prefix as C file.
nico@208: 
nico@208: \subsubsection{With command line}
nico@208: {\ttfamily
nico@208: Usage of objdictgen.py :\newline
nico@208: python objdictgen.py XMLFilePath CfilePath}
nico@208: 
nico@208: \section{FAQ}
nico@208: \subsection{General}
nico@208: \subsubsection{Does the code compiles on Windows ?}
nico@208: Yes, with both Cygwin and Visual Studio C++.
nico@208: 
nico@208: Because CANopen layer is coded with C, put a compilation option /TC or
nico@208: /TP if you plan to mix C++ files. See the MSDN documentation about
nico@208: that.
nico@208: 
nico@208: \subsubsection{How to fit the library to an other microcontr\^oler ?}
nico@208: First, be sure that you have at least 40K bytes of program memory, and
nico@208: about 2k of RAM. 
nico@208: 
nico@208: You have to create target specific interface to HW resources. Take model
nico@208: on bundled interfaces provided in drivers/ and create your own
nico@208: interface. You also have to update Makefile.in files for target
nico@208: specific cflags and options. Chose {--}targer= configure switch to
nico@208: compile your specific interface.
nico@208: 
nico@208: You are welcome to contribute{}-back your own interfaces ! Other
nico@208: Canfestival users will use it and provide feedback, tests and
nico@208: enhancements.
nico@208: 
nico@208: \subsubsection{Is CanFestival3 conform to DS301 v.4.02 ?}
nico@208: Thanks to Philippe Foureys (IUT of Valence), a slave node have been
nico@208: tested with the National Instrument CanOpen Conformance Test. It passed
nico@208: the test with success.
nico@208: 
nico@208: Some very small unconformity have been found in very unusual situations,
nico@208: for example in the SDO code response to wrong messages.
nico@208: 
nico@208: \subsection{LINUX}
nico@208: \subsubsection{How to use a Peaksystem CAN board ?}
nico@208: Just install peak driver and then compile and install Canfestival. Peak
nico@208: driver is detected at compile time.
nico@208: 
nico@208: \subsubsection{How to use an unsupported CAN board ?}
nico@208: You have to install the specific driver on your system, with necessary
nico@208: libs and headers. 
nico@208: 
nico@208: Use can\_peak.c/h or can\_virtual.c/h as an example, and adapt it to
nico@208: your driver API.
nico@208: 
nico@208: Execute configure script and choose {}-{}-can=mydriver
nico@208: 
nico@208: \subsection{Win32}
nico@208: Compatibility:
nico@208: 
nico@208: \liststyleLxi
nico@208: \begin{enumerate}
nico@208: \item Code was compiled MS VisualStudio 2003.NET and VisualStudio
etisserant@249: 2005.NET for WindowsXP \space with ANSI and UNICODE configurations and for
nico@208: WindowsCE 5.0. 
nico@208: \item Some preliminary testing was done, but not enough to be used in
nico@208: mission critical projects.
nico@208: \end{enumerate}
nico@208: Additional Features:
nico@208: 
nico@208: \liststyleLxii
nico@208: \begin{enumerate}
nico@208: \item Non{}-integral integers support implementation UNS24, UNS40, UNS48
nico@208: etc.
nico@208: \item When enable debug output with DEBUG\_WAR\_CONSOLE\_ON or
nico@208: DEBUG\_ERR\_CONSOLE\_ON, you can navigate in CanFestival source code by
nico@208: double clicking at diagnostic lines in VisualStudio.NET 200X Debug
nico@208: Output Window.
nico@208: \end{enumerate}
nico@208: Custom size integral types such as INTEGER24, UNS40, INTEGER56 etc. have
nico@208: been defined as 64 bits integers. You will need to replace sizeof(TYPE)
nico@208: operators to sizeof\_TYPE definitions in generated code, i.e. replace
nico@208: sizeof(UNS40) with sizeof\_UNS40.
nico@208: 
nico@208: 
nico@208: \bigskip
nico@208: 
nico@208: \subsection{HCS12}
nico@208: \subsubsection{Which board are you using ?}
nico@208: A T{}-board from elektronikladen with a MC9S12DP256 or MC9S12DG256.
nico@208: 
nico@208: \subsubsection{Does the code compile with an other compiler than GNU gcc
nico@208: ?}
nico@208: It is known to work with Metrowerks CodeWarrior. Here are some tips from
nico@208: Philippe Foureys. :
nico@208: 
nico@208: \paragraph{Interrupt functions}
nico@208: \subparagraph{Code for GCC:}
nico@208: {\ttfamily
nico@208:  // prototype\newline
nico@208:  void \_\_attribute\_\_((interrupt))timer3Hdl(void):\newline
nico@208:  // function\newline
nico@208:  void \_\_attribute\_\_((interrupt))timer3Hdl(void)\{...\}}
nico@208: 
nico@208: \subparagraph{Code for CodeWarrior}
nico@208: {\ttfamily
nico@208:  // protoype\newline
nico@208:  void interrupt timer3Hdl(void);\newline
nico@208:  // function\newline
nico@208:  pragma CODE\_SEG\_\_NEAR\_SEG\_NON\_BANKED\newline
nico@208:  void interrupt timer3Hdl(void)\newline
nico@208:  \{...\}\newline
nico@208:  pragma CODE\_SEG\_DEFAULT}
nico@208: 
nico@208: \paragraph{Interrupt lock, unlock}
nico@208: \subparagraph{Code for GCC}
nico@208: {\ttfamily
nico@208:  void unlock (void)\newline
nico@208:  \{\newline
etisserant@249:   \space \_\_asm\_\_
nico@208: \_\_volatile\_\_({\textquotedbl}cli{\textquotedbl});\newline
nico@208:  \}\newline
nico@208:  void lock (void)\newline
nico@208:  \{\newline
etisserant@249:   \space unsigned short mask;\newline
etisserant@249:   \space \_\_asm\_\_
nico@208: \_\_volatile\_\_({\textquotedbl}tpa{\textbackslash}n{\textbackslash}tsei{\textquotedbl}:{\textquotedbl}=d{\textquotedbl}(mask));\newline
nico@208:  \}}
nico@208: 
nico@208: \subparagraph{Code for CodeWarrior}
nico@208: {\ttfamily
nico@208: void unlock (void)\newline
nico@208:  \{\newline
etisserant@249:   \space \_\_asm({\textquotedbl}cli{\textquotedbl});\newline
nico@208:  \}\newline
nico@208:  void lock (void)\newline
nico@208:  \{\newline
etisserant@249:   \space unsigned short mask;\newline
etisserant@249:   \space \_\_asm\newline
nico@208:   \{\newline
etisserant@249:   \space tpa:tsei:{\textquotedbl}=d{\textquotedbl}(mask);\newline
nico@208:   \}\newline
nico@208:  \}}
nico@208: 
nico@208: \paragraph{Initialize function}
nico@208: \subparagraph{Code for GCC}
nico@208: {\ttfamily
nico@208: void initCanHCS12 (void)\newline
etisserant@249:  \{ \space \newline
etisserant@249:   \space //Init the HCS12 microcontroler for CanOpen \newline
etisserant@249:   \space initHCS12();\newline
etisserant@249:   \space \space // Init the HCS12 \space CAN driver\newline
etisserant@249:   \space const canBusInit bi0 = \{\newline
etisserant@249:   \space \space \space 0, \space \space \space /* no low power \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space */
nico@208: \newline
etisserant@249:   \space \space \space 0, \space \space \space /* no time stamp
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space 1, \space \space \space /* enable MSCAN
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space 0, \space \space \space /* clock source : oscillator (In fact, it is not used)
etisserant@249: \space \space */\newline
etisserant@249:   \space \space \space 0, \space \space \space /* no loop back
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space 0, \space \space \space /* no listen only
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space 0, \space \space \space /* no low pass filter for wk up */\newline
etisserant@249:   \space CAN\_Baudrates[CAN\_BAUDRATE\_250K],\newline
etisserant@249:   \space \space \space \{\newline
etisserant@249:   \space \space \space \space \space 0x00, \space \space \space /* Filter on 16 bits.\newline
etisserant@249:   \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space See Motorola Block Guide V02.14 fig
nico@208: 4{}-3 */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 0 hight accept all msg
etisserant@249: \space \space \space \space \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 0 low accept all msg
etisserant@249: \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 1 hight filter all of \space msg
etisserant@249: \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 1 low filter all of \space msg
etisserant@249: \space \space \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 2 hight filter most of \space msg
nico@208: */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 2 low filter most of \space msg
etisserant@249: \space \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 3 hight filter most of \space msg
nico@208: */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 3 low filter most of \space msg
etisserant@249: \space \space */\newline
etisserant@249:   \space \space \space \}\newline
etisserant@249:   \space \};}
nico@208: 
nico@208: \subparagraph{Code for CodeWarrior}
nico@208: {\ttfamily
nico@208: void initCanHCS12 (void)\newline
etisserant@249:  \{ \space \newline
etisserant@249:   \space //Init the HCS12 microcontroler for CanOpen \newline
etisserant@249:   \space initHCS12();\newline
etisserant@249:   \space \space // Init the HCS12 \space CAN driver\newline
etisserant@249:   \space const canBusInit bi0 = \{\newline
etisserant@249:   \space \space \space 0, \space \space \space /* no low power \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space */
nico@208: \newline
etisserant@249:   \space \space \space 0, \space \space \space /* no time stamp
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space 1, \space \space \space /* enable MSCAN
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space 0, \space \space \space /* clock source : oscillator (In fact, it is not used)
etisserant@249: \space \space */\newline
etisserant@249:   \space \space \space 0, \space \space \space /* no loop back
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space 0, \space \space \space /* no listen only
etisserant@249: \space \space \space \space \space \space \space \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space 0, \space \space \space /* no low pass filter for wk up */\newline
etisserant@249:   \space \space \space \{\newline
etisserant@249:   \space \space \space \space 1, /* clksrc */\newline
etisserant@249:   \space \space \space \space 3, /* brp \space \space \space */\newline
etisserant@249:   \space \space \space \space 0, /* sjw \space \space \space */\newline
etisserant@249:   \space \space \space \space 0, /* samp \space \space */\newline
etisserant@249:   \space \space \space \space 1, /* tseg2 \space */\newline
etisserant@249:   \space \space \space \space 12,/* tseg1 \space */\newline
etisserant@249:   \space \space \space \},\newline
etisserant@249:   \space \space \space \{\newline
etisserant@249:   \space \space \space \space \space 0x00, \space \space \space /* Filter on 16 bits.\newline
etisserant@249:   \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space \space See Motorola Block Guide V02.14 fig
nico@208: 4{}-3 */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 0 hight accept all msg
etisserant@249: \space \space \space \space \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 0 low accept all msg
etisserant@249: \space \space \space \space \space \space \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 1 hight filter all of \space msg
etisserant@249: \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 1 low filter all of \space msg
etisserant@249: \space \space \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 2 hight filter most of \space msg
nico@208: */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 2 low filter most of \space msg
etisserant@249: \space \space */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 3 hight filter most of \space msg
nico@208: */\newline
etisserant@249:   \space \space \space \space \space 0x00, 0xFF, /* filter 3 low filter most of \space msg
etisserant@249: \space \space */\newline
etisserant@249:   \space \space \space \}\newline
etisserant@249:   \space \};}
nico@208: 
nico@208: \subsubsection{Does the code works in banked memory ?}
nico@208: No. Today it seems that the port of gcc is bogged for using the banked
nico@208: memory. So, unfortunately, we are limited to 48 Kbytes of memory code.
nico@208: 
nico@208: \subsubsection{What GCC version are you using ?}
nico@208: We are using the stable RPM release 2.2 :
nico@208: 
nico@208: \liststyleLxiii
nico@208: \begin{enumerate}
nico@208: \item GNU Gcc 3.0.4. Build 20030501
nico@208: \item Newlib 1.10.0 Build 20030421
nico@208: \item GNU Binutils 2.12.1 Build 20030427
nico@208: \end{enumerate}
etisserant@249: \section{Documentation resources\newline}
etisserant@249: \paragraph{CIA : Can in Automation\newline}
etisserant@249: Many documentation on CANopen.\newline
nico@208: \href{http://www.can-cia.de/}{http://www.can{}-cia.de}
nico@208: 
etisserant@249: \paragraph{Resources and training in CANopen\newline}
nico@208: \href{http://www.esacademy.com/}{http://www.esacademy.com}
nico@208: 
etisserant@249: \paragraph{Elektronikladen HCS12 T{}-board\newline}
nico@208: \href{http://www.elektronikladen.de/en_hcs12tb.html}{http://www.elektronikladen.de/en\_hcs12tb.html}
nico@208: 
etisserant@249: \paragraph{Gnu gcc compiler for HC12\newline}
nico@208: \href{http://m68hc11.serveftp.org/m68hc11_port.php}{http://m68hc11.serveftp.org/m68hc11\_port.php}
nico@208: 
etisserant@249: \paragraph{Motorola documentation on HC12\newline}
nico@208: \href{http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MC9S12DP256}{http://www.freescale.com/webapp/sps/site/prod\_summary.jsp?code=MC9S12DP256}
nico@208: 
etisserant@249: \paragraph{Lauterbach debugger for HC12\newline}
nico@208: \href{http://www.lauterbach.com/}{http://www.lauterbach.com}
nico@208: 
etisserant@249: \paragraph{Python language\newline}
nico@208: \href{http://www.python.org/}{http://www.python.org}
nico@208: 
nico@208: \clearpage\section{About the project}
nico@208: \subsection{Contributors }
nico@208:  \begin{center}
nico@211:    \includegraphics[width=10cm]{Pictures/1000020100000258000000832C6FFAB4.png}
nico@208: \end{center}
nico@208: 
nico@208: Unit\'e mixte de recherche INRETS{}-LCPC
nico@208: 
nico@208: sur les Interractions V\'ehicule{}-Infrastructure{}-Conducteur
nico@208: 
nico@208: 14, route de la mini\`ere
nico@208: 
nico@208: 78000 Versailles
nico@208: 
nico@208: FRANCE
nico@208: 
nico@208: Tel : +33 1 40 43 29 01
nico@208: 
nico@208: \href{http://www.inrets.fr/ur/livic}{http://www.inrets.fr/ur/livic}
nico@208: 
nico@208: \textbf{Contributors :} Francis DUPIN
nico@208: 
nico@208:    Camille BOSSARD
nico@208: 
nico@208:    Laurent ROMIEUX
nico@208: 
nico@208: 
nico@208: \bigskip
nico@208: 
nico@208:  \begin{center}
nico@211:    \includegraphics[width=10cm]{Pictures/100002010000013A0000004A96B0C1FF.png}
nico@208: \end{center}
nico@208: 
nico@208: LOLITECH
nico@208: 
nico@208: 204, rue du Haut du Pin
nico@208: 
nico@208: 88470 Saint{}-Michel sur Meurthe
nico@208: 
nico@208: FRANCE
nico@208: 
nico@208: Tel : +33 3 29 52 95 67
nico@208: 
nico@208: \href{http://www.lolitech.fr/}{http://www.lolitech.fr}
nico@208: 
nico@208: {\bfseries
nico@208: Contributors : \textmd{Edouard TISSERANT (Original author)}}
nico@208: 
nico@208: {\mdseries
nico@208:    Laurent BESSARD}
nico@208: 
nico@208: 
nico@208: \bigskip
nico@208: 
nico@208: Many thanks to the other contributors for their great work:
nico@208: 
nico@208: \textmd{   }Raphael ZULLIGER
nico@208: 
nico@208: \textmd{   }David DUMINY (st\'e A6R)
nico@208: 
nico@208: \textmd{   }Zakaria BELAMRI
nico@208: 
nico@208: \subsection{Getting support}
nico@208: Send your feedback and bug reports to
nico@208: \href{mailto:canfestival-devel@lists.sourceforge.net}{canfestival{}-devel@lists.sourceforge.net}.
nico@208: 
etisserant@249: For commercial support, \space training and specific integration and
nico@208: developments, please ask LOLITECH (see contributors).
nico@208: 
nico@208: \subsection{Contributing}
nico@208: You are free to contribute your specific interfaces back to the project.
nico@208: This way, you can hope to get support from CanFestival users community.
nico@208: 
nico@208: Please send your patch to
nico@208: \href{mailto:canfestival-devel@lists.sourceforge.net}{canfestival{}-devel@lists.sourceforge.net}.
nico@208: 
nico@208: Feel free to create some new predefined DS{}-4xx profiles (*.prf) in
nico@208: objdictgen/config, as much as possible respectful to the official
nico@208: specifications.
nico@208: 
nico@208: \subsection{License}
nico@208: All the project is licensed with LGPL. This mean you can link
nico@208: CanFestival with any code without being obliged to publish it.
nico@208: 
nico@208: {\ttfamily
nico@208: \#This file is part of CanFestival, a library implementing CanOpen
nico@208: Stack. \newline
nico@208: \# \newline
nico@208: \#Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD
nico@208: \newline
nico@208: \# \newline
nico@208: \#See COPYING file for copyrights details. \newline
nico@208: \# \newline
nico@208: \#This library is free software; you can redistribute it and/or \newline
nico@208: \#modify it under the terms of the GNU Lesser General Public \newline
nico@208: \#License as published by the Free Software Foundation; either \newline
nico@208: \#version 2.1 of the License, or (at your option) any later version.
nico@208: \newline
nico@208: \# \newline
nico@208: \#This library is distributed in the hope that it will be useful,
nico@208: \newline
nico@208: \#but WITHOUT ANY WARRANTY; without even the implied warranty of
nico@208: \newline
etisserant@249: \#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \space See the GNU
nico@208: \newline
nico@208: \#Lesser General Public License for more details. \newline
nico@208: \# \newline
nico@208: \#You should have received a copy of the GNU Lesser General Public
nico@208: \newline
nico@208: \#License along with this library; if not, write to the Free Software
nico@208: \newline
nico@208: \#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
etisserant@249: \space 02111{}-1307 \space USA }
nico@208: 
nico@208: 
nico@208: \bigskip
etisserant@249: 
nico@208: \end{document}




