author | peter |
Fri, 07 Mar 2008 16:02:59 +0100 | |
changeset 414 | d6d31c35676b |
parent 394 | b8755668c9e2 |
child 440 | dfcec7403169 |
permissions | -rw-r--r-- |
393 | 1 |
\documentclass[12pt,english,a4paper]{book} |
208 | 2 |
\usepackage[T1]{fontenc} |
393 | 3 |
\usepackage[latin9]{inputenc} |
4 |
\usepackage{graphicx} |
|
5 |
\usepackage{amsfonts} |
|
6 |
\usepackage{textcomp} |
|
208 | 7 |
\usepackage{color} |
8 |
\usepackage{calc} |
|
9 |
\usepackage{longtable} |
|
10 |
\usepackage{hyperref} |
|
11 |
\usepackage{graphics} |
|
12 |
\DeclareGraphicsExtensions{.jpg} |
|
13 |
\DeclareGraphicsExtensions{.png} |
|
14 |
\hypersetup{colorlinks=true, linkcolor=blue, filecolor=blue, pagecolor=blue, urlcolor=blue} |
|
15 |
||
16 |
%%%%\%%%%%%%% titre, auteurs, date, etc...%%%%%%%%%%%%%%%%%% |
|
249 | 17 |
\title{\Huge The CanFestival CANOpen stack manual} |
208 | 18 |
\author{Edouard TISSERANT} |
19 |
\date{\today} |
|
20 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
21 |
\setcounter{secnumdepth}{5} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
22 |
\renewcommand\thesection{\arabic{section} -} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
23 |
\renewcommand\thesubsection{\arabic{section}.\arabic{subsection})} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
24 |
\renewcommand\thesubsubsection{\arabic{section}.\arabic{subsection}.\arabic{subsubsection})} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
25 |
\renewcommand\theparagraph{\alph{paragraph})} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
26 |
\renewcommand\thesubparagraph{\roman{subparagraph})} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
27 |
|
393 | 28 |
\newcommand{\canopen}{CANopen } |
392
3788feef57e0
Some typo fixes in the manual, thanks to Yegor Yefremov (VisionSystems)
etisserant
parents:
391
diff
changeset
|
29 |
|
208 | 30 |
\begin{document} |
393 | 31 |
{\centering\textsf{\huge The CanFestival \canopen stack manual.}} |
32 |
||
33 |
\renewcommand{\contentsname}{CanFestival v3.0 Manual} |
|
34 |
\setcounter{tocdepth}{2} \tableofcontents{} |
|
35 |
||
36 |
\clearpage{} |
|
37 |
||
208 | 38 |
\section{Introduction} |
393 | 39 |
|
40 |
CanFestival is an OpenSource (LGPL and GPL) \canopen framework. |
|
208 | 41 |
|
42 |
\subsection{The CanFestival project} |
|
393 | 43 |
|
44 |
This project, initiated by Edouard TISSERANT in 2001, has grown thanks |
|
45 |
to Francis DUPIN and other contributors. |
|
46 |
||
47 |
Today, CanFestival focuses on providing an ANSI-C platform independent |
|
48 |
\canopen stack that can be implemented as master or slave nodes on |
|
49 |
PCs, Real-time IPCs, and Microcontrollers. |
|
208 | 50 |
|
51 |
CanFestival is a project supported by Lolitech. |
|
52 |
||
393 | 53 |
|
54 |
\subsection{What is \canopen} |
|
55 |
||
56 |
CANopen is a CAN based high level protocol. It defines some protocols |
|
57 |
to : |
|
58 |
||
208 | 59 |
\begin{enumerate} |
393 | 60 |
\item Configure a CAN network. |
61 |
\item Transmit data to a specific node or in broadcast. |
|
62 |
\item Administrate the network. For example detecting a not responding node. |
|
208 | 63 |
\end{enumerate} |
392
3788feef57e0
Some typo fixes in the manual, thanks to Yegor Yefremov (VisionSystems)
etisserant
parents:
391
diff
changeset
|
64 |
The documentation can be found on the CAN in Automation website : |
208 | 65 |
|
393 | 66 |
\href{http://www.can-cia.de/canopen}{http://www.can-cia.de/canopen} |
67 |
||
68 |
The most important document about \canopen is the normative CiA Draft |
|
69 |
Standard 301, version 4.02. You can now download the specification |
|
70 |
from the CAN in Automation website at no cost. |
|
71 |
||
72 |
To continue reading this document, let us assume that you have read |
|
73 |
some papers introducing \canopen . |
|
74 |
||
208 | 75 |
|
76 |
\section{CanFestival Features} |
|
393 | 77 |
|
78 |
||
208 | 79 |
\subsection{Tools } |
393 | 80 |
|
81 |
The \canopen library is coming with some tools : |
|
82 |
||
208 | 83 |
\begin{enumerate} |
393 | 84 |
\item Object Dictionary editor GUI. WxPython Model-View-Controler based |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
85 |
GUI, that helps a lot in generating object dictionary source code for |
393 | 86 |
each node. |
87 |
\item A configure script, that let you chose compile time options such as |
|
88 |
target CPU/HOST, CAN and TIMER drivers.\\ |
|
89 |
This script has not been generated with autoconf, it has been made |
|
90 |
keeping micro-controller target in mind. |
|
208 | 91 |
\end{enumerate} |
393 | 92 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
93 |
\subsection{Multi-Platform} |
393 | 94 |
|
208 | 95 |
\begin{enumerate} |
393 | 96 |
\item Library source code is C-ANSI. |
97 |
\item Driver and examples coding conventions merely depend on target specific |
|
98 |
contributor/compiler. |
|
208 | 99 |
\item Unix compatible interfaces and examples should compile and run on |
393 | 100 |
any Unix system (tested on GNU/Linux and GNU/FreeBSD). |
208 | 101 |
\end{enumerate} |
393 | 102 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
103 |
\subsection{\canopen standard conformance} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
104 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
105 |
\subsubsection{DS-301} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
106 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
107 |
Supported features should conform to DS301. V.4.02 13 february 2002. |
393 | 108 |
|
208 | 109 |
\begin{enumerate} |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
110 |
\item NMT master and slave |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
111 |
\item Heartbeat consumer and producer |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
112 |
\item NodeGuard slave reponder and basic master without tracking |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
113 |
\item SYNC service |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
114 |
\item SDO multiples client and server, segmented and expedited |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
115 |
\item PDO : TPDO and RPDO, with respect to transmission type |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
116 |
\item PDO mapping from/to OD variables bit per bit. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
117 |
\item EMCY : Send and receive and keeps track of emergency objects |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
118 |
\item Data types : 8 to 64 bits values, fixed length strings. |
208 | 119 |
\end{enumerate} |
393 | 120 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
121 |
\subsubsection{DS-302} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
122 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
123 |
Only concise DFC is supported. |
393 | 124 |
|
208 | 125 |
\section{How to start} |
393 | 126 |
|
208 | 127 |
\subsection{Host requirements} |
393 | 128 |
|
208 | 129 |
What you need on your development workstation. |
130 |
||
131 |
\subsubsection{Object Dictionary Editor GUI} |
|
393 | 132 |
|
208 | 133 |
\begin{enumerate} |
134 |
\item Python, with |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
135 |
\item wxPython modules installed (at least version 2.6.3). |
393 | 136 |
\item Gnosis xml tools. (Optional can also be installed locally to the project |
137 |
automatically with the help of a Makefile. Please see {}``Using Dictionary |
|
138 |
Editor GUI'' ) |
|
208 | 139 |
\end{enumerate} |
393 | 140 |
|
141 |
\subsubsection{Linux and Unix-likes} |
|
142 |
||
208 | 143 |
\begin{enumerate} |
393 | 144 |
\item Linux, FreeBSD, Cygwin or any Unix environment with GNU toolchain. |
145 |
\item The GNU C compiler (gcc) or any other ANSI-C compiler for your target |
|
146 |
platform. |
|
208 | 147 |
\item Xpdf, and the official 301\_v04000201.pdf file in order to get GUI |
393 | 148 |
context sensitive help. |
149 |
\item GNU Make |
|
150 |
\item Bash and sed |
|
208 | 151 |
\end{enumerate} |
393 | 152 |
|
208 | 153 |
\subsubsection{Windows (for native win32 target)} |
393 | 154 |
|
208 | 155 |
\begin{enumerate} |
393 | 156 |
\item Visual Studio Express 2005 or worst. |
157 |
\item Microsoft platform SDK (requires Genuine Advantage) |
|
158 |
\item Cygwin (for configuration only) |
|
208 | 159 |
\end{enumerate} |
393 | 160 |
|
208 | 161 |
\subsection{How to get CanFestival} |
393 | 162 |
|
208 | 163 |
Please always use CVS, this is the best way to get the most reactive |
164 |
support from the developer community : |
|
165 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
166 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
167 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
168 |
cvs -d:pserver:anonymous@lolitech.dyndns.org:/canfestival login |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
169 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
170 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
171 |
(type return, without entering a password) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
172 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
173 |
Then, enter : |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
174 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
175 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
176 |
cvs -z3 -d:pserver:anonymous@lolitech.dyndns.org:/canfestival co -P CanFestival-3 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
177 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
178 |
|
393 | 179 |
|
208 | 180 |
|
181 |
\section{Understanding Canfestival} |
|
393 | 182 |
|
208 | 183 |
\subsection{CanFestival Project tree layout} |
393 | 184 |
|
208 | 185 |
Simplified directory structure. |
186 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
187 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
188 |
./src ANSI-C source of \canopen stack |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
189 |
./include Exportables Header files |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
190 |
./drivers Interfaces to specific platforms/HW |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
191 |
./drivers/unix Linux and Cygwin OS interface |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
192 |
./drivers/win32 Native Win32 OS interface |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
193 |
./drivers/timers_xeno Xenomai timers/threads (Linux only) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
194 |
./drivers/timers_kernel Linux kernel timer/threads |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
195 |
./drivers/timers_unix Posix timers/threads (Linux, Cygwin) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
196 |
./drivers/can_virtual_kernel Fake CAN network (kernel space) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
197 |
./drivers/can_peak_linux PeakSystem CAN library interface |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
198 |
./drivers/can_peak_win32 PeakSystem PCAN-Light interface |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
199 |
./drivers/can_uvccm_win32 Acacetus's RS232 CAN-uVCCM interface |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
200 |
./drivers/can_virtual Fake CAN network (Linux, Cygwin) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
201 |
./drivers/hcs12 HCS12 full target interface |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
202 |
./examples Examples |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
203 |
./examples/TestMasterSlave 2 nodes, NMT SYNC SDO PDO, win32+unix |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
204 |
./examples/TestMasterMicroMod 1 node, control Peak I/O Module, unix |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
205 |
./examples/gene_SYNC_HCS12 Just send periodic SYNC on HCS12 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
206 |
./examples/win32test Ask some DS301 infos to a node (win32) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
207 |
./objdictgen Object Dictionary editor GUI |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
208 |
./objdictgen/config Pre-defined OD profiles |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
209 |
./objdictgen/examples Some examples/test OD |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
210 |
./doc Documentation source |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
211 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
212 |
|
393 | 213 |
|
208 | 214 |
|
215 |
\subsection{Implement CanFestival in your application} |
|
393 | 216 |
|
217 |
\begin{center} |
|
218 |
\includegraphics[width=12cm]{Pictures/10000201000003F9000002CF880931E7} |
|
219 |
\par\end{center} |
|
220 |
||
221 |
\bigskip{} |
|
222 |
||
223 |
||
208 | 224 |
|
225 |
\subsection{CanFestival CAN interfaces} |
|
393 | 226 |
|
208 | 227 |
Because most CAN controllers and drivers implement FIFOs, CanFestival |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
228 |
consider sending message as a non blocking operation. |
208 | 229 |
|
393 | 230 |
In order to prevent reentrent calls to the stack, messages reception |
231 |
is implemented differently on {\textmu}C and OS.: |
|
232 |
||
208 | 233 |
\begin{enumerate} |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
234 |
\item {\textmu}C must provide interruption masking, mutually excluding timer and CAN receive interrupts.\\ |
393 | 235 |
|
236 |
||
237 |
||
238 |
\begin{center} |
|
239 |
\includegraphics[width=12cm]{Pictures/10000201000003CA0000016604E6A5EF} |
|
240 |
\par\end{center} |
|
241 |
||
208 | 242 |
\item OS must provide a receive thread, a timer thread and a mutex. CAN |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
243 |
reception should be a bloking operation.\\ |
393 | 244 |
|
245 |
||
246 |
||
247 |
\begin{center} |
|
248 |
\includegraphics[width=12cm]{Pictures/10000201000003F9000002CF8B0CDAEA} |
|
249 |
\par\end{center} |
|
250 |
||
208 | 251 |
\end{enumerate} |
393 | 252 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
253 |
\subsection{CanFestival event scheduling} |
393 | 254 |
|
255 |
A \canopen node must be able to take delayed actions. |
|
208 | 256 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
257 |
For instance, periodic sync emission, heartbeat production or SDO timeout |
208 | 258 |
need to set some alarms that will be called later and do the job. |
259 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
260 |
{\textmu}C generally do not have enough free timers to handle all |
393 | 261 |
the \canopen needs directly. Moreover, CanFestival internal data |
262 |
may be corrupt by reentrant calls. |
|
263 |
||
264 |
CanFestival implement a micro -scheduler (timer.c). It uses only one |
|
208 | 265 |
timer to mimic many timers. It manage an alarm table, and call alarms |
266 |
at desired time. |
|
267 |
||
268 |
\begin{center} |
|
393 | 269 |
\includegraphics[width=12cm]{Pictures/100000000000022C000000DEDAD2140C} |
270 |
\par\end{center} |
|
271 |
||
272 |
Scheduler can handle short clock value ranges limitation found on |
|
273 |
some {\textmu}C. As an example, value range for a 16bit clock counter |
|
274 |
with 4{\textmu}s tick is crossed within 0.26 seconds... Long alarms |
|
275 |
must be segmented. |
|
276 |
||
277 |
Chronogram illustrate a long alarm (A) and a short periodic alarm |
|
278 |
(B), with a A value {\textgreater} clock range {\textgreater} |
|
279 |
B value. Values t0...t8 are successive setTimer call parameter values. |
|
280 |
t1 illustrates an intermediate call to TimeDispatch, caused by a delay |
|
281 |
longer than clock range. Because of long alarm segmentation, at the |
|
282 |
end of t1, TimeDispatch call will not trig any alarm callback. |
|
283 |
||
284 |
\begin{center} |
|
285 |
\includegraphics[width=12cm]{Pictures/1000000000000396000000FFC42573DA} |
|
286 |
\par\end{center} |
|
287 |
||
208 | 288 |
|
289 |
\section{Linux Target} |
|
393 | 290 |
|
208 | 291 |
Linux target is default configure target. |
292 |
||
393 | 293 |
|
208 | 294 |
\subsection{Linux Compilation and installation} |
393 | 295 |
|
296 |
Call ./configure -- help to see all available compile time options. |
|
208 | 297 |
|
298 |
After invoking ./configure with your platform specific switches, just |
|
299 |
type make. |
|
300 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
301 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
302 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
303 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
304 |
./configure [options] |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
305 |
make |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
306 |
make install |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
307 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
308 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
309 |
|
393 | 310 |
|
208 | 311 |
|
312 |
\subsubsection{Standard Linux node} |
|
393 | 313 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
314 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
315 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
316 |
./configure --timers=unix |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
317 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
318 |
|
393 | 319 |
|
320 |
To do a \canopen node running on PC -Linux, you need : |
|
321 |
||
208 | 322 |
\begin{enumerate} |
393 | 323 |
\item A working linux distribution |
324 |
\item One or more Peak system PC CAN interface and the last Peak Linux driver |
|
325 |
installed. |
|
208 | 326 |
\end{enumerate} |
393 | 327 |
|
328 |
\subsubsection{Real -Time Linux node} |
|
329 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
330 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
331 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
332 |
./configure --timers=xeno |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
333 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
334 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
335 |
|
393 | 336 |
|
337 |
To do a \canopen node running on PC -Linux, you need : |
|
338 |
||
208 | 339 |
\begin{enumerate} |
393 | 340 |
\item A working Linux distribution patched with XENOMAI 2.1 or greater. |
341 |
\item One or more Peak system PC CAN interface and the last Peak Real Time |
|
342 |
Linux driver installed. |
|
208 | 343 |
\end{enumerate} |
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
284
diff
changeset
|
344 |
|
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
284
diff
changeset
|
345 |
\subsubsection{Linux kernel node} |
393 | 346 |
|
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
284
diff
changeset
|
347 |
To do a CANopen node running on PC-Linux in kernel space, you need: |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
284
diff
changeset
|
348 |
|
393 | 349 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
350 |
\begin{enumerate} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
351 |
\item A working Linux distribution with pre-built 2.6.x.x kernel sources |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
352 |
\item A CAN card driver compatible with CanFestival |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
353 |
\end{enumerate} |
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
284
diff
changeset
|
354 |
|
393 | 355 |
|
208 | 356 |
\subsubsection{CAN devices} |
393 | 357 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
358 |
Currently supported CAN devices and corresponding configure switch: |
208 | 359 |
|
393 | 360 |
|
208 | 361 |
\paragraph{Peak systems} |
393 | 362 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
363 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
364 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
365 |
./configure --can=peak_linux |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
366 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
367 |
|
393 | 368 |
|
369 |
PeakSystems CAN interface is automatically chosen as default CAN interface |
|
370 |
if libpcan is present in the system. |
|
371 |
||
372 |
Please download driver at \href{http://www.peak-system.com/linux}{http://www.peak |
|
373 |
-system.com/linux} and follow instructions in order to install driver |
|
374 |
on your system. |
|
375 |
||
376 |
||
377 |
\paragraph{Socket -Can (http://socketcan.berlios.de)} |
|
378 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
379 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
380 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
381 |
./configure --can=socket |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
382 |
\end{verbatim} |
393 | 383 |
|
208 | 384 |
|
385 |
\paragraph{LinCan} |
|
393 | 386 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
387 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
388 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
389 |
./configure --can=lincan |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
390 |
\end{verbatim} |
393 | 391 |
|
208 | 392 |
|
393 |
\paragraph{Virtual CAN interfaces (for test/debug)} |
|
393 | 394 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
395 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
396 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
397 |
./configure --can=virtual |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
398 |
or, for kernel space: |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
399 |
./configure --can=kernel_virtual |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
400 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
401 |
|
208 | 402 |
|
403 |
Virtual CAN interface use Unix pipes to emulate a virtual CAN network. |
|
404 |
Each message issued from a node is repeat to all other nodes. Currently |
|
405 |
only works with nodes running in the same process, and does not support |
|
406 |
work with Xenomai. |
|
407 |
||
393 | 408 |
|
208 | 409 |
\subsection{Testing your CanFestival installation} |
393 | 410 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
411 |
\subsection{User space} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
412 |
|
208 | 413 |
Sample provided in /example/TestMasterSlave is installed into your |
414 |
system during installation. |
|
415 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
416 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
417 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
418 |
TestMasterSlave |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
419 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
420 |
|
208 | 421 |
|
392
3788feef57e0
Some typo fixes in the manual, thanks to Yegor Yefremov (VisionSystems)
etisserant
parents:
391
diff
changeset
|
422 |
Default CAN driver library is libcanfestival\_can\_virtual.so., which |
208 | 423 |
will simply pass CAN messages through Unix pipes between Master and |
393 | 424 |
Slave. |
425 |
||
426 |
You may also want to specify different can interface and define some |
|
427 |
CAN ports. Another example using Peak{\textquotesingle}s dual PCMCIA |
|
428 |
(configure and install with --can=peak) : |
|
429 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
430 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
431 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
432 |
TestMasterSlave -l libcanfestival_can_peak.so -s 40 -m 41 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
433 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
434 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
435 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
436 |
\subsection{Kernel space} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
437 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
438 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
439 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
440 |
example/kerneltest |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
441 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
442 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
443 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
444 |
It's based on TestMasterSlave example |
393 | 445 |
and has the same functionality. Uses virtual can driver as default |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
446 |
too. After successful installation you can insert the module by typing: |
393 | 447 |
modprobe canf\_ktest Module control is done by simple console 'canf\_ktest\_console' |
448 |
which is used to start/stop sending data. |
|
449 |
||
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
284
diff
changeset
|
450 |
|
208 | 451 |
\section{Windows Targets} |
393 | 452 |
|
208 | 453 |
CanFestival can be compiled and run on Windows platform. It is possible |
454 |
to use both Cygwin and win32 native runtime environment. |
|
455 |
||
456 |
\subsection{Object Dictionary Editor GUI installation.} |
|
393 | 457 |
|
458 |
Please refer to \hyperlink{a821UsingDictionaryEditorGUIoutline}{8.2.1)Using |
|
459 |
Dictionary Editor GUI} |
|
460 |
||
208 | 461 |
\subsection{CYGWIN} |
393 | 462 |
|
208 | 463 |
\subsubsection{Requirements} |
393 | 464 |
|
208 | 465 |
Cygwin have to be installed with those packages : |
466 |
||
467 |
\begin{enumerate} |
|
393 | 468 |
\item gcc |
469 |
\item unzip |
|
470 |
\item wget |
|
471 |
\item make |
|
208 | 472 |
\end{enumerate} |
473 |
Currently, the only supported CAN devices are PeakSystems ones, with |
|
393 | 474 |
PcanLight driver and library. |
475 |
||
476 |
Please download driver at \href{http://www.peak-system.com/themen/download_gb.html}{http://www.peak |
|
477 |
-system.com/themen/download\_gb.html} \ and follow instructions |
|
478 |
in order to install driver on your system. |
|
208 | 479 |
|
480 |
Install Cygwin as required, and the driver for your Peak CAN device. |
|
481 |
||
482 |
Open a Cygwin terminal, and follow those instructions: |
|
483 |
||
393 | 484 |
|
208 | 485 |
\subsubsection{Cygwin configuration and compilation} |
393 | 486 |
|
487 |
||
488 |
\paragraph{A single node with PcanLight and Peak CAN -USB adapter} |
|
489 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
490 |
Download the PCAN-Light Zip file for your HW ( URL from download |
393 | 491 |
page ): |
492 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
493 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
494 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
495 |
wget http://www.peak -system.com/files/usb.zip |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
496 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
497 |
|
393 | 498 |
|
499 |
Extract its content into your cygwin home (it will create a {}``Disk'' |
|
208 | 500 |
directory): |
501 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
502 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
503 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
504 |
unzip usb.zip |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
505 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
506 |
|
393 | 507 |
|
508 |
Configure CanFestival3 providing path to the desired PcanLight implementation: |
|
509 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
510 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
511 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
512 |
cd CanFestival -3 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
513 |
export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
514 |
export PCAN_HEADER=Pcan_usb.h |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
515 |
export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_usb.lib |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
516 |
./configure --can=peak_win32 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
517 |
make |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
518 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
519 |
|
393 | 520 |
|
521 |
In order to test, you have to use another CanFestival node, connect |
|
522 |
with a CAN cable. |
|
523 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
524 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
525 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
526 |
cp ~/Disk/PCAN-Light/Pcan_usb.dll . |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
527 |
./examples/TestMasterSlave/TestMasterSlave \ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
528 |
-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll \ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
529 |
-S 500K -M none |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
530 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
531 |
|
208 | 532 |
|
533 |
Then, on the other node : |
|
534 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
535 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
536 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
537 |
./TestMasterSlave -l my_driver.so -S none -M 500K |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
538 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
539 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
540 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
541 |
Now messages are being exchanged between master and slave node. |
393 | 542 |
|
543 |
\paragraph{Two nodes with PcanLight and Peak dual PCMCIA -CAN adapter} |
|
544 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
545 |
Download the PCAN-Light Zip file for your HW ( URL from download |
393 | 546 |
page ): |
547 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
548 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
549 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
550 |
wget http://www.peak-system.com/files/pccard.zip |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
551 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
552 |
|
393 | 553 |
|
554 |
Extract its content into your cygwin home (it will create a {}``Disk'' |
|
208 | 555 |
directory): |
556 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
557 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
558 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
559 |
unzip pccard.zip |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
560 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
561 |
|
208 | 562 |
|
563 |
The configure CanFestival3 providing path to the desired PcanLight |
|
564 |
implementation: |
|
565 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
566 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
567 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
568 |
export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
569 |
export PCAN_HEADER=Pcan_pcc.h |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
570 |
export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_pcc.lib |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
571 |
export PCAN2_HEADER=Pcan_2pcc.h |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
572 |
export PCAN2_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_2pcc.lib |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
573 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
574 |
|
208 | 575 |
|
576 |
In order to test, just connect together both CAN ports of the PCMCIA |
|
577 |
card. Don{\textquotesingle}t forget 120ohms terminator. |
|
578 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
579 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
580 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
581 |
cp ~/Disk/PCAN-Light/Pcan_pcc.dll . |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
582 |
cp ~/Disk/PCAN-Light/Pcan_2pcc.dll . |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
583 |
./examples/TestMasterSlave/TestMasterSlave \ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
584 |
-l drivers/can_peak_win32/cygcan_peak_win32.dll |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
585 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
586 |
|
208 | 587 |
|
588 |
Messages are then exchanged between master and slave node, both inside |
|
589 |
TestMasterSlave{\textquotesingle}s process. |
|
590 |
||
591 |
\subsection{Visual Studio C++} |
|
393 | 592 |
|
208 | 593 |
\subsubsection{Requirements} |
393 | 594 |
|
208 | 595 |
Minimal Cygwin installation is required at configuration time in order |
596 |
to create specific header files (config.h and cancfg.h). Once this |
|
597 |
files created, cygwin is not necessary any more. |
|
598 |
||
599 |
Project and solution files have been created and tested with Visual |
|
393 | 600 |
Studio Express 2005. Be sure to have installed Microsoft Platform |
601 |
SDK, as recommended at the end of Visual Studio installation. |
|
602 |
||
208 | 603 |
|
604 |
\subsubsection{Configuration with cygwin} |
|
393 | 605 |
|
606 |
Follow instructions given at \hyperlink{Cygwin configuration and compilation}{Cygwin |
|
208 | 607 |
configuration and compilation}, but do neither call make nor do tests, |
608 |
just do configuration steps. This will create headers files accordingly |
|
609 |
to your configuration parameters, and the desired CAN hardware. |
|
610 |
||
393 | 611 |
|
208 | 612 |
\subsubsection{Compilation with Visual Studio} |
393 | 613 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
614 |
You can either load independent {}``{*}.vcproj'' project files |
393 | 615 |
along your own projects in your own solution or load the provided |
616 |
{}``CanFestival -3.vc8.sln'' solution files directly. |
|
617 |
||
618 |
Build CanFestival -3 project first. |
|
619 |
||
208 | 620 |
|
621 |
\paragraph{PcanLight and the can\_peak\_win32 project.} |
|
393 | 622 |
|
208 | 623 |
Chosen Pcan\_xxx.lib and eventually Pcan\_2xxx.lib files must be added |
393 | 624 |
to can\_peak\_win32 \ \ project before build of the DLL. |
625 |
||
208 | 626 |
|
627 |
\subsubsection{Testing} |
|
393 | 628 |
|
629 |
Copy eventually needed dlls (ie : Pcan\_Nxxx.lib) into Release or |
|
630 |
Debug directory, and run the test program: |
|
631 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
632 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
633 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
634 |
TestMasterSlave.exe -l can_peak_win32.dll |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
635 |
\end{verbatim} |
393 | 636 |
|
208 | 637 |
|
282 | 638 |
\subsection{MSYS} |
639 |
||
640 |
||
641 |
\subsubsection{Requirements} |
|
642 |
||
643 |
Download from : http://sourceforge.net/project/showfiles.php?group\_id=2435 |
|
644 |
||
645 |
\begin{enumerate} |
|
393 | 646 |
\item MSYS-1.0.10.exe |
647 |
\item MinGW-5.1.3.exe |
|
648 |
\item mingwPORT (which contains wget-1.9.1) |
|
282 | 649 |
\end{enumerate} |
650 |
Please download driver at http://www.peak-system.com/themen/download\_gb.html |
|
651 |
and follow instructions in order to install driver on your system. |
|
652 |
Install MSYS and MingW as required, and the driver for your Peak CAN |
|
653 |
device. Open a MSYS terminal, and follow those instructions:\\ |
|
654 |
||
655 |
||
656 |
\begin{itemize} |
|
393 | 657 |
\item extract wget-1.9.1-mingwPORT.tar.bz2 |
658 |
\item copy wget.exe in c:\textbackslash{} msys\textbackslash{} 1.0\textbackslash{} |
|
659 |
bin\textbackslash{} |
|
282 | 660 |
\item start MSYS and check the file /etc/fstab contain the line c:/MinGW |
393 | 661 |
/mingw |
282 | 662 |
\end{itemize} |
663 |
||
664 |
\subsubsection{MSYS configuration and compilation} |
|
665 |
||
393 | 666 |
Instructions for compilation are nearly the same as CYGWIN part. |
282 | 667 |
|
668 |
||
669 |
\paragraph{A single node with PcanLight and Peak CAN-USB adapter} |
|
670 |
||
671 |
Download the PCAN-Light Zip file for your HW ( URL from download page |
|
672 |
): |
|
673 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
674 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
675 |
wget http://www.peak-system.com/files/usb.zip |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
676 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
677 |
|
393 | 678 |
Extract its content into your MSYS's home (it will create a \char`\"{} |
679 |
Disk\char`\"{} directory): |
|
680 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
681 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
682 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
683 |
unzip usb.zip |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
684 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
685 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
686 |
|
282 | 687 |
Configure CanFestival3 providing path to the desired PcanLight implementation: |
688 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
689 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
690 |
cd CanFestival-3 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
691 |
export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
692 |
export PCAN_HEADER=Pcan_usb.h |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
693 |
export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_usb.lib |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
694 |
./configure --can=peak_win32 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
695 |
make |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
696 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
697 |
|
282 | 698 |
In order to test, you have to use another CanFestival node, connect |
699 |
with a CAN cable. |
|
700 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
701 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
702 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
703 |
cp ~/Disk/PCAN-Light/Pcan_usb.dll . |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
704 |
./examples/TestMasterSlave/TestMasterSlave \ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
705 |
-l drivers/can_peak_win32/cygcan_peak_win32.dll \ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
706 |
-S 500K -M none |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
707 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
708 |
|
282 | 709 |
Then, on the other node : |
710 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
711 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
712 |
./TestMasterSlave -l my_driver.so -S none -M 500K -m 0 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
713 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
714 |
Now messages are being exchanged between master and slave node. |
282 | 715 |
|
716 |
||
717 |
\paragraph{Two nodes with PcanLight and Peak dual PCMCIA-CAN adapter} |
|
718 |
||
719 |
Download the PCAN-Light Zip file for your HW ( URL from download page |
|
720 |
): |
|
721 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
722 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
723 |
wget http://www.peak-system.com/files/pccard.zip |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
724 |
\end{verbatim} |
393 | 725 |
Extract its content into your MSYS's home (it will create a \char`\"{} |
726 |
Disk\char`\"{} directory): |
|
727 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
728 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
729 |
unzip pccard.zip |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
730 |
\end{verbatim} |
282 | 731 |
The configure CanFestival3 providing path to the desired PcanLight |
393 | 732 |
implementation: |
733 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
734 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
735 |
export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
736 |
export PCAN_HEADER=Pcan_pcc.h} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
737 |
export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_pcc.lib |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
738 |
export PCAN2_HEADER=Pcan_2pcc.h |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
739 |
export PCAN2_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_2pcc.lib |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
740 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
741 |
|
282 | 742 |
In order to test, just connect together both CAN ports of the PCMCIA |
743 |
card. Don't forget 120ohms terminator. |
|
744 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
745 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
746 |
cp~/Disk/PCAN-Light/Pcan_pcc.dll ~. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
747 |
cp ~/Disk/PCAN-Light/Pcan_2pcc.dll ~. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
748 |
./examples/TestMasterSlave/TestMasterSlave \ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
749 |
-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll -m 0 -s 1 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
750 |
\end{verbatim} |
282 | 751 |
Messages are then exchanged between master and slave node, both inside |
752 |
TestMasterSlave's process. |
|
753 |
||
208 | 754 |
\section{Motorola HCS12} |
393 | 755 |
|
756 |
The examples have been tested on a MC9S12DG255 mounted on a Elektronikladen |
|
757 |
HCS12 T -board. |
|
758 |
||
759 |
Beware that there are few differences in the MSCAN module of the 68HC12 |
|
760 |
and HCS12 microcontroller. For a HC12, you must adapt the driver that |
|
761 |
we provide for \ the HCS12. |
|
762 |
||
763 |
For the difference MSCAN HC12/HCS12, see the Motorola application |
|
764 |
note AN2011/D. |
|
208 | 765 |
|
766 |
Configure switch: |
|
767 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
768 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
769 |
--target=hcs12 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
770 |
\end{verbatim} |
393 | 771 |
|
772 |
To do a \canopen node running on a microncontroller Motorola MC9S12DP256, |
|
208 | 773 |
you need : |
774 |
||
775 |
\begin{enumerate} |
|
393 | 776 |
\item The compiler GNU gcc for HC11, HC12, HCS12 : m6811 -elf. \\ |
777 |
Download the \textbf{release 3.1} at : \href{http://m68hc11.serveftp.org/m68hc11_pkg_rpm.php}{http://m68hc11.serveftp.org/m68hc11\_pkg\_rpm.php} |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
778 |
\item A board with this chip. We are using the T -board from Electronikladen. |
393 | 779 |
\item At least about 40 kBytes of program memory. |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
780 |
\item A tool to flash the memory. (We are using the high cost Lauterbach |
393 | 781 |
debugger). |
208 | 782 |
\end{enumerate} |
393 | 783 |
|
208 | 784 |
\subsection{Running a HCS12 node} |
393 | 785 |
|
786 |
||
208 | 787 |
\subsubsection{Compiling Canfestival:} |
393 | 788 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
789 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
790 |
./configure --target=hcs12 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
791 |
\end{verbatim} |
393 | 792 |
|
208 | 793 |
|
794 |
\subsubsection{Compiling and building an example} |
|
393 | 795 |
|
796 |
Enter in the folder of an HCS12 example, |
|
797 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
798 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
799 |
make all |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
800 |
\end{verbatim} |
393 | 801 |
|
208 | 802 |
|
803 |
\subsubsection{Flashing the memory :} |
|
393 | 804 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
805 |
Use your preferred loader ! If you are using a debugger Lauterbach, |
393 | 806 |
you can load the bash file : trace32\_flash\_programmer.cmm. It loads |
208 | 807 |
directly the elf file. |
808 |
||
393 | 809 |
|
208 | 810 |
\subsubsection{Connecting to a serial RS232 console :} |
393 | 811 |
|
208 | 812 |
Connect the portS(TxD0) of the HCS12 to a console configured at 19200 |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
813 |
bauds 8N1, via a Max232 chip to adapt the electrical levels. On Linux, |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
814 |
you can use minicom. Connecting to a console is useful to read the |
208 | 815 |
messages, but not required. |
816 |
||
393 | 817 |
|
208 | 818 |
\subsubsection{Connecting to the CAN network :} |
393 | 819 |
|
820 |
Connect the port CAN0 (pin PM0, PM1) to the network via a CAN controller. |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
821 |
On our board, the CAN controller is a PCA82C250 chip. |
393 | 822 |
|
208 | 823 |
|
824 |
\subsubsection{starting the node :} |
|
393 | 825 |
|
208 | 826 |
Press the reset of your HCS12 board. |
827 |
||
393 | 828 |
|
208 | 829 |
\section{Example and test program:} |
393 | 830 |
|
831 |
The {}``examples'' directory contains some test program you can |
|
832 |
use as example for your own developments. |
|
833 |
||
208 | 834 |
|
835 |
\subsection{TestMasterSlave} |
|
393 | 836 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
837 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
838 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
839 |
************************************************************** |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
840 |
* TestMasterSlave * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
841 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
842 |
* A simple example for PC. It does implement 2 CanOpen * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
843 |
* nodes in the same process. A master and a slave. Both * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
844 |
* communicate together, exchanging periodically NMT, SYNC, * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
845 |
* SDO and PDO. Master configure heartbeat producer time * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
846 |
* at 1000 ms for slave node-id 0x02 by concise DCF. * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
847 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
848 |
* Usage: * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
849 |
* ./TestMasterSlave [OPTIONS] * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
850 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
851 |
* OPTIONS: * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
852 |
* -l : Can library ["libcanfestival_can_virtual.so"] * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
853 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
854 |
* Slave: * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
855 |
* -s : bus name ["0"] * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
856 |
* -S : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
857 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
858 |
* Master: * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
859 |
* -m : bus name ["1"] * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
860 |
* -M : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
861 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
862 |
************************************************************** |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
863 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
864 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
865 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
866 |
Notes aboute use of voncise DCF : |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
867 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
868 |
In this example, Master configure heartbeat producer time |
393 | 869 |
at 1000 ms for slave node -id 0x02 by concise DCF according DS -302 |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
870 |
profile. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
871 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
872 |
Index 0x1F22, sub-index 0x00 of the master OD, correspond |
393 | 873 |
to the number of entries. This equal to the maximum possible nodeId |
874 |
(127). Each sub -index points to the Node -ID of the device, to which |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
875 |
the configuration belongs. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
876 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
877 |
To add more parameters configurations to the slave, the value |
393 | 878 |
at sub -index 0x02 must be a binary stream (little -endian) following |
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
879 |
this structure : |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
880 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
881 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
882 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
883 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
884 |
(UNS32) nb of entries |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
885 |
(UNS16) index parameter 1 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
886 |
(UNS8) sub -index parameter 1 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
887 |
(UNS32) size data parameter 1 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
888 |
(DOMAIN) data parameter 1 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
889 |
(UNS16) index parameter 2 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
890 |
(UNS8) sub -index parameter 2 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
891 |
(UNS32) size data parameter 2 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
892 |
(DOMAIN) data parameter 2 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
893 |
.... |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
894 |
(UNS16) index parameter n |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
895 |
(UNS8) sub -index parameter n |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
896 |
(UNS32) size data parameter n |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
897 |
(DOMAIN) data parameter n |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
898 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
899 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
900 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
901 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
902 |
So the binary value stream to configure heartbeat producer |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
903 |
time must be : |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
904 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
905 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
906 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
907 |
0100000017100002000000e803 |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
908 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
909 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
910 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
911 |
The slave node is configured just before the Master entering |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
912 |
in Pre\_operational state. |
393 | 913 |
|
208 | 914 |
|
915 |
\subsection{gene\_SYNC\_HCS12 :} |
|
393 | 916 |
|
917 |
This is a simple \canopen node that only send cyclic SYNC message. |
|
918 |
It demonstrate implementation on HCS12 based board. |
|
919 |
||
920 |
\bigskip{} |
|
921 |
||
922 |
||
923 |
||
391
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
284
diff
changeset
|
924 |
\subsection{kerneltest :} |
7802a7d5584f
Accepted Vladimir Chren linux kernelspace port patch.
etisserant
parents:
284
diff
changeset
|
925 |
|
393 | 926 |
Example based on TestMasterSlave slightly modified to suit kernel |
927 |
space requisites. It will do the same as TestMasterSlave but in kernel |
|
928 |
space sending kernel messages (displayed by dmesg for example). It |
|
929 |
is designed as external kernel module implemented as character device. |
|
930 |
There is a shell script called 'insert.sh', which will insert the |
|
931 |
module and create a new device file /dev/canf\_ktest (used to sending |
|
932 |
commands to module). To actual sending commands you can use simple |
|
933 |
console named 'canf\_ktest\_console'. The module is dependent on a |
|
934 |
another separate module 'canfestival.ko' implementing CanOpen stack |
|
935 |
which exports requisite functions. Canfestival.ko module is then dependent |
|
936 |
on CAN card driver module, by default CAN virtual driver will be loaded. |
|
937 |
After installing modules (make install), all dependencies are solved |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
938 |
automatically by kernel. To run the example type: |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
939 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
940 |
sh run.sh |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
941 |
\end{verbatim} |
393 | 942 |
It will insert required modules, start console, and after quitting |
943 |
console it'll remove modules from kernel. |
|
944 |
||
945 |
\bigskip{} |
|
946 |
||
947 |
||
208 | 948 |
|
949 |
\subsection{TestMasterMicroMod } |
|
393 | 950 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
951 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
952 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
953 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
954 |
************************************************************** |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
955 |
* TestMasterMicroMod * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
956 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
957 |
* A simple example for PC. * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
958 |
* A CanOpen master that control a MicroMod module: * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
959 |
* - setup module TPDO 1 transmit type * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
960 |
* - setup module RPDO 1 transmit type * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
961 |
* - setup module hearbeatbeat period * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
962 |
* - disable others TPDOs * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
963 |
* - set state to operational * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
964 |
* - send periodic SYNC * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
965 |
* - send periodic RPDO 1 to Micromod (digital output) * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
966 |
* - listen Micromod's TPDO 1 (digital input) * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
967 |
* - Mapping RPDO 1 bit per bit (digital input) * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
968 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
969 |
* Usage: * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
970 |
* ./TestMasterMicroMod [OPTIONS] * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
971 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
972 |
* OPTIONS: * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
973 |
* -l : Can library ["libcanfestival_can_virtual.so"] * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
974 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
975 |
* Slave: * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
976 |
* -i : Slave Node id format [0x01 , 0x7F] * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
977 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
978 |
* Master: * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
979 |
* -m : bus name ["1"] * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
980 |
* -M : 1M,500K,250K,125K,100K,50K,20K,10K * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
981 |
* * |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
982 |
************************************************************** |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
983 |
\end{verbatim} |
393 | 984 |
|
208 | 985 |
|
986 |
\section{Developing a new node} |
|
393 | 987 |
|
988 |
Using provided examples as a base for your new node is generally a |
|
989 |
good idea. You can also use the provided {*}.od files as a base for |
|
990 |
your node object dictionary. |
|
991 |
||
992 |
Creating a new \canopen node implies to define the Object Dictionary |
|
993 |
of this node. For that, developer has to provide a C file. This C |
|
994 |
file contains the definition of all dictionary entries, and some kind |
|
995 |
of index table that helps the stack to access some entries directly. |
|
996 |
||
208 | 997 |
|
998 |
\subsection{Using Dictionary Editor GUI} |
|
393 | 999 |
|
1000 |
The Object Dictionary Editor is a WxPython based GUI that is used |
|
1001 |
to create the C file needed to create a new \canopen node. |
|
1002 |
||
208 | 1003 |
|
1004 |
\subsubsection{Installation and usage on Linux} |
|
393 | 1005 |
|
208 | 1006 |
You first have to download and install Gnosis XML modules. This is |
1007 |
automated by a Makefile rule. |
|
1008 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1009 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1010 |
cd objdictgen |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1011 |
make |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1012 |
\end{verbatim} |
208 | 1013 |
|
1014 |
Now start the editor. |
|
1015 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1016 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1017 |
python objdictedit.py [od files...] |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1018 |
\end{verbatim} |
393 | 1019 |
|
208 | 1020 |
|
1021 |
\subsubsection{Installation and usage on Windows} |
|
393 | 1022 |
|
208 | 1023 |
Install Python (at least version 2.4) and wxPython (at least version |
1024 |
2.6.3.2). |
|
1025 |
||
1026 |
Cygwin users can install Gnosis XML utils the same as Linux use. Just |
|
1027 |
call make. |
|
1028 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1029 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1030 |
cd objdictgen |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1031 |
make |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1032 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1033 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1034 |
Others will have to download and install Gnosis XML by hand : |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1035 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1036 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1037 |
Gnosis Utils: |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1038 |
http://freshmeat.net/projects/gnosisxml/ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1039 |
http://www.gnosis.cx/download/ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1040 |
Get latest version. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1041 |
\end{verbatim} |
393 | 1042 |
|
1043 |
Download CanFestival archive and uncompress it. Use windows file explorer |
|
1044 |
to go into CanFestival3\textbackslash{}objdicgten, and double -click |
|
1045 |
on objdictedit.py. |
|
1046 |
||
208 | 1047 |
\subsubsection{About} |
393 | 1048 |
|
1049 |
The Object Dictionary editor GUI is a python application that use |
|
1050 |
the Model-View-Controller design pattern. It depends on WxPython to |
|
208 | 1051 |
display view on any supported platform. |
1052 |
||
393 | 1053 |
\begin{center} |
1054 |
\includegraphics[width=7cm]{Pictures/10000201000001FC000001E5D65E8766} |
|
1055 |
\par\end{center} |
|
1056 |
||
208 | 1057 |
|
1058 |
\subsubsection{Main view} |
|
393 | 1059 |
|
208 | 1060 |
Top list let you choose dictionary section, bottom left list is the |
1061 |
selected index in that dictionary, and bottom right list are edited |
|
393 | 1062 |
sub -indexes. |
1063 |
||
1064 |
\begin{center} |
|
1065 |
\includegraphics[width=12cm]{Pictures/10000201000003E7000001C7B0296577} |
|
1066 |
\par\end{center} |
|
1067 |
||
1068 |
\begin{center} |
|
1069 |
\includegraphics[width=3cm]{Pictures/10000000000000B6000000DF1EDD1E73} |
|
1070 |
\par\end{center} |
|
1071 |
||
1072 |
\begin{center} |
|
1073 |
\includegraphics[width=3cm]{Pictures/10000000000000AC000000C9C3F53FA6} |
|
1074 |
\par\end{center} |
|
1075 |
||
1076 |
\begin{center} |
|
1077 |
\includegraphics[width=3cm]{Pictures/100000000000006D000000A31EC8CB54} |
|
1078 |
\par\end{center} |
|
1079 |
||
1080 |
\begin{center} |
|
1081 |
\includegraphics[width=3cm]{Pictures/10000000000000AA0000006014F74635} |
|
1082 |
\par\end{center} |
|
1083 |
||
208 | 1084 |
|
1085 |
\subsubsection{New node} |
|
393 | 1086 |
|
1087 |
Edit your node name, ID and type. Choose your inherited specific profile. |
|
1088 |
||
1089 |
\begin{center} |
|
1090 |
\includegraphics[width=11cm]{Pictures/10000201000001CB0000015F4FC09B68} |
|
1091 |
\par\end{center} |
|
1092 |
||
208 | 1093 |
|
1094 |
\subsubsection{Node info} |
|
393 | 1095 |
|
208 | 1096 |
Edit your node name, ID and type. |
1097 |
||
393 | 1098 |
\begin{center} |
1099 |
\includegraphics[width=7cm]{Pictures/10000201000001010000011DA724D25C} |
|
1100 |
\par\end{center} |
|
1101 |
||
208 | 1102 |
|
1103 |
\subsubsection{Profile editor} |
|
393 | 1104 |
|
1105 |
Chose the used profile to edit. |
|
1106 |
||
1107 |
\begin{center} |
|
1108 |
\includegraphics[width=4cm]{Pictures/10000000000000AB000000C88F594413} |
|
1109 |
\par\end{center} |
|
1110 |
||
1111 |
Pick up optional chosen profile entries. |
|
1112 |
||
1113 |
\begin{center} |
|
1114 |
\includegraphics[width=11cm]{Pictures/10000201000002DE000001D82D89C224} |
|
1115 |
\par\end{center} |
|
1116 |
||
208 | 1117 |
|
1118 |
\subsubsection{User types} |
|
393 | 1119 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1120 |
Use User Types to implement value boundaries, and string length |
393 | 1121 |
|
1122 |
\begin{center} |
|
1123 |
\includegraphics[width=11cm]{Pictures/10000201000001C40000010766961D7F} |
|
1124 |
\par\end{center} |
|
1125 |
||
208 | 1126 |
|
1127 |
\subsubsection{Mapped variable} |
|
393 | 1128 |
|
1129 |
Add your own specific dictionary entries and associated mapped variables. |
|
1130 |
||
1131 |
\begin{center} |
|
1132 |
\includegraphics[width=11cm]{Pictures/10000201000001C4000000DD129D4661} |
|
1133 |
\par\end{center} |
|
1134 |
||
208 | 1135 |
|
1136 |
\subsubsection{Integrated help} |
|
393 | 1137 |
|
1138 |
Using F1 key, you can get context sensitive help. |
|
1139 |
||
1140 |
\begin{center} |
|
1141 |
\includegraphics[width=12cm]{Pictures/10000201000002F30000020B23ED7F67} |
|
1142 |
\par\end{center} |
|
208 | 1143 |
|
1144 |
In order to do that, official 301\_v04000201.pdf file must be placed |
|
1145 |
into doc/ directory, and xpdf must be present on your system. |
|
1146 |
||
393 | 1147 |
F2 key open HTML CanFestival help. |
1148 |
||
1149 |
\begin{center} |
|
1150 |
\includegraphics[width=12cm]{Pictures/10000201000003440000025ACC3FD2F1} |
|
1151 |
\par\end{center} |
|
1152 |
||
208 | 1153 |
|
1154 |
\subsection{Generating the object Dictionary} |
|
393 | 1155 |
|
208 | 1156 |
Once object dictionary has been edited and saved, you have to generate |
1157 |
object dictionary C code for your CanFestival node. |
|
1158 |
||
393 | 1159 |
|
208 | 1160 |
\subsubsection{With GUI} |
393 | 1161 |
|
1162 |
Menu entry {}``File/Build Dictionary''. |
|
1163 |
||
1164 |
\begin{center} |
|
1165 |
\includegraphics[width=4cm]{Pictures/10000201000000B7000000C66AF89CD5} |
|
1166 |
\par\end{center} |
|
208 | 1167 |
|
1168 |
Choose C file to create or overwrite. Header file will be also created |
|
1169 |
with the same prefix as C file. |
|
1170 |
||
393 | 1171 |
|
208 | 1172 |
\subsubsection{With command line} |
393 | 1173 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1174 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1175 |
Usage of objdictgen.py : |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1176 |
python objdictgen.py XMLFilePath CfilePath |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1177 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1178 |
|
393 | 1179 |
|
208 | 1180 |
|
1181 |
\section{FAQ} |
|
393 | 1182 |
|
1183 |
||
208 | 1184 |
\subsection{General} |
393 | 1185 |
|
1186 |
||
208 | 1187 |
\subsubsection{Does the code compiles on Windows ?} |
393 | 1188 |
|
1189 |
Yes, with both Cygwin and Visual Studio C++. |
|
1190 |
||
1191 |
Because \canopen layer is coded with C, put a compilation option |
|
1192 |
/TC or /TP if you plan to mix C++ files. See the MSDN documentation |
|
1193 |
about that. |
|
1194 |
||
1195 |
||
1196 |
\subsubsection{How to fit the library to an other microcontrôler ?} |
|
1197 |
||
1198 |
First, be sure that you have at least 40K bytes of program memory, |
|
1199 |
and about 2k of RAM. |
|
1200 |
||
1201 |
You have to create target specific interface to HW resources. Take |
|
1202 |
model on bundled interfaces provided in drivers/ and create your own |
|
1203 |
interface. You also have to update Makefile.in files for target specific |
|
1204 |
cflags and options. Choose {--}target= configure switch to compile |
|
1205 |
your specific interface. |
|
1206 |
||
1207 |
You are welcome to contribute -back your own interfaces! Other Canfestival |
|
1208 |
users will use it and provide feedback, tests and enhancements. |
|
1209 |
||
208 | 1210 |
|
1211 |
\subsubsection{Is CanFestival3 conform to DS301 v.4.02 ?} |
|
393 | 1212 |
|
208 | 1213 |
Thanks to Philippe Foureys (IUT of Valence), a slave node have been |
393 | 1214 |
tested with the National Instrument \canopen Conformance Test. It |
1215 |
passed the test with success. |
|
208 | 1216 |
|
1217 |
Some very small unconformity have been found in very unusual situations, |
|
1218 |
for example in the SDO code response to wrong messages. |
|
1219 |
||
393 | 1220 |
|
208 | 1221 |
\subsection{LINUX} |
393 | 1222 |
|
1223 |
||
208 | 1224 |
\subsubsection{How to use a Peaksystem CAN board ?} |
393 | 1225 |
|
1226 |
Just install peak driver and then compile and install Canfestival. |
|
1227 |
Peak driver is detected at compile time. |
|
1228 |
||
208 | 1229 |
|
1230 |
\subsubsection{How to use an unsupported CAN board ?} |
|
393 | 1231 |
|
208 | 1232 |
You have to install the specific driver on your system, with necessary |
393 | 1233 |
libs and headers. |
1234 |
||
1235 |
Use can\_peak.c/h or can\_virtual.c/h as an example, and adapt it |
|
1236 |
to your driver API. |
|
1237 |
||
1238 |
Execute configure script and choose --can=mydriver |
|
1239 |
||
208 | 1240 |
|
1241 |
\subsection{Win32} |
|
393 | 1242 |
|
208 | 1243 |
Compatibility: |
1244 |
||
1245 |
\begin{enumerate} |
|
393 | 1246 |
\item Code was compiled MS VisualStudio 2003.NET and VisualStudio 2005.NET |
1247 |
for WindowsXP \ with ANSI and UNICODE configurations and for WindowsCE |
|
1248 |
5.0. |
|
1249 |
\item Some preliminary testing was done, but not enough to be used in mission |
|
1250 |
critical projects. |
|
208 | 1251 |
\end{enumerate} |
1252 |
Additional Features: |
|
1253 |
||
1254 |
\begin{enumerate} |
|
393 | 1255 |
\item Non -integral integers support implementation UNS24, UNS40, UNS48 |
1256 |
etc. |
|
1257 |
\item When enable debug output with DEBUG\_WAR\_CONSOLE\_ON or DEBUG\_ERR\_CONSOLE\_ON, |
|
1258 |
you can navigate in CanFestival source code by double clicking at |
|
1259 |
diagnostic lines in VisualStudio.NET 200X Debug Output Window. |
|
208 | 1260 |
\end{enumerate} |
393 | 1261 |
Custom size integral types such as INTEGER24, UNS40, INTEGER56 etc. |
1262 |
have been defined as 64 bits integers. You will need to replace sizeof(TYPE) |
|
208 | 1263 |
operators to sizeof\_TYPE definitions in generated code, i.e. replace |
1264 |
sizeof(UNS40) with sizeof\_UNS40. |
|
1265 |
||
1266 |
||
1267 |
\subsection{HCS12} |
|
393 | 1268 |
|
1269 |
||
208 | 1270 |
\subsubsection{Which board are you using ?} |
393 | 1271 |
|
1272 |
A T -board from elektronikladen with a MC9S12DP256 or MC9S12DG256. |
|
1273 |
||
1274 |
||
1275 |
\subsubsection{Does the code compile with an other compiler than GNU gcc ?} |
|
1276 |
||
1277 |
It is known to work with Metrowerks CodeWarrior. Here are some tips |
|
1278 |
from Philippe Foureys. : |
|
1279 |
||
208 | 1280 |
|
1281 |
\paragraph{Interrupt functions} |
|
393 | 1282 |
|
1283 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1284 |
\subparagraph{Code for GCC: |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1285 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1286 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1287 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1288 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1289 |
// prototype |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1290 |
void __attribute__((interrupt))timer3Hdl(void): |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1291 |
// function |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1292 |
void __attribute__((interrupt))timer3Hdl(void){...} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1293 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1294 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1295 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1296 |
\subparagraph{Code for CodeWarrior |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1297 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1298 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1299 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1300 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1301 |
// protoype |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1302 |
void interrupt timer3Hdl(void); |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1303 |
// function |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1304 |
pragma CODE_SEG__NEAR_SEG_NON_BANKED |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1305 |
void interrupt timer3Hdl(void) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1306 |
{...} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1307 |
pragma CODE_SEG_DEFAULT\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1308 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1309 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1310 |
\paragraph{Interrupt lock, unlock |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1311 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1312 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1313 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1314 |
\subparagraph{Code for GCC |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1315 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1316 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1317 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1318 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1319 |
void unlock (void) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1320 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1321 |
__asm__ __volatile__("cli"); |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1322 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1323 |
void lock (void) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1324 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1325 |
unsigned short mask; |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1326 |
__asm__ __volatile__("tpa\n\tsei":"=d"(mask)); |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1327 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1328 |
\end{verbatim} |
393 | 1329 |
|
208 | 1330 |
|
1331 |
\subparagraph{Code for CodeWarrior} |
|
393 | 1332 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1333 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1334 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1335 |
void unlock (void) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1336 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1337 |
__asm("cli"); |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1338 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1339 |
void lock (void) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1340 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1341 |
unsigned short mask; |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1342 |
__asm |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1343 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1344 |
tpa:tsei:"=d"(mask); |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1345 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1346 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1347 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1348 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1349 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1350 |
\paragraph{Initialize function} |
393 | 1351 |
|
1352 |
||
208 | 1353 |
\subparagraph{Code for GCC} |
393 | 1354 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1355 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1356 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1357 |
void initCanHCS12 (void) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1358 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1359 |
//Init the HCS12 microcontroler for CanOpen |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1360 |
initHCS12(); |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1361 |
// Init the HCS12 CAN driver |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1362 |
const canBusInit bi0 = { |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1363 |
0, /* no low power */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1364 |
0, /* no time stamp */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1365 |
1, /* enable MSCAN */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1366 |
0, /* clock source : oscillator (In fact, it is not used) */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1367 |
0, /* no loop back */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1368 |
0, /* no listen only */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1369 |
0, /* no low pass filter for wk up */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1370 |
CAN_Baudrates[CAN_BAUDRATE_250K], |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1371 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1372 |
0x00, /* Filter on 16 bits. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1373 |
See Motorola Block Guide V02.14 fig 4-3 */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1374 |
0x00, 0xFF, /* filter 0 hight accept all msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1375 |
0x00, 0xFF, /* filter 0 low accept all msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1376 |
0x00, 0xFF, /* filter 1 hight filter all of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1377 |
0x00, 0xFF, /* filter 1 low filter all of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1378 |
0x00, 0xFF, /* filter 2 hight filter most of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1379 |
0x00, 0xFF, /* filter 2 low filter most of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1380 |
0x00, 0xFF, /* filter 3 hight filter most of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1381 |
0x00, 0xFF, /* filter 3 low filter most of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1382 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1383 |
}; |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1384 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1385 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1386 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1387 |
\subparagraph{Code for CodeWarrior |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1388 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1389 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1390 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1391 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1392 |
void initCanHCS12 (void) |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1393 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1394 |
//Init the HCS12 microcontroler for CanOpen |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1395 |
initHCS12(); |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1396 |
// Init the HCS12 CAN driver |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1397 |
const canBusInit bi0 = { |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1398 |
0, /* no low power */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1399 |
0, /* no time stamp */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1400 |
1, /* enable MSCAN */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1401 |
0, /* clock source : oscillator (In fact, it is not used) */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1402 |
0, /* no loop back */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1403 |
0, /* no listen only */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1404 |
0, /* no low pass filter for wk up */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1405 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1406 |
1, /* clksrc */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1407 |
3, /* brp */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1408 |
0, /* sjw */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1409 |
0, /* samp */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1410 |
1, /* tseg2 */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1411 |
12,/* tseg1 */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1412 |
}, |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1413 |
{ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1414 |
0x00, /* Filter on 16 bits. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1415 |
See Motorola Block Guide V02.14 fig 4-3 */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1416 |
0x00, 0xFF, /* filter 0 hight accept all msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1417 |
0x00, 0xFF, /* filter 0 low accept all msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1418 |
0x00, 0xFF, /* filter 1 hight filter all of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1419 |
0x00, 0xFF, /* filter 1 low filter all of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1420 |
0x00, 0xFF, /* filter 2 hight filter most of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1421 |
0x00, 0xFF, /* filter 2 low filter most of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1422 |
0x00, 0xFF, /* filter 3 hight filter most of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1423 |
0x00, 0xFF, /* filter 3 low filter most of msg */ |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1424 |
} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1425 |
}; |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1426 |
\end{verbatim} |
393 | 1427 |
|
208 | 1428 |
|
1429 |
\subsubsection{Does the code works in banked memory ?} |
|
393 | 1430 |
|
208 | 1431 |
No. Today it seems that the port of gcc is bogged for using the banked |
1432 |
memory. So, unfortunately, we are limited to 48 Kbytes of memory code. |
|
1433 |
||
393 | 1434 |
|
208 | 1435 |
\subsubsection{What GCC version are you using ?} |
393 | 1436 |
|
208 | 1437 |
We are using the stable RPM release 2.2 : |
1438 |
||
1439 |
\begin{enumerate} |
|
393 | 1440 |
\item GNU Gcc 3.0.4. Build 20030501 |
1441 |
\item Newlib 1.10.0 Build 20030421 |
|
1442 |
\item GNU Binutils 2.12.1 Build 20030427 |
|
208 | 1443 |
\end{enumerate} |
393 | 1444 |
|
1445 |
\section{Documentation resources} |
|
1446 |
||
1447 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1448 |
\subsection{CIA : Can in Automation } |
393 | 1449 |
|
1450 |
\href{http://www.can-cia.de/}{http://www.can -cia.de} |
|
1451 |
||
1452 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1453 |
\subsection{Resources and training in \canopen |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1454 |
} |
393 | 1455 |
|
208 | 1456 |
\href{http://www.esacademy.com/}{http://www.esacademy.com} |
1457 |
||
393 | 1458 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1459 |
\subsection{Elektronikladen HCS12 T -board } |
393 | 1460 |
|
208 | 1461 |
\href{http://www.elektronikladen.de/en_hcs12tb.html}{http://www.elektronikladen.de/en\_hcs12tb.html} |
1462 |
||
393 | 1463 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1464 |
\subsection{Gnu gcc compiler for HC12 } |
393 | 1465 |
|
208 | 1466 |
\href{http://m68hc11.serveftp.org/m68hc11_port.php}{http://m68hc11.serveftp.org/m68hc11\_port.php} |
1467 |
||
393 | 1468 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1469 |
\subsection{Motorola documentation on HC12 } |
393 | 1470 |
|
208 | 1471 |
\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} |
1472 |
||
393 | 1473 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1474 |
\subsection{Lauterbach debugger for HC12 } |
393 | 1475 |
|
208 | 1476 |
\href{http://www.lauterbach.com/}{http://www.lauterbach.com} |
1477 |
||
393 | 1478 |
|
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1479 |
\subsection{Python language } |
393 | 1480 |
|
208 | 1481 |
\href{http://www.python.org/}{http://www.python.org} |
1482 |
||
393 | 1483 |
\clearpage{} |
1484 |
||
1485 |
||
1486 |
\section{About the project} |
|
1487 |
||
1488 |
||
208 | 1489 |
\subsection{Contributors } |
393 | 1490 |
|
1491 |
\begin{center} |
|
1492 |
\includegraphics[width=10cm]{Pictures/1000020100000258000000832C6FFAB4} |
|
1493 |
\par\end{center} |
|
1494 |
||
1495 |
Unité mixte de recherche INRETS -LCPC |
|
1496 |
||
1497 |
sur les Interractions Véhicule -Infrastructure -Conducteur |
|
1498 |
||
1499 |
14, route de la miničre |
|
208 | 1500 |
|
1501 |
78000 Versailles |
|
1502 |
||
1503 |
FRANCE |
|
1504 |
||
1505 |
Tel : +33 1 40 43 29 01 |
|
1506 |
||
1507 |
\href{http://www.inrets.fr/ur/livic}{http://www.inrets.fr/ur/livic} |
|
1508 |
||
1509 |
\textbf{Contributors :} Francis DUPIN |
|
1510 |
||
393 | 1511 |
Camille BOSSARD |
1512 |
||
1513 |
Laurent ROMIEUX |
|
1514 |
||
1515 |
\bigskip{} |
|
1516 |
||
1517 |
||
1518 |
\begin{center} |
|
1519 |
\includegraphics[width=10cm]{Pictures/100002010000013A0000004A96B0C1FF} |
|
1520 |
\par\end{center} |
|
208 | 1521 |
|
1522 |
LOLITECH |
|
1523 |
||
1524 |
204, rue du Haut du Pin |
|
1525 |
||
393 | 1526 |
88470 Saint -Michel sur Meurthe |
208 | 1527 |
|
1528 |
FRANCE |
|
1529 |
||
1530 |
Tel : +33 3 29 52 95 67 |
|
1531 |
||
1532 |
\href{http://www.lolitech.fr/}{http://www.lolitech.fr} |
|
1533 |
||
393 | 1534 |
\textbf{Contributors :} Edouard TISSERANT (Original author) |
1535 |
||
1536 |
Laurent BESSARD |
|
1537 |
||
1538 |
\bigskip{} |
|
1539 |
||
208 | 1540 |
|
1541 |
Many thanks to the other contributors for their great work: |
|
1542 |
||
393 | 1543 |
Raphael ZULLIGER |
1544 |
||
1545 |
David DUMINY (sté A6R) |
|
1546 |
||
1547 |
Zakaria BELAMRI |
|
1548 |
||
208 | 1549 |
|
1550 |
\subsection{Getting support} |
|
393 | 1551 |
|
1552 |
Send your feedback and bug reports to \href{mailto:canfestival-devel@lists.sourceforge.net}{canfestival-devel@lists.sourceforge.net}. |
|
1553 |
||
1554 |
For commercial support, \ training and specific integration and developments, |
|
1555 |
please ask LOLITECH (see contributors). |
|
1556 |
||
208 | 1557 |
|
1558 |
\subsection{Contributing} |
|
393 | 1559 |
|
208 | 1560 |
You are free to contribute your specific interfaces back to the project. |
1561 |
This way, you can hope to get support from CanFestival users community. |
|
1562 |
||
393 | 1563 |
Please send your patch to \href{mailto:canfestival-devel@lists.sourceforge.net}{canfestival |
1564 |
-devel@lists.sourceforge.net}. |
|
1565 |
||
1566 |
Feel free to create some new predefined DS -4xx profiles ({*}.prf) |
|
1567 |
in objdictgen/config, as much as possible respectful to the official |
|
208 | 1568 |
specifications. |
1569 |
||
393 | 1570 |
|
208 | 1571 |
\subsection{License} |
393 | 1572 |
|
1573 |
All the project is licensed with LGPL. This mean you can link CanFestival |
|
1574 |
with any code without being obliged to publish it. |
|
1575 |
||
394
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1576 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1577 |
\begin{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1578 |
#This file is part of CanFestival, a library implementing CanOpen Stack. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1579 |
# |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1580 |
#Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1581 |
# |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1582 |
#See COPYING file for copyrights details. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1583 |
# |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1584 |
#This library is free software; you can redistribute it and/or |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1585 |
#modify it under the terms of the GNU Lesser General Public |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1586 |
#License as published by the Free Software Foundation; either |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1587 |
#version 2.1 of the License, or (at your option) any later version. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1588 |
# |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1589 |
#This library is distributed in the hope that it will be useful, |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1590 |
#but WITHOUT ANY WARRANTY; without even the implied warranty of |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1591 |
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1592 |
#Lesser General Public License for more details. |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1593 |
# |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1594 |
#You should have received a copy of the GNU Lesser General Public |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1595 |
#License along with this library; if not, write to the Free Software |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1596 |
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1597 |
\end{verbatim} |
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1598 |
|
b8755668c9e2
Many changes in manual.tex. Now nearly human readable.
etisserant
parents:
393
diff
changeset
|
1599 |
|
208 | 1600 |
\end{document} |