]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
doc: labels added to the chapters, sections, subsections and figures
authorMichal Horn <hornmich@fel.cvut.cz>
Tue, 2 Dec 2014 12:23:11 +0000 (13:23 +0100)
committerMichal Horn <hornmich@fel.cvut.cz>
Tue, 2 Dec 2014 12:23:11 +0000 (13:23 +0100)
doc/rpp_simulink.tex

index cccbf258c248dcdf192c6bbbb836cc3a786b2433..b189b722811ef7f33b0fdf52f723e3332c8429f8 100644 (file)
@@ -122,7 +122,7 @@ Michal \textsc{Sojka}\\[\baselineskip]
 \addtolength{\parskip}{\baselineskip} % Paragraph spacing
 
 \chapter{Introduction}
-\label{chap:introduction}
+\label{chap-introduction}
 
 This text is a documentation for a Rapid Prototyping Platform (RPP) project. It may serve as a
 guideline for development tools installation, Simulink Coder configuration, creation of new models as
@@ -131,7 +131,7 @@ testing tool, Matlab Simulink blocks and RPP Matlab Simulink Code generator. The
 provides an overall description of the hardware design and architecture of its control software.
 
 \section{Background}
-\label{sec:background}
+\label{sec-background}
 
 The Rapid Prototyping Platform is an ECU (Electronic Control Unit) designed for use in Automotive, thus requirements for Automotive communication interfaces, durable IO ports and analog-digital converters were applied.
 
@@ -139,13 +139,13 @@ The ECU is controlled by TMS570LS5137ZWT MCU, which is an ARM Cortex R4 based mi
 
 Besides the right MCU, an operating system is necessary for nontrivial applications. The RPP board runs FreeRTOS, which is opensource operating system with real-time kernel not only for embedded systems. The FreeRTOS provides an API for creation and managing multiple tasks, scheduler, memory manager, semaphores, queues, mutexes, timers and lots of other features that can be used in the applications.     TODO: add ref to FreeRTOS pages
 
-Even with the operating system it is quite hard and non-intuitive to control the hardware directly. That is the point when abstraction comes in the play. RPP software is made of several layers implementing from the bottom to the top driver to the hardware itself, hardware abstraction for common functionality on different hardware and final API which is easy for the user to use. The whole thing, the operating system and the control software, can be compiled as a library and easily used in any project. More details about this can be found in Chapter 3 TODO: add link to the C Library chapter
+Even with the operating system it is quite hard and non-intuitive to control the hardware directly. That is the point when abstraction comes in the play. RPP software is made of several layers implementing from the bottom to the top driver to the hardware itself, hardware abstraction for common functionality on different hardware and final API which is easy for the user to use. The whole thing, the operating system and the control software, can be compiled as a library and easily used in any project. More details about the library can be found in Chapter \ref{chap-c-support-library}.
 
-Because humans make mistakes and in safety critical applications any mistake can cause damage, looses of money or in the worst case even death of other people, the room for making mistakes has to be as small as possible. An approach called Model-based development has been introduced. In Simulink  the application is developed as a model made of blocks connected together. Every block implements some functionality. For example one block receives a voltage from an analog-digital converter, provides the value as an input to another block which implements some clever algorithm and the product is passed as an input to another block, which sends the value as a CAN message to some other MCU. The final model can be simulated and tested even before the real hardware exists. Finally a C code is generated from the model by a Simulink Code Generator. The code can be compiled by the MCU compatible compiler and downloaded to the MCU Flash memory on the device. Because every block and code generated from the block has to pass a series of tests during their development, the room for making mistakes during the application development has significantly decreased and developers can focus on the functionality instead of the hardware and control software implementation. More information about Code generation can be found in Chapter 4. TODO: add link to the chapter 4
+Because humans make mistakes and in safety critical applications any mistake can cause damage, looses of money or in the worst case even death of other people, the room for making mistakes has to be as small as possible. An approach called Model-based development has been introduced. In Simulink  the application is developed as a model made of blocks connected together. Every block implements some functionality. For example one block receives a voltage from an analog-digital converter, provides the value as an input to another block which implements some clever algorithm and the product is passed as an input to another block, which sends the value as a CAN message to some other MCU. The final model can be simulated and tested even before the real hardware exists. Finally a C code is generated from the model by a Simulink Code Generator. The code can be compiled by the MCU compatible compiler and downloaded to the MCU Flash memory on the device. Because every block and code generated from the block has to pass a series of tests during their development, the room for making mistakes during the application development has significantly decreased and developers can focus on the functionality instead of the hardware and control software implementation. More information about Code generation can be found in Chapter \ref{chap-simulink-coder-target}.
 
 \section{Software architecture}
-\label{sec:software_architecture}
-The RPP control software, also called RPP library, is structured into 5 layers, described in Figure \ref{layers}, with the following guidelines:
+\label{sec-software-architecture}
+The RPP control software, also called RPP library, is structured into 5 layers, described in Figure \ref{fig-layers}, with the following guidelines:
 
 \begin{compactitem}
 \item Top-down dependency only. No lower layer depends on anything from upper layers.
@@ -161,7 +161,7 @@ The RPP control software, also called RPP library, is structured into 5 layers,
 \noindent
 \includegraphics[width=250px]{images/layers.pdf}
 \caption{The RPP library layers.}
-\label{layers}
+\label{fig-layers}
 \end{center}
 \end{figure}
 
@@ -172,14 +172,17 @@ to include the top layer interface files (for example \textsc{rpp/rpp\_can.h}) t
 The rest of the section provides basic description of each layer.
 
 \subsection{Operating System layer}
+\label{sec-operating-system-layer}
 This is an operating system interchangeable layer, containing the FreeRTOS source files. The system can be easily replaced by another version thanks to this layer. Thanks to this layer it is possible compile the library for Linux (using POSIX version of the FreeRTOS), which can be desirable for some testing. The source files can be found in <lib\_root>/os folder.
 
 TODO: add description of the available FreeRTOS versions
 
 \subsection{System Layer} 
+\label{sec-system-layer}
 This layer contains system files with data types definitions, clock definitions, interrupts mapping, MCU startup sequence, MCU selftests, and other low level code for controlling some of the MCU peripherals. The source files can be found in <lib-root>/rpp/src/sys, the header files can be found in <lib-root>/rpp/include/sys folder.
 
 \subsection{HAL abstraction layer}
+\label{sec-hal-abstraction-layer}
 Hardware Abstraction Layer (HAL) creates an abstraction over the real hardware. For example imagine an IO port with 8 pins. First four pins are connected to the MCU directly to GPIO pins, another four pins are connected to an external integrated circuit, communicating with the MCU via SPI. It would be annoying to have to remember which group is which and to have two sets of control functions for one peripheral. This layer maps every pin of the port to a control function from the System Layer, groups and names the pins in a unified style and provides common read, write and configure functions.
 
 As a result, the higher layers do not have to know anything about the wiring of the peripherals, they can just call read, write or configure function with a pin name as a parameter and the HAL handles all the details.
@@ -187,16 +190,19 @@ As a result, the higher layers do not have to know anything about the wiring of
 The source files can be found in <library-root>/rpp/src/hal and the header files can be found in <library-root>/rpp/include/hal folder.
 
 \subsection{Drivers layer} 
+\label{sec-drivers-layer}
 The Drivers layer contains code for controlling the RPP peripherals. The layer benefits from the lower layers thus it is not too low level, but still there are some peripherals like ADC or H-bridge, which needs some special procedure for initialization and running, which would not be very intuitive for the user. For example the H-bridge need a watchdog reset task to be started before the bridge is enabled.
 
 The source files can be found in <library-root>/rpp/src/drv and the header files can be found in <library-root>/rpp/include/drv folder.
 
 \subsection{RPP Layer} 
 The RPP Layer is the highest layer of the control software. This layer provides the easiest set of functions for every peripheral and requires only basic knowledge about them. For example the H-bridge again from the previous section. The user can call just rpp\_hbr\_init() function to enable the H-bridge and the function calls a sequence of Drivers layer functions to start the Watchdog and configure the peripheral.
+\label{sec-rpp-layer} 
 
 The source files can be found in <library-root>/rpp/src/rpp and the header files can be found in <library-root>/rpp/include/rpp folder.
 
 \section{Hardware description}
+\label{sec-hardware-description}
 
 This section provides reference documentation for the RPP board:
 
@@ -209,6 +215,7 @@ TODO: operating conditions?
 \end{compactitem}
 
 \subsection{Layout description}
+\label{sec-layout-description}
 The RPP board has been designed with strict Automotive standards and safety in mind. The components and pins are placed in sections and wires are routed in a way to avoid any significant electromagnetic interference.
 
 As can be seen on Figure \ref{board_photo}, the high power output logic is placed in the top left corner, the low power output logic is placed on the bottom left corner, while the communication logic is placed on the top right corner.  In the middle there is the only one button available, the reset button and below it is placed the TMS570 MCU itself. In the bottom right corner there are components of analog inputs.
@@ -222,6 +229,7 @@ As can be seen on Figure \ref{board_photo}, the high power output logic is place
 
 
 \subsection{Connectors pinout}
+\label{sec-connector-pinout}
 The pinout of the board, described by the Figure \ref{pinout}, follows the layout. The side connectors for communication (24 pins), signals (56 pins) and power (24 pins) are automotive approved humidity resistant connectors.
 \begin{figure}[H]
 \advance\leftskip-1cm
@@ -232,6 +240,7 @@ The pinout of the board, described by the Figure \ref{pinout}, follows the layou
 \end{figure}
 
 \subsection{Modules description}
+\label{sec-modules-description}
 This section enumerates the capabilities of the hardware modules from Software perspective. The block diagram of the modules can be seen in Figure \ref{blocks}.
 \begin{figure}[H]
 \advance
@@ -243,7 +252,9 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{figure}
 
 \subsubsection{Logic IO}
+\label{sec-logic-io}
 \paragraph{Digital Inputs (DIN)}
+\label{par-digital-inputs}
 \begin{compactitem}
 \item 16 pins available on Signal Connector.
 \item Pins 8-15 status can be read via GPIO using configurable threshold. \newline{}
@@ -257,6 +268,7 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{compactitem}
 
 \paragraph{Digital Outputs (LOUT)}
+\label{par-digital-outputs}
 \begin{compactitem}
 \item 8 pins available on Signal Connector.
 \item Pins for logic output only, up to 100mA.
@@ -264,6 +276,7 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{compactitem}
 
 \paragraph{Analog Input (ADC)}
+\label{par-analog-input}
 \begin{compactitem}
 \item 12 channels available.
 \item Differential inputs, thus 24 pins available on Signal Connector.
@@ -273,6 +286,7 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{compactitem}
 
 \paragraph{Analog Output (DAC)}
+\label{par-analog-output}
 \begin{compactitem}
 \item 4 pins available on Signal Connector.
 \item Output range is 0-12 volts.
@@ -281,7 +295,9 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{compactitem}
 
 \subsubsection{Power Output}
+\label{sec-power-output}
 \paragraph{H-Bridge (HBR)}
+\label{par-hbr}
 \begin{compactitem}
 \item 1 port (2 pins) available on Power Connector.
 \item Communication is done through SPI.
@@ -292,6 +308,7 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{compactitem}
 
 \paragraph{Power Output (MOUT)}
+\label{par-power-output}
 \begin{compactitem}
 \item 6 pins available on Power Connector.
 \item Pins can drive a load up to 2A. Push/Pull.
@@ -301,6 +318,7 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{compactitem}
 
 \paragraph{High-Power Output (HOUT)}
+\label{par-high-power-output}
 \begin{compactitem}
 \item 6 pins available on Power Connector.
 \item Pins can be set ON/OFF.
@@ -310,7 +328,9 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{compactitem}
 
 \subsubsection{Communication}
+\label{sec-communication}
 \paragraph{CAN bus (CAN)}
+\label{par-can}
 \begin{compactitem}
 \item 3 ports available (CAN uses differential signaling) thus 6 pins are available on Communication
   connector.
@@ -320,18 +340,21 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{compactitem}
 
 \paragraph{Local Interconnect Network (LIN)}
+\label{par-lin}
 \begin{compactitem}
 \item 2 ports/pins available on Communication Connector.
 \item Only first port can be used when using the SCI. Second port is shared with SCI.
 \end{compactitem}
 
 \paragraph{FlexRay (FR)}
+\label{par-flexray}
 \begin{compactitem}
 \item 2 ports available. FlexRay uses differential signaling thus 4 pins are available on
   Communication Connector.
 \end{compactitem}
 
 \paragraph{Serial Comm. Interface (SCI)}
+\label{par-sci}
 \begin{compactitem}
 \item 1 port available inside the box on SCI connector (4 pins).
 \item Variable baud rate. Tested on 9600 and 115200.
@@ -339,33 +362,40 @@ This section enumerates the capabilities of the hardware modules from Software p
 \end{compactitem}
 
 \paragraph{Ethernet (ETH)}
+\label{par-eth}
 \begin{compactitem}
 \item 1 port available. Standard Ethernet connector available inside box.
 \end{compactitem}
 
 \subsubsection{Data storage/logging}
+\label{sec-data-storage}
 \paragraph{External Memory SD-RAM (SDR)}
+\label{par-external-memory}
 \begin{compactitem}
 \item 64MB (currently installed) external RAM used for logging. Maximal supported capacity is 256MB.
 \item Memory test routine available with test Software.
 \end{compactitem}
 
 \paragraph{SD Card (SDC)}
+\label{par-sd-card}
 \begin{compactitem}
 \item Standard SD-Card connector or microSD connector available inside box.
 \item Communication done using SPI.
 \end{compactitem}
 
 \section{Document structure}
+\label{sec-document-structure}
 The general layout of this document is as follows:
 
 \chapter{Getting started}
-\label{sec:getting-started}
+\label{chap-getting-started}
 
 \section{Software requirements}
+\label{sec-software-requirements}
 The RPP software stack was developed to be functional on both platforms Windows and Linux. Despite of older and newer versions of the software and tools might work as well, usage of the following versions is suggested:
 
-\subsection{Linux environment}  
+\subsection{Linux environment} 
+\label{sec-linux-environment}
 \begin{itemize}
        \item Debian based 64b Linux distribution (Debian 7.0 or Ubuntu 14.4 for example).
        \item Kernel version 3.11.0-12.
@@ -377,6 +407,7 @@ The RPP software stack was developed to be functional on both platforms Windows
 \end{itemize}
 
 \subsection{Windows environment}
+\label{sec-windows-environment}
 \begin{itemize}
        \item Windows 7 Enterprise 64b Service Pack 1.
        \item C/C++ compiler from Windows SDK
@@ -387,8 +418,10 @@ The RPP software stack was developed to be functional on both platforms Windows
 \end{itemize}
 
 \section{Software and tools} 
+\label{sec-software-and-tools}
 
 \subsection{TI Code Composer Studio}
+\label{sec-ti-ccs}
 
 
 Code Composer Studio (CCS) is the official Integrated Development Environment (IDE) for developing
@@ -406,6 +439,7 @@ You can find documentation for CGT compiler in \textsc{\repo/ref/armcl.pdf} and
 The version used in this project is the 5.5.0.00077.
 
 \subsubsection{Installation on Linux} 
+\label{sec-installation-on-linux}
 
 Download CCS for Linux from:
 
@@ -440,6 +474,7 @@ nano <ccs>/ccsv5/eclipse/plugins/com.ti.ccstudio.branding_<version>/plugin_custo
 And change key \textsc{org.eclipse.ui/showIntro} to false.
 
 \subsubsection{ Installation on Windows }
+\label{sec-installation-on-windows}
 The installation for Windows is more straightforward than the previous procedure for Linux.
 
 Download CCS for Windows from:
@@ -451,16 +486,19 @@ Download CCS for Windows from:
 Once downloaded run the ccs\_setup\_5.5.0.00077.exe and install the CCS.
 
 \subsubsection{ First launch } 
+\label{sec-first-launch}
 
 If another licence is not available, Choose ``FREE License - for use with XDS100 JTAG Emulators" on the licensing options. Code download
 for the board is using that particular hardware.
 
 \subsection{Matlab/Simulink}
+\label{sec-matlab-simulink}
 
 Matlab Simulink is a set of tools, runtime environment and development environment for Model-Based applications development, simulations and generation code for target platforms.
 Supported Matlab/Simulink version is R2013b for 64 bits Linux and Windows.
 
 \subsection{GtkTerm and Bray Terminal}
+\label{sec-gtkterm-bray-terminal}
 
 Most of the interaction with the board is done through a RS-232 serial connection. The terminal Software used for communication is called GtkTerm for Linux and Bray terminal for Windows.
 
@@ -478,6 +516,7 @@ The Bray Terminal does not require any installation and the executable file is a
 \end{quotation}
 
 \subsection{C Compiler}
+\label{sec-c-compiler}
 In order to be able to compile Matlab Simulink blocks S-functions a C language compiler has to be available on the development system.
 
 For Linux a GCC 4.8.1 compiler is recommended and can be installed with command
@@ -494,32 +533,35 @@ For Windows, the C/C++ compiler is a part of Windows SDK, which installation fil
 \end{quotation}
 
 \section{Code Composer Studio usage}
+\label{sec-code-composerpstudio-usage}
 
 \subsection{Opening of existing project}
+\label{sec-openning-of-existing-project}
 The project opening procedure is similar to standard Eclipse project opening.
 
 \begin{enumerate}
        \item Launch Code Composer Studio
        \item Select File->Import
-       \item In the dialog window select Code Composer Studio -> Existing CCS Eclipse project as an import source as depicted in Figure \ref{fig:import-project}.
+       \item In the dialog window select Code Composer Studio -> Existing CCS Eclipse project as an import source as depicted in Figure \ref{fig-import-project}.
        \item In the next dialog window click on Browse button and find the root directory of the project.
-       \item Select the requested project in the Discovered project section so that the result looks like in Figure \ref{fig:select-project}.
+       \item Select the requested project in the Discovered project section so that the result looks like in Figure \ref{fig-select-project}.
        \item Click on Finish button.
 \end{enumerate}
 
 \begin{center}
        \includegraphics[scale=1.00]{images/import_project.png}
        \captionof{figure}{Import project dialog}
-       \label{fig:import-project}
+       \label{fig-import-project}
 \end{center}
 
 \begin{center}
        \includegraphics[scale=1.00]{images/select_project.png}
        \captionof{figure}{Select project dialog}
-       \label{fig:select-project}
+       \label{fig-select-project}
 \end{center}
 
 \subsection{Creating new project}
+\label{sec-creating-new-project}
 In \textsc{\repo/rpp/lib/apps/} there are two RPP base
 applications, \textsc{helloworld} and \textsc{helloworld\_posix}, that are
 already configured for the RPP Library. It is advised that new applications use this project as a
@@ -774,8 +816,10 @@ Default target configuration erases the whole Flash memory, before downloading t
 \end{center}
 
 \section{Matlab Simulink usage}
+\label{sec-matlab-simulink-usage}
 
 \subsection{Configuring Simulink for RPP}
+\label{sec-configuration-simulink-for-rpp}
 
 \begin{enumerate}
 \item Download and install CCS for Linux:
@@ -822,6 +866,7 @@ open('cantransmit.slx')
 The same procedure can be used to openning any other models.
 
 \subsection{Creating new model}
+\label{sec-crating-new-model}
 \begin{enumerate}
 \item Open or create a model you want to generate code from.
 \item Make sure that the model is configured (Simulation $\rightarrow$
@@ -837,7 +882,7 @@ cd /tmp/my-code
 \item Generate the code by choosing ``Code $\rightarrow$ C/C++ Code
   $\rightarrow$ Build Model''.
 \item If \emph{Download compiled binary to RPP} was selected in
-  \emph{RPP Options} pane (see Section \ref{sec:rpp-target-options}),
+  \emph{RPP Options} pane (see Section \ref{sec-rpp-target-options}),
   the compiled binary will be downloaded to the to the board. The program
   will start running right after the loading is finished.
 
@@ -921,20 +966,23 @@ Use GtkTerm in Linux or Bray Terminal for accessing the serial interface. See Se
 TODO: implement
 
 \chapter{C Support Library}
+\label{chap-c-support-library}
 
 This chapter describes the implementation of a C support library (RPP Library) to provide an overall
 insight for future development.
 
 \section{Description}
+\label{sec-description}
 TODO create links to chapters
 The RPP C Support Library (also called RPP library) defines the API for communication with the board. It includes drivers and operating system. This support library is used in modules described in Chapter X and X. It is designed from the board user perspective and exposes a simplified high-level API to handle the board's peripheral modules in a safe manner. The library is compiled as a static library with the name rpp-lib.lib and can be found in <library-root>.
 
 The RPP library can be used in any project, where the RPP hardware support is required and is also used in two modules, described later in this document. The Command line testing tool, described in Chapter and Simulink Coder target, described in Chapter.
 TODO: Doplnit odkazy na kapitoly
 
-For details about the library architecture, refer the Section \ref{sec:software_architecture} in Chapter \ref{chap:introduction}  
+For details about the library architecture, refer the Section \ref{sec-software-architecture} in Chapter \ref{chap-introduction}  
 
 \section{API development guidelines}
+\label{sec-api-development-guidlines}
 
 The following are the development guidelines used for developing the RPP API:
 
@@ -955,6 +1003,7 @@ The following are the development guidelines used for developing the RPP API:
 \end{compactitem}
 
 \section{Coding style}
+\label{sec-coding-style}
 In order to keep the code as clean as possible, a unified coding style should be followed by any contributor to the code. The rpp-lib project is prepared for a usage of a program named Uncrustify.
 
 The Uncrustify program checks the code and fixes those lines that does not match the coding style. However keep in mind that the program is not perfect and sometimes some lines can be modified even when they were following the suggestions. This does not causes problems as long as the contributor follows the committing procedure described in next paragraph.
@@ -967,6 +1016,7 @@ make uncrustify
 in a Linux terminal should be called. This command fixes any coding style errors. After that all changes can be committed.
 
 \section{Subdirectory  content description}
+\label{sec-subdirectory-content-description}
 \begin{description}
        \item[librpp.a and rpp-lib.lib] Version controlled RPP static libraries.
 
@@ -1006,6 +1056,7 @@ Implementation of \textsc{rpp\_\{mnemonic\}.h}'s functions on top of the DRV lib
 \end{description}
 
 \section{Compilation}
+\label{sec-compilation}
 
 The RPP Library can be compiled as a static library for ARM using TI CGT and for x86(\_64) using GCC. The library can be compiled for ARM under Linux and Windows using a Code Composer Studio project. The POSIX version is available for Linux and can be compiled in Linux system using an Eclipse project. After the compilation, as part of the build process, both procedures will automatically update the version-controlled static libraries in the library root.
 
@@ -1088,12 +1139,14 @@ main_page.dox
 \end{verbatim}
 
 \chapter{Simulink Coder Target}
+\label{chap-simulink-coder-target}
 
 The Simulink Coder Target allows to convert Simulink models to C code,
 compile it and download to the board.
 
 \hypertarget{description}{}
 \section{Introduction}
+\label{sec-introduction}
 
 The Simulink RPP Target provides support for C source code generation from Simulink models and
 compilation of that code on top of the RPP library and the FreeRTOS operating system. This target
@@ -1110,17 +1163,17 @@ board.
 \end{center}\end{figure}
 
 \section{Features}
-\label{sec:features}
+\label{sec-features}
 
 \begin{itemize}
 \item Support only single tasking.  If multitasking is required, it has to be implemented in a new file \textsc{rpp\_mrmain.tlc} in \textsc{\repo/rpp/rpp/} and \textsc{rpp\_file\_process.tlc} has to be edited to use that file, when multitasking is selected.
 \item No External mode support
-\item Custom compiler options, available via OPTS variable in \emph{Make command} at \emph{Code Generation} tab (see Figure~\ref{fig:code-gen-settings}). For example \textsc{make\_rtw OPTS="-O0 -g"}.
+\item Custom compiler options, available via OPTS variable in \emph{Make command} at \emph{Code Generation} tab (see Figure ). For example \textsc{make\_rtw OPTS="-O0 -g"}.
 
 \end{itemize}
 
 \section{RPP Options pane}
-\label{sec:rpp-target-options}
+\label{sec-rpp-target-options}
 
 The RPP Target includes the following configuration options, all of them configurable per model
 under  \textsc{Code Generation} \noindent$\rightarrow$ \textsc{RPP Options}:
@@ -1133,7 +1186,7 @@ under  \textsc{Code Generation} \noindent$\rightarrow$ \textsc{RPP Options}:
   code. See below. Default value is 4096.
 
 \item \textbf{C system heap size}:
-  \label{sec:rpp-target-options-heap-size} this parameter is passed
+  \label{sec-rpp-target-options-heap-size} this parameter is passed
   directly to the linker for the allocation of the heap. Currently,
   the heap is not used, but will be used by the external mode in the future. Note that FreeRTOS uses its own heap whose size is independent of this parameter.
 \item \textbf{Model step task stack size}: this parameter will be passed to the \textsc{xTaskCreate()} that
@@ -1189,6 +1242,7 @@ This feature is available for Linux system only.
 \end{itemize}
 
 \section{Subdirectory  content description}
+\label{sec-subdirectory-content-description}
 This section describes the directories of the Simulink Coder. If you are interested in particular file, refer the description at the beginning of the file.
 \begin{description}
        \item[doc/] Contains the sources of the documentation, you are now reading.
@@ -1203,10 +1257,11 @@ This section describes the directories of the Simulink Coder. If you are interes
 \end{description}
 
 \section{Block Library Overview}
+\label{sec-block-library-overview}
 The Simulink Block Library is a set of blocks that allows Simulink models to use board IO and 
 communication peripherals. The available blocks are summarized in
 Table~\ref{tab:block-lib-status} and more detailed description is
-given in Section~\ref{sec:blocks-description}.
+given in Section~\ref{sec-blocks-description}.
 
 \begin{table}
 \begin{center}\begin{tabular}{lp{5cm}lll}
@@ -1227,10 +1282,12 @@ System blocks & High-Power output block & \textsc{X} & \textsc{[HOUT]} & \textsc
 \end{table}
 
 \subsection{Blocks implementation}
+\label{sec-blocks-implementation}
 All of the blocks are implemented as a C Mex S-Function coded by hand. In this section the 
 approach taken is briefly explained.
 
 \subsubsection{C MEX S-Functions}
+\label{sec-c-mex-functions}
  \begin{compactitem}
  \item C : Implemented in C language. Other options are Fortran and Matlab language itself.
  \item MEX: Matlab Executable. They are compiled by Matlab - C compiler wrapper called MEX.
@@ -1308,6 +1365,7 @@ compile_blocks()
 \end{lstlisting}
 
 \subsubsection{Target Language Compiler files}
+\label{sec-target-language-compiler-files}
 
 In order to generate code for each one of those functions each S-Function implements a TLC file
 for \textit{inlining} the S-Function on the generated code. The TLC files are files that describe how to 
@@ -1364,9 +1422,9 @@ The file \textsc{$\langle$modelname$\rangle$.c} has 3 main functions:
 \end{compactitem}
 
 \subsection{Blocks description}
-\label{sec:blocks-description}
+\label{sec-blocks-description}
 
-This section describes each one of the Simulink blocks present in the Simulink RPP Library, illustrated in Figure \ref{fig:block-library}:
+This section describes each one of the Simulink blocks present in the Simulink RPP Library, illustrated in Figure \ref{fig-block-library}:
 
 \begin{figure}[H]
 \advance
@@ -1374,7 +1432,7 @@ This section describes each one of the Simulink blocks present in the Simulink R
 \noindent
 \includegraphics[width=530px]{images/block_library.png}
 \caption{Simulink RPP Block Library.}
-\label{fig:block-library}
+\label{fig-block-library}
 \end{figure}
 
 % Include automatically generated documentation