Relevant OS information on which this project was developed:
\begin{compactitem}
-\item Ubuntu 12.04.2 LTS AMD64.
-\item Kernel 3.2.0-48-generic.
-\item GCC version 4.6.3.
+\item Ubuntu 13.10 AMD64.
+\item Kernel 3.11.0-12-generic.
+\item GCC version 4.8.1.
\end{compactitem}
No test for cross-platform interoperability was performed on the code developed. Although care was
applications for Texas Instruments embedded processors. CCS is multiplatform Software based on
Eclipse Open Source IDE.
-The version used in this project is the 5.3.0. Download and install CCS for Linux from:
+The version used in this project is the 5.5.0. Download and install CCS for Linux from:
\begin{quotation}
\htmladdnormallink{http://processors.wiki.ti.com/index.php/Category:Code\_Composer\_Studio\_v5}{http://processors.wiki.ti.com/index.php/Category:Code\_Composer\_Studio\_v5}
CCS download requires a valid MyTI account. Tedious. CCS download is about 1.5GB. Once downloaded
extract the content of the \texttt{tar.gz} archiver and run \texttt{css\_setup\_$\langle$version$\rangle$.bin} script as
-\underline{root}. Installation must done as root in order to install driver set.
+\underline{root}. Installation must be done as root in order to install driver set.
After installation the application can be executed with:
\hypertarget{matlabsimulink}{}
\subsubsection{Matlab/Simulink}
-Matlab/Simulink version used is R2013a for Linux 64 bits. For in-house development the CVUT should
+Matlab/Simulink version used is R2013b for Linux 64 bits. For in-house development the CVUT should
provide a network licensing server descriptor file.
\hypertarget{gtkterm}{}
This function is optionally executed at the end of the build process if it is successful and the
user selected \textit{Download compiled binary to RPP} option on the build configuration panel. This
function calls \texttt{loadti.sh} script with the generated binary and using configuration for the
-XDS100v2 JTAG Emulators. The board should be powered and correctly wired. \newline{}
+XDS100v2 JTAG Emulators. Optionaly, when \textit{Use OpenOCD to download the binary file} is selected,
+the function calls \texttt{loadopenocd.sh} and will use OpenOCD to download the program to the board.
+The board should be powered and correctly wired. \newline{}
See \htmladdnormallink{Development wiring}{\#development\_wiring}.
\newpage
$\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}),
- the compiled binary will be downloaded to the to the board. After
- the download is finished you should reset the board to run the
- downloaded code.
+ the compiled binary will be downloaded to the to the board. The program
+ will start running right after the loading is finished.
Note: You should end the Code Composer Studio debug session before
downloading the generated code to the RPP board. Otherwise the
\textit{Generate code only} in the \textit{Code Generation} options panel, so it will try to upload even if
only source code has been generated, failing graciously or uploading an old binary laying around
in the build directory. This option calls the \texttt{rpp\_download.m} script, which is in turn a
- wrapper on the \texttt{loadti.sh} script. More information on the \texttt{loadti.sh} script can be found
- in:
+ wrapper on the \texttt{loadti.sh} and \texttt{loadopenocd.sh} script. More information on the \texttt{loadti.sh}
+ script can be found in:
\begin{verbatim}
<css>/ccs_base/scripting/examples/loadti/readme.txt
http://processors.wiki.ti.com/index.php/Loadti
\end{verbatim}
- The \texttt{loadti.sh} script will close after the download of the generated program and in
- consequence the execution of the loaded program will stop (because it works as the CCS debug
- server). In order to test the loaded model a manual reset of the board is always required after a
- successful download.
+ The \texttt{loadti.sh} script will close after the download of the generated program, leaving the loaded program running.
+
+ The \texttt{loadopenocd.sh} script will close after the download of the generated program as well, but the program will be stopped.
+ In order to test the loaded program a manual reset of the board is required.
+
+\item \textbf{Download compiled binary to SDRAM}: This feature is not yet implemented for the simulink target.
+ However the RPP library is ready to be linked to run from SDRAM and base program for SDRAM configuration, which
+ will always run from FLASH, is ready.
+
+\item \textbf{Use OpenOCD to download the compiled binary}: This option switches from Ti loading script \texttt{loadti.sh}
+ to OpenOCD script \texttt{loadopenocd.sh}. The benefit of using OpenOCD, besides that it is open source
+ software, is much shorter loading time. More information about the right OpenOCD version and its installation
+ can be found at:
+\begin{verbatim}
+http://rtime.felk.cvut.cz/hw/index.php/TMS570LS3137#OpenOCD_setup_and_Flashing
+\end{verbatim}
\item \textbf{Print model metadata to SCI at start}: if set this option will print a message to the Serial
Communication Interface when the model start execution on the board. This is very helpful to
communication not working. You should exist CCS debug session and
reset the board for External Mode to work again.
+Sometimes is needed to select ``serial'' transport layer twice to take
+the efect. Check that ``MEX-filename: ext\_comm'' has changed to ``MEX-filename: ext\_comm\_win32\_comm''.
+
+
\hypertarget{simulink_block_library}{}
\section{Simulink Block Library}
\textbf{Description:}
-This demo is sending data in different form to the CAN1 bus. The data are then received from CAN3 bus
-and printed to the SCI.
+Demostrates how to use CAN Transmit blocks in order to:
+
+\begin{compactenum}
+\item Send unpacked data with data type uint8, uint16 and uint32.
+\item Send single and multiple signals packed into CAN\_MESSAGE by CAN Pack block.
+\item Send a message as extended frame type to be received by CAN Receive configured to receive both, standard and extended frame types.
+\end{compactenum}
+
+Demostrates how to use CAN Receive blocks in order to:
+
+\begin{compactenum}
+\item Receive unpacked data of data types uint8, uint16 and uint32.
+\item Receive and unpack received CAN\_MESSAGE by CAN Unpack block.
+\item Configure CAN Receive block to receive Standard, Extended and both frame types.
+\item Use function-call mechanism to process received messages
+\end{compactenum}
\newpage
\textbf{Description:}
-This demo is sending data to the CAN1 port. The message is received on CAN2 port and a constatnt is
-added to it. The result is sent to the CAN2 port and received on CAN3 port, where another costant is
-added. The result is sent to the CAN3 port and received and printed by CAN1 port.
+This demo demonstrates simple processing of received messages.
\newpage
+FIXME: This is out of date, maybe not necessary to hawe two descriptions when one is already generated as a pdf file in doc folder.
+
#####################################
# Simulink Block Library for RPP #
#####################################
High-Power output block X [HOUT] rpp_hout.h
Communication blocks
- CAN Bus receive block X [CANR] rpp_can.h
- CAN Bus send msg block X [CANS] - Idem -
+ CAN Receive W [CANR] rpp_can.h
+ CAN Transmit W [CANS] - Idem -
+ CAN Setup W [CANS] - Idem -
LIN receive block X [LINR] rpp_lin.h
LIN send msg block X [LINS] - Idem -
- FlexRay receive block X [FRR ] rpp_fr.h
- FlexRay send msg block X [FRS ] - Idem -
+ FlexRay receive block T [FRR ] rpp_fr.h
+ FlexRay send msg block T [FRS ] - Idem -
SCI receive block T [SCIR] rpp_sci.h
SCI send msg block T [SCIS] - Idem -
SCI configure block T [SCIC] - Idem -
SDRAM write block X [SDRW] rpp_sdr.h
Trigger blocks
- Overrun detected block X [TROR] - None -
+ Overrun detected block T [TROR] - None -
Stack overflow detected X [TRSO] - None -
block
Malloc Failed detected X [TRMF] - None -
/*
%YAML 1.2
---
-Name: Receive CAN Message block
+Name: CAN Receive
Category: CAN
Header: rpp/can.h
Mnemonic: CANR
Untested:
- Handling of error states on CAN bus
Not working:
+ - Receiving at baudrate higher than 700kb
+ - External mode - throwing syntax error during compilation
RPP API functions used:
- rpp_can_read()
/*
%YAML 1.2
---
-Name: CAN Bus Configuration
+Name: CAN Setup
Category: CAN
Header: rpp/can.h
Mnemonic: CANC
- Configuring CAN1, CAN2 and CAN3
Untested:
Not working:
+ - Receiving at baudrate higher than 700kb
+ - External mode - throwing syntax error during compilation
RPP API functions used:
- rpp_can_init()
/*
%YAML 1.2
---
-Name: Send CAN Message block
+Name: CAN Transmit
Category: CAN
Header: rpp/can.h
Mnemonic: CANT
Untested:
- Handling of error states on CAN bus
Not working:
+ - External mode - throwing syntax error during compilation
RPP API functions used:
- rpp_can_write()
--- /dev/null
+******************************************************************************
+OpenOCD Generic Loader (loadopenocd)
+README.txt
+******************************************************************************
+
+
+DESCRIPTION
+===========
+
+Command line loader. For information about which version of OpenOCD, installation process
+and low level OpenOCD commands visit:
+http://rtime.felk.cvut.cz/hw/index.php/TMS570LS3137#OpenOCD_setup_and_Flashing
+
+This loader is available for Linux workstations only.
+
+INSTRUCTIONS
+============
+
+Run loadti batch file (WINDOWS) or shell script (LINUX):
+
+ Usage: loadopenocd [OPTION] -d TARGET -s OUT_FILE
+ Load OUT_FILE executable to target.
+
+ Available options:
+
+ -h Print help
+
+ -b Stop the program after it is loaded
+
+ -d Target destination selector - sdram or flash
+
+ -s File selector for binary file to be loaded
+
+ Examples:
+
+ Windows: not available
+ Linux: loadopenocd.sh -d flash -b -s ./bin/foo.out
+
-a, --async-run Run the specified executable and return without halting
- -b, --init-bss-section[=VALUE]
- Initialize .bss section to specified value, or 0 if
- value is omitted
-
-c, --cfg-file=CONFIG_FILE
Target setup config file
-
- -f --fileio=[FOLDER PATH]
- Specify the default folder to use for File IO
-
+
-h, --help Print help
-l, --load Load program only
- -mlr, --mem-load-raw="PAGE,ADDR,FILE,TYPE_SIZE,BYTE_SWAP"
- Load binary data file on host to target
-
- -mld, --mem-load-dat="PAGE,ADDR,FILE,LEN"
- Load *.dat file on host to target
-
- -msr, --mem-save-raw="PAGE,ADDR,FILE,LEN,TYPE_SIZE,BYTE_SWAP"
- Save data from target memory to binary file on the host
-
- -msd, --mem-save-dat="PAGE,ADDR,FILE,LEN,IO_FORMAT,APPEND"
- Save data from target memory to *.dat file on the host
-
- -n, --no-profile Do not perform basic application profiling (total
- cycles)
-
- -q, --quiet Quiet mode (only C I/O messages to the console)
-
-r, --reset Reset target before run
-s, --stdout-file=FILE
Save C I/O to specified file
- -t, --timeout=VALUE Overall scripting timeout value (in milliseconds)
-
- -v, --verbose Print informative messages during execution
-
- -x, --xml-log=FILE Generate specified XML log file
-
- -@, --options-file=FILE
- Use options from specified file
-
Debug Server configuration is done using the '-c' option The '-c' option
takes a target setup configuration file as the parameter. These files have a
*.ccxml extension and by default reside in
------------------------------------------------------------------------------
CALL loadti -c dm6446_sim_custom.ccxml myapp1.out
CALL loadti -c C:\TI\CCSv4\common\targetdb\configurations\tisim_c64xpbe.ccxml myapp3.out
- CALL loadti -c C:\TI\CCSv4\common\targetdb\configurations\tisim_c55xp_ca.ccxml -x myapp2log.xml myapp2.out arg1 arg2
+ CALL loadti -c C:\TI\CCSv4\common\targetdb\configurations\tisim_c55xp_ca.ccxml myapp2.out arg1 arg2
------------------------------------------------------------------------------
Linux (Example shell script):
------------------------------------------------------------------------------
loadti.sh -c dm6446_sim_custom.ccxml myapp1.out
loadti.sh -c /opt/ti/ccs4/common/targetdb/configurations/tisim_c64xpbe.ccxml myapp3.out
- loadti.sh -c /opt/ti/ccs4/common/targetdb/configurations/tisim_c55xp_ca.ccxml -x myapp2log.xml myapp2.out arg1 arg2
+ loadti.sh -c /opt/ti/ccs4/common/targetdb/configurations/tisim_c55xp_ca.ccxml myapp2.out arg1 arg2
------------------------------------------------------------------------------
- loadti.sh
Linux shell script that executes loadti.
-- DefaultStylesheet.xsl
- XML Stylesheet used by DSS XML logs.
-
- main.js
Main JavaScript.
+ This is a modified version inspired by the one provided by Ti in <CCS_ROOT>/ccs_base/scripting/examples/loadti.
+ It has reduced features and some improvements to fit our needs. The main feature is that the loaded program
+ starts running right after it is loaded, only necessary sectors of the FLASH memory are erased.
- dsSetup.js
JavaScript used to configure the Debug Server.
-- memXfer.js
- JavaScript used for host<->target data transfer.
-
- getArgs.js
JavaScript used for parsing command-line arguments.
+ This is a modified version inspired by the one provided by Ti in <CCS_ROOT>/ccs_base/scripting/examples/loadti.
+ It reflects reduced feature set by reducing accepted parameters.
- readme.txt
This text file.
included in the Code Generation Tools available with Code Composer Studio, and
thus it depends on it for proper functioning.
This library also provides support for automatically download the compiled
-machine code to the RPP board.
+machine code to the RPP board with CCS loadti script or, optionaly, with the OpenOCD.
+Find more abou OpenOCD Flashing on a page:
+http://rtime.felk.cvut.cz/hw/index.php/TMS570LS3137#OpenOCD_setup_and_Flashing
+
How to install RPP Target support:
(<ccs>/tools/compiler/arm_5.X.X/bin/armcl) and the Debug Server Scripting (DSS)
Generic Loader (<ccs>/ccs_base/scripting/examples/loadti/loadti.sh) command line
tools.
-Please note that all the development was done in a Ubuntu 12.04 LTS GNU/Linux
+Please note that all the development was done in a Ubuntu 13.10 GNU/Linux
machine using the CCS Linux version.
armcl reference documentation:
This function is optionally executed at the end of the build process
if it is successful and the user selected "Download compiled binary to
- RPP" option on the build configuration panel. This function calls
- loadti.sh script with the generated binary and using configuration for
- the XDS100v2 JTAG Emulators. The board should be powered and correctly
- wired. See "Wiring the RPP board for programming" on the main
- documentation files.
+ RPP" option on the build configuration panel. By default this function
+ calls loadti.sh script with the generated binary and using configuration for
+ the XDS100v2 JTAG Emulators. Optionaly, when "Use OpenOCD to download the
+ compiled binary" is selected, loadopenocd.sh script is used instead.
+ The board should be powered and correctly wired. See "Wiring the RPP
+ board for programming" on the main documentation files.
Reference:
Readme file in <css>/ccs_base/scripting/examples/loadti/readme.txt
loadti utility wiki at http://processors.wiki.ti.com/index.php/Loadti
+ openocd utility wiki at http://rtime.felk.cvut.cz/hw/index.php/TMS570LS3137#OpenOCD_setup_and_Flashing
-> rpp_file_process.tlc