<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.1  (Win32)">
	<META NAME="AUTHOR" CONTENT="Behnaz Bouchiat">
	<META NAME="CREATED" CONTENT="20070215;16355300">
	<META NAME="CHANGEDBY" CONTENT="Behnaz Bouchiat">
	<META NAME="CHANGED" CONTENT="20070227;14113393">
	<STYLE>
	<!--
		@page { size: 21cm 29.7cm; margin: 2cm }
		H1 { margin-bottom: 0.21cm }
		H1.western { font-family: "Times New Roman", serif }
		H1.cjk { font-family: "Lucida Sans Unicode" }
		H1.ctl { font-family: "Tahoma" }
		P { margin-bottom: 0.21cm }
		P.subtitle-ride7-western { margin-top: 1cm; margin-bottom: 0.5cm; color: #000080; font-family: "Verdana", sans-serif; font-weight: bold; line-height: 100%; page-break-before: auto; page-break-after: auto }
		P.subtitle-ride7-cjk { margin-top: 1cm; margin-bottom: 0.5cm; color: #000080; line-height: 100%; page-break-before: auto; page-break-after: auto }
		P.subtitle-ride7-ctl { margin-top: 1cm; margin-bottom: 0.5cm; color: #000080; line-height: 100%; page-break-before: auto; page-break-after: auto }
	-->
	</STYLE>
</HEAD>
<BODY LANG="fr-FR" BGCOLOR="#eef6fe" DIR="LTR">
<H1 CLASS="western" STYLE="margin-top: 0.43cm; margin-bottom: 0.51cm; border-top: none; border-bottom: 1px solid #99ccff; border-left: none; border-right: none; padding-top: 0cm; padding-bottom: 0.05cm; padding-left: 0cm; padding-right: 0cm">
<IMG SRC="../Ride7_logo.gif" NAME="graphics4" ALIGN=LEFT WIDTH=36 HEIGHT=37 BORDER=0><FONT COLOR="#000080"><FONT FACE="Verdana, sans-serif"><FONT SIZE=5 STYLE="font-size: 20pt"><SPAN STYLE="background: transparent"><SPAN STYLE="font-weight: medium"><FONT SIZE=2>Ride7
IDE</FONT></SPAN> </SPAN></FONT></FONT></FONT>
</H1>
<H1 LANG="en" CLASS="western" STYLE="margin-top: 0.43cm; margin-bottom: 0.51cm; border: none; padding: 0cm">
<FONT COLOR="#000080"><FONT FACE="Verdana, sans-serif"><FONT SIZE=4><SPAN STYLE="background: transparent">Getting
Started With Ride7 for ST7</SPAN></FONT></FONT></FONT></H1>
<P STYLE="font-weight: medium">Within <B>Ride7</B>, you work within
the context of a project, which consists of an organized group of
source files, and associated project-specific properties files; and
all the tools you'll need to write, compile, and debug your
application. 
</P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm">
<BR>
</P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm">
<B>Creating a new project</B></P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm">
<BR>
</P>
<P STYLE="font-weight: medium">So we are getting started with
creating a simple project for STLITE30 processor:</P>
<OL>
	<LI><P STYLE="margin-bottom: 0.1cm">From the <B>File</B> menu, click
	<B>New</B> then <B>Project</B>... 
	</P>
	<LI><P STYLE="margin-bottom: 0.1cm">From the <B>Type</B> combo list,
	select <B>'New application to be built'</B>.</P>
	<LI><P STYLE="margin-bottom: 0.1cm; font-weight: medium">From the
	<B>Processor </B>list select ST7LITE30 for which we want to create
	the application.</P>
	<LI><P STYLE="margin-bottom: 0.1cm; font-weight: medium">Give a name
	to project, let's say 'MyApplication'.</P>
	<LI><P STYLE="margin-bottom: 0.1cm; font-weight: medium">Select
	'Launch RBuilder to generate source files'.</P>
	<LI><P STYLE="margin-bottom: 0.1cm; font-weight: medium">Click
	<B>Terminate </B>to start working with <B>RBuilder.</B></P>
	<P STYLE="margin-bottom: 0.1cm"></P>
	<P><IMG SRC="prj_create.gif" NAME="graphics1" ALIGN=LEFT WIDTH=516 HEIGHT=569 BORDER=0><BR CLEAR=LEFT></P>
</OL>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm">
<BR>
</P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm">
<B>Using RBuilder to generate source files</B></P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm">
<BR>
</P>
<P STYLE="margin-bottom: 0cm; font-weight: medium; page-break-before: always">
<B>RBuilder</B> is an application builder based on the <B>ST7
Software Library</B>. It guides you through the configuration of your
project, allowing you to choose the peripherals you want to use and
configure the options for each peripheral. We are going to use
<B>RBuilder </B>to generate source for using SCI peripheral of the
ST7LITE30 processor:</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<OL>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium">From the
	peripherals pane select SCI.</P>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium">From the
	<B>'Options for the current peripheral'</B> pane, check <B>'Configure
	and use SCI'</B></P>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium">The possible
	settings of SCI peripheral become visible. We are keeping the
	default settings. 
	</P>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium">Select
	<B>'Generate SCI Sample Code'</B> to make RBuilder create a sample
	source using SCI peripheral.</P>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium">Select <B>Action
	</B>| <B>Project Generation</B> from the menu tool bar.</P>
	<P STYLE="margin-bottom: 0cm; font-weight: medium"></P>
</OL>
<P STYLE="margin-bottom: 0cm"><IMG SRC="prj_rbuilder.gif" NAME="graphics2" ALIGN=LEFT WIDTH=613 HEIGHT=420 BORDER=0><BR CLEAR=LEFT><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><B>RBuilder</B> will generate a project
and Ride7 will automatically open this project <FONT FACE="Times New Roman, serif">.MyApplication
project contains<FONT COLOR="#000000">:</FONT></FONT></P>
<OL>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium"><FONT COLOR="#000000"><FONT FACE="Times New Roman, serif"><FONT SIZE=3>MyApplicationmain.c
	which is the main file of the project. In this file, RBuilder
	generates the initialization function for all peripherals, the
	&quot;main()&quot; function and any user requested functions (for
	the SCI in our case).</FONT></FONT></FONT></P>
	<LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Times New Roman, serif"><FONT SIZE=3>SCI.c
	contains source code for all the functions of SCI.</FONT></FONT></P>
</OL>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm">
<B>Ride7 projects workspace</B></P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm; font-weight: medium"><B>Ride7</B>
<B>Project Explorer</B> allows you to see all your objects in a
project represented as nodes of a tree, each having its own icon to
represent the type of object the node represents. If you click on a
node, it opens up into a subtree that contains more detail. You can
collapse or expand trees as necessary. Right-clicking on any node
provides easy access to specific commands that you can perform and
tools that you can use on that object. Double Clicking on a source
node, MyApplicationmain.c for example, will open the source file for
Editing<U>.</U></P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><IMG SRC="GettingStartedST7_html_m2f76005d.jpg" NAME="graphics3" ALIGN=LEFT WIDTH=835 HEIGHT=745 BORDER=0><BR CLEAR=LEFT><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none">
You can click right into the <B>Ride7 Source Editor</B> and write
code. When you write code this way, you'll notice that the editor
automatically highlights code in color as appropriate. <B>Ride7</B>
Editor is based on <B>Scintilla</B> and is coming with a lot of
useful features for programming, like drag and drop code, outlining
code, brace highlighting. 
</P>
<P STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none">
Inspecting the generated code by <B>RBuilder</B> you can notice that:</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<UL>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none">
	<FONT COLOR="#000000"><FONT FACE="Times New Roman, serif"><FONT SIZE=3>The
	&quot;PeriphInit&quot; function performs initialization for all
	peripherals according to the options you selected in <B>RBuilder</B>.
	</FONT></FONT></FONT>
	</P>
	<LI><P STYLE="margin-bottom: 0cm"><FONT COLOR="#000000"><FONT FACE="Times New Roman, serif"><FONT SIZE=3>The
	&quot;main&quot; function is made of a call to &quot;PeriphInit&quot;
	to initialize all peripherals, followed by an infinite loop that
	contains the application code. </FONT></FONT></FONT>
	</P>
</UL>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><FONT COLOR="#000000"><FONT FACE="Times New Roman, serif"><FONT SIZE=3>We
are going to modify the source code to insert a counter variable in
our infinite loop;</FONT></FONT></FONT></P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><IMG SRC="GettingStartedST7_html_61a46d06.gif" NAME="graphics12" ALIGN=LEFT WIDTH=432 HEIGHT=266 BORDER=0><BR CLEAR=LEFT><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none">
All the settings of your project are available from the <B>Properties
Window Explorer. </B>This pane is synchronized with th a Project
Explorer pane. When you select a node in the explorer window, the
<B>Properties Window</B> will display the settings of this node.</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm; text-decoration: none">
<B>Building project</B></P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm">
<BR>
</P>
<P STYLE="margin-bottom: 0cm"><B>Ride7 </B>has selected the best
settings according to our select ST7LITE30 processor, so we are now
ready to build our application. From the <B>Project </B>menu select
<B>Build. Ride7</B> will automatically launch the <B>RCST7</B>
compiler and <B>RLST7</B> Linker to build our application. You can
inspect the command line for each tool from the <B>Build Report</B>
pane.</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><IMG SRC="GettingStartedST7_html_m702a6b51.jpg" NAME="graphics5" ALIGN=LEFT WIDTH=742 HEIGHT=305 BORDER=0><BR CLEAR=LEFT><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm; font-weight: medium">Errors or warnings
are highlighted in this pane. You can click on the corresponding
line, the source error will display and mark the corresponding error
line in the <B>Source Editor. </B>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><IMG SRC="GettingStartedST7_html_3cb3ca70.gif" NAME="graphics6" ALIGN=LEFT WIDTH=457 HEIGHT=90 BORDER=0><BR CLEAR=LEFT><BR>
</P>
<P STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none">
Upon a successful build the Project Explorer will display the size of
code and data used in each item of your application beside its node,
you can also get more details information about the build process
with selecting the info command from the project's Explorer toolbar.</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><IMG SRC="prj_info.gif" NAME="graphics7" ALIGN=LEFT WIDTH=544 HEIGHT=169 BORDER=0><BR CLEAR=LEFT><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm; font-weight: medium; text-decoration: none">
Upon a successful build the <B>Globals Window</B> will display the
symbol table of all the global variables, typedefs, defines and
functions . From this list you can inspect the definition of each
item, and double clicking an item will open the source file at line
where the symbol is defined.</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><IMG SRC="GettingStartedST7_html_1738d1e2.jpg" NAME="graphics8" ALIGN=LEFT WIDTH=552 HEIGHT=421 BORDER=0><BR CLEAR=LEFT><BR>
</P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm">
<BR>
</P>
<P CLASS="subtitle-ride7-western" STYLE="margin-top: 0.1cm; margin-bottom: 0cm; text-decoration: none">
<B>Debugging project</B></P>
<P STYLE="margin-bottom: 0cm">Debugging is the process of examining
your application for errors. Our application has been properly built,
so we are going to select the <B>ST7 Simulator</B> and select the
trace feature of the simulator to trace the execution of our
application. 
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<OL>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium">From the
	<B>Project Explorer</B> select <B>MyApplication</B> application
	node.</P>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium">From the
	<B>Properties Window</B> select <B>Advanced ST7 Options| Debug
	Environment | Simulator SIM-ST7.</B></P>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium">From the same
	window check the simulation options from <B>ST7 Simulator | Advanced
	Options.</B></P>
	<LI><P STYLE="margin-bottom: 0cm; font-weight: medium">From <B>ST7
	Simulator | Trace Execution</B> select '<B>Continous'</B> Trace
	Mode.</P>
</OL>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm"><IMG SRC="prj_settings.gif" NAME="graphics9" ALIGN=LEFT WIDTH=543 HEIGHT=602 BORDER=0><BR CLEAR=LEFT><BR>
</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P STYLE="margin-bottom: 0cm; font-weight: medium">Use the <B>Debug |
Start </B>command to start the debug session. <B>Ride7</B> will open
the debugging workspace, download the application in the virtual
memory of the simulator and execute the application to reach the main
function:</P>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<P><IMG SRC="GettingStartedST7_html_300db499.jpg" NAME="graphics10" ALIGN=LEFT WIDTH=930 HEIGHT=745 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P STYLE="font-weight: medium">To execute the application, you can
<B>Run</B>, <B>Run to</B>, <B>Step Into</B>, <B>Step Over</B>, <B>Step
Out </B>commands. You can also use breakpoints, a breakpoint is a
flag in the source code that tells the debugger to stop execution of
the program. When your program stops on a breakpoint, you can perform
actions such as examining the value of variables.You can also set
line breakpoints directly in the Source Editor with clicking the
corresponding column beside the line:</P>
<P><BR><BR>
</P>
<P><IMG SRC="prj_break.gif" NAME="graphics11" ALIGN=LEFT WIDTH=496 HEIGHT=87 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P STYLE="font-weight: medium">Use the <B>Debug | Run</B> command to
launch the execution of the simulation. The program execution will
automatically break when the breakpoint is reached. The execution
point is marked with a blue arrow int he source editor and a blue
line in the disassembly view.</P>
<P STYLE="font-weight: medium">Hovering the mouse pointer over a
variable like counter will show its value as a tooltip:</P>
<P><BR><BR>
</P>
<P><IMG SRC="GettingStartedST7_html_m7495a4fe.gif" NAME="graphics13" ALIGN=LEFT WIDTH=515 HEIGHT=117 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P STYLE="font-weight: medium">You can also use the <B>watch</B>
feature, that enables you to track the changes in the value of a
variable or expression during program execution. Open the <B>Watch
Window</B> from <B>View | Debug Windows | View Watch</B> , and drag
and drop 'counter' variable from the editor to this window.The
variable is immediately evaluated and displayed in the Watch window.
The value of the watch is based on the current context. 
</P>
<P><IMG SRC="prj_watch.gif" NAME="graphics14" ALIGN=LEFT WIDTH=617 HEIGHT=238 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P STYLE="font-weight: medium">The <B>Debug Explorer </B>window gives
you access to the main memory dumps views and peripheral views of the
ST7LITE30:</P>
<OL>
	<LI><P STYLE="font-weight: medium"><B>Memory View</B> and <B>Bit
	View </B>displays the content of the memory dumps from where you can
	inspect and modify values. 
	</P>
	<LI><P><B>Disassembly View </B>displays the disassembly code of the
	application, the corresponding code address, the number of times the
	code ahs been executed, and the last action that the instruction has
	executed. 
	</P>
	<LI><P><B>Registers </B>is a graphical view from where you can
	inspect and modify the main registers of the processor.</P>
	<LI><P><B>Peripherals: </B>is the list of peripheral views available
	from the simulator.</P>
</OL>
<P STYLE="font-weight: medium">From the peripheral list double click
on the SCI 0 to open the SCI 0 peripheral's View, you can view now
the result of our first printf command:</P>
<P><IMG SRC="GettingStartedST7_html_ma089250.jpg" NAME="graphics15" ALIGN=LEFT WIDTH=587 HEIGHT=296 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P STYLE="font-weight: medium">The <B>Trace Feature</B> has recorded
the execution of your program, Select <B>View | Debug Windows | View
Trace</B> to open the trace view. 
</P>
<P STYLE="font-weight: medium">In this version of Ride, the trace
feature records the following information for each executed
instruction:</P>
<UL>
	<LI><P STYLE="font-weight: medium">Simulation Time</P>
	<LI><P STYLE="font-weight: medium">PC</P>
	<LI><P STYLE="font-weight: medium">SP</P>
	<LI><P STYLE="font-weight: medium">Last Action</P>
</UL>
<P STYLE="font-weight: medium">It displays the recorded values in a
list but also graphical display that you can use to evaluate the time
spent in execution of instructions and the stack usage. 
</P>
<P><IMG SRC="GettingStartedST7_html_m23ea236f.jpg" NAME="graphics16" ALIGN=LEFT WIDTH=804 HEIGHT=546 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
</BODY>
</HTML>