]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
doc: Move new documentation to more suitable places than "Getting started"
authorMichal Sojka <michal.sojka@cvut.cz>
Fri, 18 Oct 2019 11:27:50 +0000 (13:27 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Fri, 18 Oct 2019 11:37:35 +0000 (13:37 +0200)
Also update rpp-test-sw to correctly generate documentation of its commands.

doc/rpp_simulink.tex
doc/test-sw

index 4344235d2d451944aaf368065d4cdf169559c686..90ee0e0784cf519b68482288d229ec8e17178865 100644 (file)
@@ -1360,116 +1360,6 @@ the USB.
  % See Section \ref{sec-hardware-description} for reference about
 % the position of the serial interface connector on the RPP board.
 
-\section{Configuring network interface}
-\label{sec-configuration-network-interface}
-To configure the network, it is currently necessary to set the parameters in the eth.h file. The current implementation does not allow automatic IP address retrieval through the DHCP server. The target has a configurable MAC address. It is not usually necessary to change the settings for a network connection. Only if the address could collide with other devices on the network. To configure the third-layer parameters, it is necessary to set a static IP address, network mask, and default gateway. The parameters must correspond to the network to which the device is connected.
-\begin{lstlisting}[language=c]
-#define RPP_MAC_ADDR             { 0x12 /* Unicast, Locally administered */, 0x34, 0x56, 0x78, 0x9A, 0xBC }
-#define RPP_IP_ADDR               0x0A235F19 
-#define RPP_NETMASK               0xFFFFFF00 
-#define RPP_GW                    0x0A235F01 
-\end{lstlisting}
-
-\section{External mode}
-\label{sec-external-mode}
-The external mode allows communication with the simulation running on the target device. It is possible to monitor the internal signals of the simulation and change the parameters of the amplifiers in the wiring. Communication is performed using the network connection of the target device. For correct operation of the external mode, it is necessary to configure the static IP address, mask, and basic gateway correctly.\\
-\\
-\textbf{External Mode Communication Channel Setup.} External mode is a very
-useful environment for rapid prototyping. Procedure to set external mode up is consisting of four parts,
-each of which depends on completion of the preceding ones, in order. The four
-parts correspond to the steps that you follow in simulating, building, running,
-and tuning an actual real-time application.
-\begin{enumerate}
-\item Set up the model.
-\item Build the target executable.
-\item Run the External mode target program.
-\item Tune parameters and watch signals.
-\end{enumerate}
-
-\subsection{Set up the model}
-When creating a model, before compiling it is necessary to add scope elements to the signals, that the user will need to follow while debugging the simulation.
-An example of an external mode simulation is shown below.
-
-\begin{figure}[!h]\begin{center}
-\noindent
-\includegraphics[scale=.45]{images/extmod_scheme.png}
-\caption{The example scheme for external mode}
-\end{center}\end{figure}
-
-
-It is necessary to set the following parameters for the simulation. The description of the path to the individual parameters is based on their position in version 2018a.
-
-\begin{enumerate}
-\item Open the Configuration Parameters dialog box by selecting Simulation -$>$ Model Configuration Parameters.
-\item Select the Solver pane.
-\item In the Solver options subpane:
-  \begin{enumerate}
-  \item In the Type field, select Fixed-step .
-  \item In the Solver field, select discrete (no continuous states) .
-  \item In the Fixed-step size field, specify 0.1 . (Otherwise, when you generate
-  code, the Simulink Coder build process posts a warning and supplies a
-  value.)
-  \end{enumerate}
-
-  \begin{figure}[!h]\begin{center}
-  \noindent
-  \includegraphics[scale=.45]{images/extmod_solver.png}
-  \caption{Solver setup}
-  \end{center}\end{figure}
-
-\item Select the Hardware Implementation
-  \begin{enumerate}
-  \item In the Device vendor field, select proper vendor (example Texas Instruments)
-  \item In the Device type field, select proper target (example TSM570).
-  \end{enumerate}
-\item Select the Code Generation pane. And control that rpp target is selected.
-\item Select the Code Generation -$>$ Optimalization. Set field Default parameter behavior to Tunable. 
-\begin{figure}[!h]\begin{center}
-  \noindent
-  \includegraphics[scale=.45]{images/exmod_parameters.png}
-  \caption{Set parameters tuneble for external mode}
-\end{center}\end{figure}
-
-\item Select the Code Generation -$>$ Interface pane.
-  \begin{enumerate}
-  \item In section Software environment, subsection Support. Set positive floating-point numbers, absolute and continuous time.
-  \item In section Data exchange interface, set C api generation for parameters and signals. Also set External mode on and configure subsection External mode configuration. There select transport layer to tcpip and MEX-file argument to this format. The Ip address is static IP of target. This address is set in file eth.h. Default value of port si 17725. To change port number is nessesary tu redefine parameter in tcpip interface. 
-    \begin{lstlisting}[language=Matlab]
-"ip address" 1 port
-    \end{lstlisting}
-example:
-    \begin{lstlisting}[language=Matlab]
-"10.35.95.25" 1 17725
-    \end{lstlisting}
-  \end{enumerate}
-
-  \begin{figure}[!h]\begin{center}
-    \noindent
-    \includegraphics[scale=.45]{images/extmod_interface.png}
-    \caption{External mode interface setup}
-  \end{center}\end{figure}
-
-  \item In the RPP, increase C system heap size to 65536. External mode uses this heap to allocate outgoing buffer. And control if is set Download compiled binary to RPP to positive.
-  \item Open Code -$>$ External mode control panel. And click on Signals \& trigging. 
-    \begin{enumerate}
-    \item In main part of panel select scopes using external modes.
-    \item In subsection, Trigger options set the Duration to 500. This option describes the length of the outgoing buffer on the target platform. As the frequency of the model increases, the buffer becomes full between data sending to the external modem. This leads to periodic data outages. These failures can be partially reduced by increasing the Duration value to a sufficiently high value. Due to limited memory, it may be necessary to increase the C system heap size on the RPP panel to increase the Duration value further. This value must not be greater than the remaining free space on the target.
-    \end{enumerate}
-\end{enumerate}
-
-\subsection{Build the target executable}
-For correct model compilation, it is necessary to switch the running mode from normal to external. It is also advisable to select the simulation time, for example, to value inf.
-After making the previous settings, the model can be compiled and uploaded to the device using the Build model button in the Simulink header.
-
-\subsection{Run the External mode target program}
-Once the model has been successfully uploaded to the target, communication must be initiated.\\
-This is possible using the Connect to target button or the Connect button in the External mode control panel.
-The simulation program on the target device starts the calculation as soon as the binary file is uploaded. \\
-Waiting simulation on user connection is not currently implemented.
-
-\subsection{Tune parameters and watch signals}
-After a successful connection to the device, it is possible to configure the amplifier parameters and view the scopes in the standard way as during local machine simulation.
-
 \section{Bug reporting}
 \label{sec-bug-reporting}
 
@@ -1818,6 +1708,16 @@ the main function, has to be modified to use proper functions for task
 creation, task timing and semaphores. The template is stored in
 \texttt{\repo/rpp/rpp/rpp\_mrmain.tlc} file.
 
+\section{Configuring network interface}
+\label{sec-configuration-network-interface}
+To configure the network, it is currently necessary to set the parameters in the eth.h file. The current implementation does not allow automatic IP address retrieval through the DHCP server. The target has a configurable MAC address. It is not usually necessary to change the settings for a network connection. Only if the address could collide with other devices on the network. To configure the third-layer parameters, it is necessary to set a static IP address, network mask, and default gateway. The parameters must correspond to the network to which the device is connected.
+\begin{lstlisting}[language=c]
+#define RPP_MAC_ADDR             { 0x12 /* Unicast, Locally administered */, 0x34, 0x56, 0x78, 0x9A, 0xBC }
+#define RPP_IP_ADDR               0x0A235F19 
+#define RPP_NETMASK               0xFFFFFF00 
+#define RPP_GW                    0x0A235F01 
+\end{lstlisting}
+
 \chapter{Simulink Coder Target}
 \label{chap-simulink-coder-target}
 
@@ -2217,7 +2117,107 @@ cd <rpp-simulink>\rpp\demos
 Both commands will create a directory for each compiled demo, which will contain the generated C code and binary file with the firmware. To download the firmware to the board and run it, see Section \ref{sec-running-software-on-hw}.
 \end{enumerate}
 
- \section{Adding new functionality}
+ \section{External mode}
+\label{sec-external-mode}
+The external mode allows communication with the simulation running on the target device. It is possible to monitor the internal signals of the simulation and change the parameters of the amplifiers in the wiring. Communication is performed using the network connection of the target device. For correct operation of the external mode, it is necessary to configure the static IP address, mask, and basic gateway correctly.\\
+\\
+\textbf{External Mode Communication Channel Setup.} External mode is a very
+useful environment for rapid prototyping. Procedure to set external mode up is consisting of four parts,
+each of which depends on completion of the preceding ones, in order. The four
+parts correspond to the steps that you follow in simulating, building, running,
+and tuning an actual real-time application.
+\begin{enumerate}
+\item Set up the model.
+\item Build the target executable.
+\item Run the External mode target program.
+\item Tune parameters and watch signals.
+\end{enumerate}
+
+\subsection{Set up the model}
+When creating a model, before compiling it is necessary to add scope elements to the signals, that the user will need to follow while debugging the simulation.
+An example of an external mode simulation is shown below.
+
+\begin{figure}[!h]\begin{center}
+\noindent
+\includegraphics[scale=.45]{images/extmod_scheme.png}
+\caption{The example scheme for external mode}
+\end{center}\end{figure}
+
+
+It is necessary to set the following parameters for the simulation. The description of the path to the individual parameters is based on their position in version 2018a.
+
+\begin{enumerate}
+\item Open the Configuration Parameters dialog box by selecting Simulation -$>$ Model Configuration Parameters.
+\item Select the Solver pane.
+\item In the Solver options subpane:
+  \begin{enumerate}
+  \item In the Type field, select Fixed-step .
+  \item In the Solver field, select discrete (no continuous states) .
+  \item In the Fixed-step size field, specify 0.1 . (Otherwise, when you generate
+  code, the Simulink Coder build process posts a warning and supplies a
+  value.)
+  \end{enumerate}
+
+  \begin{figure}[!h]\begin{center}
+  \noindent
+  \includegraphics[scale=.45]{images/extmod_solver.png}
+  \caption{Solver setup}
+  \end{center}\end{figure}
+
+\item Select the Hardware Implementation
+  \begin{enumerate}
+  \item In the Device vendor field, select proper vendor (example Texas Instruments)
+  \item In the Device type field, select proper target (example TSM570).
+  \end{enumerate}
+\item Select the Code Generation pane. And control that rpp target is selected.
+\item Select the Code Generation -$>$ Optimalization. Set field Default parameter behavior to Tunable. 
+\begin{figure}[!h]\begin{center}
+  \noindent
+  \includegraphics[scale=.45]{images/exmod_parameters.png}
+  \caption{Set parameters tuneble for external mode}
+\end{center}\end{figure}
+
+\item Select the Code Generation -$>$ Interface pane.
+  \begin{enumerate}
+  \item In section Software environment, subsection Support. Set positive floating-point numbers, absolute and continuous time.
+  \item In section Data exchange interface, set C api generation for parameters and signals. Also set External mode on and configure subsection External mode configuration. There select transport layer to tcpip and MEX-file argument to this format. The Ip address is static IP of target. This address is set in file eth.h. Default value of port si 17725. To change port number is nessesary tu redefine parameter in tcpip interface. 
+    \begin{lstlisting}[language=Matlab]
+"ip address" 1 port
+    \end{lstlisting}
+example:
+    \begin{lstlisting}[language=Matlab]
+"10.35.95.25" 1 17725
+    \end{lstlisting}
+  \end{enumerate}
+
+  \begin{figure}[!h]\begin{center}
+    \noindent
+    \includegraphics[scale=.45]{images/extmod_interface.png}
+    \caption{External mode interface setup}
+  \end{center}\end{figure}
+
+  \item In the RPP, increase C system heap size to 65536. External mode uses this heap to allocate outgoing buffer. And control if is set Download compiled binary to RPP to positive.
+  \item Open Code -$>$ External mode control panel. And click on Signals \& trigging. 
+    \begin{enumerate}
+    \item In main part of panel select scopes using external modes.
+    \item In subsection, Trigger options set the Duration to 500. This option describes the length of the outgoing buffer on the target platform. As the frequency of the model increases, the buffer becomes full between data sending to the external modem. This leads to periodic data outages. These failures can be partially reduced by increasing the Duration value to a sufficiently high value. Due to limited memory, it may be necessary to increase the C system heap size on the RPP panel to increase the Duration value further. This value must not be greater than the remaining free space on the target.
+    \end{enumerate}
+\end{enumerate}
+
+\subsection{Build the target executable}
+For correct model compilation, it is necessary to switch the running mode from normal to external. It is also advisable to select the simulation time, for example, to value inf.
+After making the previous settings, the model can be compiled and uploaded to the device using the Build model button in the Simulink header.
+
+\subsection{Run the External mode target program}
+Once the model has been successfully uploaded to the target, communication must be initiated.\\
+This is possible using the Connect to target button or the Connect button in the External mode control panel.
+The simulation program on the target device starts the calculation as soon as the binary file is uploaded. \\
+Waiting simulation on user connection is not currently implemented.
+
+\subsection{Tune parameters and watch signals}
+After a successful connection to the device, it is possible to configure the amplifier parameters and view the scopes in the standard way as during local machine simulation.
+
+\section{Adding new functionality}
 \label{sec:adding-new-funct}
 This section describes how to create new Simulink blocks and how to add them to the RPP
 blocks library. The new block creation process consists of several steps:
index bac79a3531c5ec9691417237102cd35204f52160..896de9242c3ea39e8656b377472aeec194960e91 160000 (submodule)
@@ -1 +1 @@
-Subproject commit bac79a3531c5ec9691417237102cd35204f52160
+Subproject commit 896de9242c3ea39e8656b377472aeec194960e91