\label{fig-select-project}
\end{center}\end{figure}
+\newpage
\subsection{Creating new project}
Follow these steps to create an application for RM48 MCU compiled with
CGT.
-\newpage
+
\begin{compactenum}
-\item Create a new empty CCS project.\\
- \noindent\includegraphics[width=400px]{images/base_1.png}
+\item Create a new empty CCS project.
+
+ \noindent\includegraphics[scale=0.45]{images/base_1.png}
+
\item In \textsc{Project Explorer}, create normal folders
named \texttt{include} and \texttt{src}.
+
\item If you use Git version control system, add \texttt{.gitignore}
file with the following content to the root of that project:
\lstset{language=}
Release
.settings/*
\end{lstlisting}
+
\newpage
\item In project \textsc{Properties}, add new variable of type
-\texttt{Directory} named \texttt{RPP\_LIB\_ROOT} and point to the rpp
-library repository root.\\ \noindent\includegraphics[width=400px]{images/base_2.png}
+ \texttt{Directory} named \texttt{RPP\_LIB\_ROOT} and set it to the
+ rpp-lib directory
+ root.
+
+ \noindent\includegraphics[scale=.45]{images/base_2.png}
+
\item Add \texttt{rpp-lib.lib} static library to list of linked
- libraries and add \texttt{RPP\_LIB\_ROOT} to the library search
- path.\newline{}
-\noindent\includegraphics[width=400px]{images/base_3.png}
-\newpage
-\item Configure compiler to include local includes, OS includes for
-RM48 and RPP includes, in that order.\newline{}
-\noindent\includegraphics[width=350px]{images/base_5.png}
-\newpage
- \item Configure compiler to allow GCC extensions.\newline{}
-\noindent\includegraphics[width=400px]{images/base_6.png}
-\item Replace the board upload descriptor \texttt{RM48L952.ccxml} in
-\texttt{targeConfigs} directory with the right one from a \texttt{rpp-test-sw}
-project.
-\item Create source file \texttt{main.c} in \texttt{src} folder.
+ libraries and add \texttt{\$\{RPP\_LIB\_ROOT\}} to the library search
+ path.
+
+ \noindent\includegraphics[scale=.45]{images/base_3.png}
+
+ \newpage
+\item Configure compiler \#include search path to contain project
+ includes, OS includes for RM48 and RPP includes, in that
+ order.
+
+ \noindent\includegraphics[scale=.45]{images/base_5.png}
+
+\item Configure the compiler to allow GCC extensions.
+
+ \noindent\includegraphics[width=.95\linewidth]{images/base_6.png}
+
+\item Create \texttt{main.c} file with the following content:
+\begin{lstlisting}[language=C]
+#include <rpp/rpp.h>
+
+int main(void)
+{
+ rpp_init();
+ rpp_sci_printf("Hello world\n");
+ vTaskStartScheduler();
+ return 0;
+}
+
+void vApplicationMallocFailedHook()
+{}
+void vApplicationStackOverflowHook()
+{}
+\end{lstlisting}
+
+\item Compile the application by e.g. \textsc{Project $\rightarrow$
+ Build All}.
+\item If not already created, create new target configuration. Select
+ \textsc{Windows $\rightarrow$ Show View $\rightarrow$ Target
+ Configurations}. In the shown window, click on \textsc{New Target
+ Configuration} icon and configure XDS100v2 connection and RM48L952
+ device as shown below. Click \textsc{Save}, connect your board and
+ click \textsc{Test Connection}.
+
+ \medskip
+ \includegraphics[width=\linewidth]{images/target_conf.png}
+
+\item Select \textsc{Run $\rightarrow$ Debug Configurations...}.
+ Create \textsc{New launch configuration}, give it a name and select
+ the Target configuration created in the previous step.
+
+ \includegraphics[width=\linewidth]{images/debug_conf.png}
+
+ Then switch to the \textsc{Program} tab and select the newly created
+ project by clicking the \textsc{Workspace...} button.
+
+ Optionally, you can tune settings in the \textsc{Target} tab. For
+ example, it is useful not to erase the whole flash, but only
+ necessary sectors (see the figure below).
+
+ \includegraphics[width=\linewidth]{images/debug_conf_flash.png}
+
+\item Click \textsc{Debug}.
+
+TODO nefunguje to - proč?????
+
\end{compactenum}
\subsubsection{Steps to configure new POSIX application:}
\newpage
\item Add new variable \texttt{RPP\_LIB\_ROOT} and point to this
repository branch root.\newline{}
-\noindent\includegraphics[width=400px]{images/base_posix_1.png}
+\noindent\includegraphics[width=\linewidth]{images/base_posix_1.png}
\item Configure compiler to include local includes, CCS application
includes, OS includes for POSIX and RPP includes, in that order.\newline{}
-\noindent\includegraphics[width=400px]{images/base_posix_2.png}
+\noindent\includegraphics[width=\linewidth]{images/base_posix_2.png}
\newpage
\item Add \texttt{rpp} and \texttt{pthread} to linker libraries and add
\texttt{RPP\_LIB\_ROOT} to the library search path.\newline{}
-\noindent\includegraphics[width=400px]{images/base_posix_3.png}
+\noindent\includegraphics[width=\linewidth]{images/base_posix_3.png}
\end{compactenum}
\subsubsection{Content of the application}
\end{enumerate}
\begin{figure}[H]\begin{center}
- \includegraphics[width=350px]{images/new_empty_project.png}
+ \includegraphics[scale=.45]{images/new_empty_project.png}
\caption{New empty project dialog}
\label{fig-new-empty-project}
\end{center}\end{figure}
\begin{figure}[H]\begin{center}
- \includegraphics[width=350px]{images/debug_configuration_main.png}
+ \includegraphics[scale=.45]{images/debug_configuration_main.png}
\caption{Debug Configuration Main dialog}
\label{fig-debug-conf-main-diag}
\end{center}\end{figure}
\end{enumerate}
\begin{figure}[H]\begin{center}
- \includegraphics[width=350px]{images/debug_configuration_program.png}
+ \includegraphics[scale=.45]{images/debug_configuration_program.png}
\caption{Configuration Program dialog}
\label{fig-debug-conf-program-diag}
\end{center}\end{figure}
\item Tasking mode: \textit{SingleTasking}.
\begin{figure}
\centering
- \includegraphics[width=400px]{images/simulink_solver.png}
+ \includegraphics[scale=.45]{images/simulink_solver.png}
\caption{Solver settings}
\label{fig-solver}
\end{figure}
% time''. It's ok for the source blocks to run once per tick.
% \begin{figure}
% \centering
-% \includegraphics[width=400px]{images/simulink_diagnostics.png}
+% \includegraphics[scale=.45]{images/simulink_diagnostics.png}
% \caption{Sample Time settings}
% \label{fig-sample-time-settings}
% \end{figure}
\item Set ``System target file'' to \texttt{rpp.tlc}.
\begin{figure}
\centering
- \includegraphics[width=400px]{images/simulink_code.png}
+ \includegraphics[scale=.45]{images/simulink_code.png}
\caption{Code Generation settings}
\label{fig-code-gen-settings}
\end{figure}
\begin{figure}[H]\begin{center}
\noindent
-\includegraphics[width=300px]{images/tlc_process.png}
+\includegraphics[scale=.45]{images/tlc_process.png}
\caption{TLC code generation process. \cite[p. 1-6]{targetlanguagecompiler2013}}
\end{center}\end{figure}
\begin{figure}[H]\begin{center}
\noindent
-\includegraphics[width=250px]{images/sfunctions_process.png}
+\includegraphics[scale=.45]{images/sfunctions_process.png}
\caption{Simulation cycle of a S-Function. \cite[p. 57]{simulinkdevelopingsfunctions2013}}
\label{fig-sfunctions-process}
\end{center}\end{figure}
\subsection{ADC demo}
\begin{figure}[H]\begin{center}
\noindent
-\includegraphics[width=450px]{images/demo_adc.png}
+\includegraphics[scale=.45]{images/demo_adc.png}
\caption{Example of the usage of the Analog Input blocks for RPP.}
\end{center}\end{figure}
\subsection{Simple CAN demo}
\begin{figure}[H]\begin{center}
\noindent
-\includegraphics[width=450px]{images/demo_simple_can.png}
+\includegraphics[scale=.45]{images/demo_simple_can.png}
\caption{The simplest CAN demonstration.}
\end{center}\end{figure}
\subsection{CAN transmit}
\begin{figure}[H]\begin{center}
\noindent
-\includegraphics[width=450px]{images/demo_cantransmit.png}
+\includegraphics[scale=.45]{images/demo_cantransmit.png}
\caption{Example of the usage of the CAN blocks for RPP.}
\end{center}\end{figure}
\subsection{Simulink Demo model}
\begin{figure}[H]\begin{center}
\noindent
-\includegraphics[width=450px]{images/demo_board.png}
+\includegraphics[scale=.45]{images/demo_board.png}
\caption{Model of the complex demonstration of the boards peripherals.}
\end{center}\end{figure}
\subsection{Echo char}
\begin{figure}[H]\begin{center}
\noindent
-\includegraphics[width=450px]{images/demo_echo_char.png}
+\includegraphics[scale=.45]{images/demo_echo_char.png}
\caption{Echo Character Simulink demo for RPP.}
\end{center}\end{figure}
\subsection{GIO demo}
\begin{figure}[H]\begin{center}
\noindent
-\includegraphics[width=450px]{images/demo_gio.png}
+\includegraphics[scale=.45]{images/demo_gio.png}
\caption{Demonstration of DIN and DOUT blocks}
\end{center}\end{figure}
\subsection{Hello world}
\begin{figure}[H]\begin{center}
\noindent
-\includegraphics[width=450px]{images/demo_hello_world.png}
+\includegraphics[scale=.45]{images/demo_hello_world.png}
\caption{Hello World Simulink demo for RPP.}
\end{center}\end{figure}