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