<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- permission is obtained from the copyright holder. -->
|
<!-- permission is obtained from the copyright holder. -->
|
<HTML
|
<HTML
|
><HEAD
|
><HEAD
|
><TITLE
|
><TITLE
|
>NEC CEB-V850/SA1 Hardware Setup</TITLE
|
>NEC CEB-V850/SA1 Hardware Setup</TITLE
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
<META
|
<META
|
NAME="GENERATOR"
|
NAME="GENERATOR"
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
"><LINK
|
"><LINK
|
REL="HOME"
|
REL="HOME"
|
TITLE="eCos User Guide"
|
TITLE="eCos User Guide"
|
HREF="ecos-user-guide.html"><LINK
|
HREF="ecos-user-guide.html"><LINK
|
REL="UP"
|
REL="UP"
|
TITLE="Target Setup"
|
TITLE="Target Setup"
|
HREF="appendix-target-setup.html"><LINK
|
HREF="appendix-target-setup.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="SH4/SE7751 Hardware Setup"
|
TITLE="SH4/SE7751 Hardware Setup"
|
HREF="setup-sh-se7751.html"><LINK
|
HREF="setup-sh-se7751.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="NEC CEB-V850/SB1 Hardware Setup"
|
TITLE="NEC CEB-V850/SB1 Hardware Setup"
|
HREF="setup-v850-cebsb1.html"></HEAD
|
HREF="setup-v850-cebsb1.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="SECT1"
|
CLASS="SECT1"
|
BGCOLOR="#FFFFFF"
|
BGCOLOR="#FFFFFF"
|
TEXT="#000000"
|
TEXT="#000000"
|
LINK="#0000FF"
|
LINK="#0000FF"
|
VLINK="#840084"
|
VLINK="#840084"
|
ALINK="#0000FF"
|
ALINK="#0000FF"
|
><DIV
|
><DIV
|
CLASS="NAVHEADER"
|
CLASS="NAVHEADER"
|
><TABLE
|
><TABLE
|
SUMMARY="Header navigation table"
|
SUMMARY="Header navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TH
|
><TH
|
COLSPAN="3"
|
COLSPAN="3"
|
ALIGN="center"
|
ALIGN="center"
|
>eCos User Guide</TH
|
>eCos User Guide</TH
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="setup-sh-se7751.html"
|
HREF="setup-sh-se7751.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="80%"
|
WIDTH="80%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
>Appendix A. Target Setup</TD
|
>Appendix A. Target Setup</TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="setup-v850-cebsb1.html"
|
HREF="setup-v850-cebsb1.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"></DIV
|
WIDTH="100%"></DIV
|
><DIV
|
><DIV
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><H1
|
><H1
|
CLASS="SECT1"
|
CLASS="SECT1"
|
><A
|
><A
|
NAME="SETUP-V850-CEBSA1">NEC CEB-V850/SA1 Hardware Setup</H1
|
NAME="SETUP-V850-CEBSA1">NEC CEB-V850/SA1 Hardware Setup</H1
|
><P
|
><P
|
>The CEB-V850 board is fitted with a socketed EPROM. The internal
|
>The CEB-V850 board is fitted with a socketed EPROM. The internal
|
Flash of the V850 supplied with the CEB-V850 boards defaults to
|
Flash of the V850 supplied with the CEB-V850 boards defaults to
|
vectoring into this EPROM. A GDB stub image should be programmed
|
vectoring into this EPROM. A GDB stub image should be programmed
|
into an EPROM fitted to this board, and a pre-built image is provided
|
into an EPROM fitted to this board, and a pre-built image is provided
|
at <TT
|
at <TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>loaders/v850-ceb_v850/v850sa1/gdb_module.bin </TT
|
>loaders/v850-ceb_v850/v850sa1/gdb_module.bin </TT
|
>under
|
>under
|
the root of your eCos installation.</P
|
the root of your eCos installation.</P
|
><P
|
><P
|
>The EPROM is installed to the socket labelled U7 on the board.
|
>The EPROM is installed to the socket labelled U7 on the board.
|
Attention should be paid to the correct orientation of the EPROM
|
Attention should be paid to the correct orientation of the EPROM
|
during installation. </P
|
during installation. </P
|
><P
|
><P
|
>When programming an EPROM using the binary image, be careful
|
>When programming an EPROM using the binary image, be careful
|
to get the byte order correct. It needs to be little-endian. If
|
to get the byte order correct. It needs to be little-endian. If
|
the EPROM burner software has a hex-editor, check that the first
|
the EPROM burner software has a hex-editor, check that the first
|
few bytes of the image look similar to: </P
|
few bytes of the image look similar to: </P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>00000000: 0018 8007 5e02 0000 0000 0000 0000 0000</PRE
|
>00000000: 0018 8007 5e02 0000 0000 0000 0000 0000</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><P
|
><P
|
>If the byte order is wrong you will see 1800 instead of 0018
|
>If the byte order is wrong you will see 1800 instead of 0018
|
etc. Use the EPROM burner software to make a byte-swap before you
|
etc. Use the EPROM burner software to make a byte-swap before you
|
burn to image to the EPROM. </P
|
burn to image to the EPROM. </P
|
><P
|
><P
|
>If the GDB stub EPROM you burn does not work, try reversing
|
>If the GDB stub EPROM you burn does not work, try reversing
|
the byte-order, even if you think you have it the right way around.
|
the byte-order, even if you think you have it the right way around.
|
At least one DOS-based EPROM burner program is known to have the
|
At least one DOS-based EPROM burner program is known to have the
|
byte-order upside down.</P
|
byte-order upside down.</P
|
><P
|
><P
|
>The GDB stub in the EPROM allows communication with GDB using
|
>The GDB stub in the EPROM allows communication with GDB using
|
the serial port. The communication parameters are fixed at 38400
|
the serial port. The communication parameters are fixed at 38400
|
baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No flow
|
baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No flow
|
control is employed. Connection to the host computer should be made
|
control is employed. Connection to the host computer should be made
|
using a dedicated serial cable as specified in the CEB-V850/SA1
|
using a dedicated serial cable as specified in the CEB-V850/SA1
|
manual.</P
|
manual.</P
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="AEN4279">Installing the Stubs into ROM</H2
|
NAME="AEN4279">Installing the Stubs into ROM</H2
|
><DIV
|
><DIV
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><H3
|
><H3
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><A
|
><A
|
NAME="AEN4281">Preparing the Binaries</H3
|
NAME="AEN4281">Preparing the Binaries</H3
|
><P
|
><P
|
>These two binary preparation steps are not strictly necessary
|
>These two binary preparation steps are not strictly necessary
|
as the eCos distribution ships with pre-compiled binaries in the
|
as the eCos distribution ships with pre-compiled binaries in the
|
directory loaders/v850-ceb_v850 relative to the
|
directory loaders/v850-ceb_v850 relative to the
|
installation root.</P
|
installation root.</P
|
><DIV
|
><DIV
|
CLASS="SECT4"
|
CLASS="SECT4"
|
><H4
|
><H4
|
CLASS="SECT4"
|
CLASS="SECT4"
|
><A
|
><A
|
NAME="AEN4284">Building the ROM images with the eCos Configuration Tool</H4
|
NAME="AEN4284">Building the ROM images with the eCos Configuration Tool</H4
|
><P
|
><P
|
></P
|
></P
|
><OL
|
><OL
|
TYPE="1"
|
TYPE="1"
|
><LI
|
><LI
|
><P
|
><P
|
>Start with a new document - selecting the
|
>Start with a new document - selecting the
|
<SPAN
|
<SPAN
|
CLASS="emphasis"
|
CLASS="emphasis"
|
><I
|
><I
|
CLASS="EMPHASIS"
|
CLASS="EMPHASIS"
|
>File->New</I
|
>File->New</I
|
></SPAN
|
></SPAN
|
>
|
>
|
menu item if necessary to do this.</P
|
menu item if necessary to do this.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Choose the
|
>Choose the
|
<SPAN
|
<SPAN
|
CLASS="emphasis"
|
CLASS="emphasis"
|
><I
|
><I
|
CLASS="EMPHASIS"
|
CLASS="EMPHASIS"
|
>Build->Templates</I
|
>Build->Templates</I
|
></SPAN
|
></SPAN
|
>
|
>
|
menu item, and then select the NEC CEB-V850/SA1 hardware.</P
|
menu item, and then select the NEC CEB-V850/SA1 hardware.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>While still displaying the
|
>While still displaying the
|
<SPAN
|
<SPAN
|
CLASS="emphasis"
|
CLASS="emphasis"
|
><I
|
><I
|
CLASS="EMPHASIS"
|
CLASS="EMPHASIS"
|
>Build->Templates</I
|
>Build->Templates</I
|
></SPAN
|
></SPAN
|
>
|
>
|
dialog box, select the “stubs” package template
|
dialog box, select the “stubs” package template
|
to build a GDB stub. Click
|
to build a GDB stub. Click
|
<SPAN
|
<SPAN
|
CLASS="emphasis"
|
CLASS="emphasis"
|
><I
|
><I
|
CLASS="EMPHASIS"
|
CLASS="EMPHASIS"
|
>OK</I
|
>OK</I
|
></SPAN
|
></SPAN
|
>.</P
|
>.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Build eCos using
|
>Build eCos using
|
<SPAN
|
<SPAN
|
CLASS="emphasis"
|
CLASS="emphasis"
|
><I
|
><I
|
CLASS="EMPHASIS"
|
CLASS="EMPHASIS"
|
>Build->Library</I
|
>Build->Library</I
|
></SPAN
|
></SPAN
|
>. </P
|
>. </P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>When the build completes, the image files can be found
|
>When the build completes, the image files can be found
|
in the bin/ subdirectory of the install tree. GDB stub
|
in the bin/ subdirectory of the install tree. GDB stub
|
ROM images have the prefix “gdb_module”.</P
|
ROM images have the prefix “gdb_module”.</P
|
></LI
|
></LI
|
></OL
|
></OL
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT4"
|
CLASS="SECT4"
|
><H4
|
><H4
|
CLASS="SECT4"
|
CLASS="SECT4"
|
><A
|
><A
|
NAME="AEN4302">Building the ROM images with ecosconfig</H4
|
NAME="AEN4302">Building the ROM images with ecosconfig</H4
|
><P
|
><P
|
></P
|
></P
|
><OL
|
><OL
|
TYPE="1"
|
TYPE="1"
|
><LI
|
><LI
|
><P
|
><P
|
>Make an empty directory to contain the build tree,
|
>Make an empty directory to contain the build tree,
|
and cd into it. </P
|
and cd into it. </P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>To build a GDB stub ROM image, enter the command:
|
>To build a GDB stub ROM image, enter the command:
|
|
|
<TABLE
|
<TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>$ ecosconfig new ceb-v850 stubs </PRE
|
>$ ecosconfig new ceb-v850 stubs </PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></P
|
></P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Enter the commands:
|
>Enter the commands:
|
|
|
<TABLE
|
<TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>$ ecosconfig tree
|
>$ ecosconfig tree
|
$ make</PRE
|
$ make</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
>
|
>
|
</P
|
</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>When the build completes, the image files can be found
|
>When the build completes, the image files can be found
|
in the bin/ subdirectory of the install tree. GDB stub
|
in the bin/ subdirectory of the install tree. GDB stub
|
ROM images have the prefix “gdb_module”.</P
|
ROM images have the prefix “gdb_module”.</P
|
></LI
|
></LI
|
></OL
|
></OL
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><H3
|
><H3
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><A
|
><A
|
NAME="AEN4315">Installing the Stubs into ROM or FLASH</H3
|
NAME="AEN4315">Installing the Stubs into ROM or FLASH</H3
|
><P
|
><P
|
></P
|
></P
|
><OL
|
><OL
|
TYPE="1"
|
TYPE="1"
|
><LI
|
><LI
|
><P
|
><P
|
> Program the binary image file gdb_module.bin
|
> Program the binary image file gdb_module.bin
|
into ROM or FLASH referring to the instructions of your ROM
|
into ROM or FLASH referring to the instructions of your ROM
|
programmer. </P
|
programmer. </P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
> Plug the ROM/FLASH into the socket as described
|
> Plug the ROM/FLASH into the socket as described
|
at the beginning of this section.</P
|
at the beginning of this section.</P
|
></LI
|
></LI
|
></OL
|
></OL
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><H2
|
><H2
|
CLASS="SECT2"
|
CLASS="SECT2"
|
><A
|
><A
|
NAME="AEN4322">Debugging with the NEC V850 I.C.E.</H2
|
NAME="AEN4322">Debugging with the NEC V850 I.C.E.</H2
|
><P
|
><P
|
>eCos applications may be debugged using the NEC V850 In Circuit
|
>eCos applications may be debugged using the NEC V850 In Circuit
|
Emulator (I.C.E.) A PC running Microsoft Windows is required in
|
Emulator (I.C.E.) A PC running Microsoft Windows is required in
|
order to run the NEC ICE software and drivers. In addition Red Hat
|
order to run the NEC ICE software and drivers. In addition Red Hat
|
have developed a “libremote” server application
|
have developed a “libremote” server application
|
named v850ice.exe which is used on the PC connected to the I.C.E.
|
named v850ice.exe which is used on the PC connected to the I.C.E.
|
in order to allow connections from GDB.</P
|
in order to allow connections from GDB.</P
|
><P
|
><P
|
>The I.C.E. must be physically connected to a Windows NT system
|
>The I.C.E. must be physically connected to a Windows NT system
|
through NEC"s PCI or PC Card interface. A driver, DLLs,
|
through NEC"s PCI or PC Card interface. A driver, DLLs,
|
and application are provided by NEC to control the I.C.E.</P
|
and application are provided by NEC to control the I.C.E.</P
|
><P
|
><P
|
>v850ice is a Cygwin based server that runs on the NT system
|
>v850ice is a Cygwin based server that runs on the NT system
|
and provides an interface between the gdb client and the I.C.E.
|
and provides an interface between the gdb client and the I.C.E.
|
software. v850-elf-gdb may be run on the Windows NT system or on
|
software. v850-elf-gdb may be run on the Windows NT system or on
|
a remote system. v850-elf-gdb communicates with the libremote server
|
a remote system. v850-elf-gdb communicates with the libremote server
|
using the gdb remote protocol over a TCP/IP socket. v850ice
|
using the gdb remote protocol over a TCP/IP socket. v850ice
|
communicates with the I.C.E. by calling functions in the NECMSG.DLL provided
|
communicates with the I.C.E. by calling functions in the NECMSG.DLL provided
|
by NEC.</P
|
by NEC.</P
|
><DIV
|
><DIV
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><H3
|
><H3
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><A
|
><A
|
NAME="AEN4327">INITIAL SETUP</H3
|
NAME="AEN4327">INITIAL SETUP</H3
|
><P
|
><P
|
></P
|
></P
|
><OL
|
><OL
|
TYPE="1"
|
TYPE="1"
|
><LI
|
><LI
|
><P
|
><P
|
>Configure the hardware including the I.C.E., SA1 or
|
>Configure the hardware including the I.C.E., SA1 or
|
SB1 Option Module, and target board. Install the interface card
|
SB1 Option Module, and target board. Install the interface card
|
in the Windows NT system. Reference NEC"s documentation
|
in the Windows NT system. Reference NEC"s documentation
|
for interface installation, jumper settings, etc.</P
|
for interface installation, jumper settings, etc.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Install the Windows NT device driver provided by NEC.</P
|
>Install the Windows NT device driver provided by NEC.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Copy the NEC DLLs, MDI application, and other support
|
>Copy the NEC DLLs, MDI application, and other support
|
files to a directory on the Windows NT system. The standard location
|
files to a directory on the Windows NT system. The standard location
|
is C:\NecTools32. This directory will be referred to as
|
is C:\NecTools32. This directory will be referred to as
|
the "libremote server directory" in this document. v850ice.exe must
|
the "libremote server directory" in this document. v850ice.exe must
|
also be copied to this directory after being built. The required
|
also be copied to this directory after being built. The required
|
files are: cpu.cfg, Nec.cfg, MDI.EXE, NECMSG.DLL, EX85032.DLL,
|
files are: cpu.cfg, Nec.cfg, MDI.EXE, NECMSG.DLL, EX85032.DLL,
|
V850E.DLL, IE850.MON, IE850E.MON, and D3037A.800.</P
|
V850E.DLL, IE850.MON, IE850E.MON, and D3037A.800.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Make certain the file cpu.cfg contains the line:</P
|
>Make certain the file cpu.cfg contains the line:</P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>CpuOption=SA1</PRE
|
>CpuOption=SA1</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><P
|
><P
|
>if using a V850/SA1 module, or:</P
|
>if using a V850/SA1 module, or:</P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>CpuOption=SB1</PRE
|
>CpuOption=SB1</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><P
|
><P
|
>if using a V850/SB1 module.</P
|
>if using a V850/SB1 module.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Set the environment variable IEPATH to point to the libremote
|
>Set the environment variable IEPATH to point to the libremote
|
server</P
|
server</P
|
><P
|
><P
|
>directory.</P
|
>directory.</P
|
></LI
|
></LI
|
></OL
|
></OL
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><H3
|
><H3
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><A
|
><A
|
NAME="AEN4345">BUILD PROCEDURES</H3
|
NAME="AEN4345">BUILD PROCEDURES</H3
|
><P
|
><P
|
>A pre-built v850ice.exe executable is supplied in the loaders/v850-ceb_v850 directory
|
>A pre-built v850ice.exe executable is supplied in the loaders/v850-ceb_v850 directory
|
relative to the root of the eCos installation. However the following process
|
relative to the root of the eCos installation. However the following process
|
will allow the rebuilding of this executable if required:</P
|
will allow the rebuilding of this executable if required:</P
|
><P
|
><P
|
>For this example assume the v850ice libremote tree has been
|
>For this example assume the v850ice libremote tree has been
|
copied to a directory named "server". The directory structure will
|
copied to a directory named "server". The directory structure will
|
be similar to the following diagram:</P
|
be similar to the following diagram:</P
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
> server
|
> server
|
|
|
|
|
devo
|
devo
|
/ \
|
/ \
|
config libremote
|
config libremote
|
/ \
|
/ \
|
lib v850ice</PRE
|
lib v850ice</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></P
|
></P
|
><P
|
><P
|
>Build the v850ice source as follows. Be sure to use the native
|
>Build the v850ice source as follows. Be sure to use the native
|
Cygwin compiler tools that were supplied alongside eCos.</P
|
Cygwin compiler tools that were supplied alongside eCos.</P
|
><P
|
><P
|
>cd server
|
>cd server
|
mkdir build
|
mkdir build
|
cd build
|
cd build
|
../devo/configure --target=v850-elf --host=i686-pc-cygwin
|
../devo/configure --target=v850-elf --host=i686-pc-cygwin
|
make</P
|
make</P
|
><P
|
><P
|
>The resultant libremote server image (v850ice.exe) can be
|
>The resultant libremote server image (v850ice.exe) can be
|
found in build/libremote/v850ice. Copy v850ice.exe
|
found in build/libremote/v850ice. Copy v850ice.exe
|
to the lib remote server directory.</P
|
to the lib remote server directory.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><H3
|
><H3
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><A
|
><A
|
NAME="AEN4354">V850ICE.EXE EXECUTION</H3
|
NAME="AEN4354">V850ICE.EXE EXECUTION</H3
|
><P
|
><P
|
>The v850ice command line syntax is:</P
|
>The v850ice command line syntax is:</P
|
><P
|
><P
|
>v850ice [-d] [-t addr] [port number]</P
|
>v850ice [-d] [-t addr] [port number]</P
|
><P
|
><P
|
>The optional -d option enables debug output. The -t option
|
>The optional -d option enables debug output. The -t option
|
is associated with thread debugging - see the "eCos thread debugging"
|
is associated with thread debugging - see the "eCos thread debugging"
|
section below for details. By default v850ice listens on port 2345
|
section below for details. By default v850ice listens on port 2345
|
for an attach request from a gdb client. A different port number
|
for an attach request from a gdb client. A different port number
|
may be specified on the command line.</P
|
may be specified on the command line.</P
|
><P
|
><P
|
>To run the libremote server:</P
|
>To run the libremote server:</P
|
><P
|
><P
|
></P
|
></P
|
><OL
|
><OL
|
TYPE="1"
|
TYPE="1"
|
><LI
|
><LI
|
><P
|
><P
|
>Power on the I.C.E. and target board.</P
|
>Power on the I.C.E. and target board.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Open a Cygwin window.</P
|
>Open a Cygwin window.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Run v850ice.</P
|
>Run v850ice.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>You will see the MDI interface window appear. In this
|
>You will see the MDI interface window appear. In this
|
window you should see the "Connected to In-Circuit Emulator" message.
|
window you should see the "Connected to In-Circuit Emulator" message.
|
In the Cygwin window, the libremote server will indicate it is
|
In the Cygwin window, the libremote server will indicate it is
|
ready to accept a gdb client connection with the message "v850ice:
|
ready to accept a gdb client connection with the message "v850ice:
|
listening on port 2345."</P
|
listening on port 2345."</P
|
></LI
|
></LI
|
></OL
|
></OL
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><H3
|
><H3
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><A
|
><A
|
NAME="AEN4369">V850-ELF-GDB EXECUTION</H3
|
NAME="AEN4369">V850-ELF-GDB EXECUTION</H3
|
><P
|
><P
|
>Run the v850-elf-gdb client to debug the V850 target. It
|
>Run the v850-elf-gdb client to debug the V850 target. It
|
is necessary to issue certain configuration commands to the I.C.E.
|
is necessary to issue certain configuration commands to the I.C.E.
|
software. These commands may be issued directly in the MDI window
|
software. These commands may be issued directly in the MDI window
|
or they may be issued from the gdb client through the "monitor"
|
or they may be issued from the gdb client through the "monitor"
|
command.</P
|
command.</P
|
><P
|
><P
|
>On the Cosmo CEB-V850 board, on-chip Flash is mapped at address
|
>On the Cosmo CEB-V850 board, on-chip Flash is mapped at address
|
0x0, the on-board EPROM at 0x100000 and the on-board RAM at 0xfc0000.
|
0x0, the on-board EPROM at 0x100000 and the on-board RAM at 0xfc0000.
|
Since a stand alone V850 will start executing from address 0x0 on
|
Since a stand alone V850 will start executing from address 0x0 on
|
reset, it is normal to load either an application or a bootstrap
|
reset, it is normal to load either an application or a bootstrap
|
loader for Flash at this address. eCos programs may be built to
|
loader for Flash at this address. eCos programs may be built to
|
boot from Flash or the on-board EPROM. If building for the on-board
|
boot from Flash or the on-board EPROM. If building for the on-board
|
EPROM, it would be expected that the Flash will contain the default
|
EPROM, it would be expected that the Flash will contain the default
|
CEB-V850 flash contents. An ELF format version of the default contents
|
CEB-V850 flash contents. An ELF format version of the default contents
|
may be found in the eCos distribution with the name v850flash.img.</P
|
may be found in the eCos distribution with the name v850flash.img.</P
|
><P
|
><P
|
>In stand alone operation, normally the code in this flash image
|
>In stand alone operation, normally the code in this flash image
|
would have been programmed into the V850 on the Cosmo board, and
|
would have been programmed into the V850 on the Cosmo board, and
|
this would cause it to vector into the on-board EPROM to run the
|
this would cause it to vector into the on-board EPROM to run the
|
application located there. In the case of eCos, this application
|
application located there. In the case of eCos, this application
|
may be a GDB stub ROM application, allowing the further download
|
may be a GDB stub ROM application, allowing the further download
|
to RAM over serial of actual applications to debug.</P
|
to RAM over serial of actual applications to debug.</P
|
><P
|
><P
|
>As an example, we shall demonstrate how to use the I.C.E.
|
>As an example, we shall demonstrate how to use the I.C.E.
|
to download the v850flash.img and GDB stub EPROM image using I.C.E.
|
to download the v850flash.img and GDB stub EPROM image using I.C.E.
|
emulator memory only, and not requiring any actual programming of
|
emulator memory only, and not requiring any actual programming of
|
devices.</P
|
devices.</P
|
><P
|
><P
|
>v850-elf-gdb -nw
|
>v850-elf-gdb -nw
|
(gdb) file v850flash.img
|
(gdb) file v850flash.img
|
(gdb) target remote localhost:2345
|
(gdb) target remote localhost:2345
|
(gdb) monitor reset
|
(gdb) monitor reset
|
(gdb) monitor cpu r=256 a=16
|
(gdb) monitor cpu r=256 a=16
|
(gdb) monitor map r=0x100000-L 0x80000
|
(gdb) monitor map r=0x100000-L 0x80000
|
(gdb) monitor map u=0xfc0000-L 0x40000
|
(gdb) monitor map u=0xfc0000-L 0x40000
|
(gdb) monitor pinmask k
|
(gdb) monitor pinmask k
|
(gdb) monitor step
|
(gdb) monitor step
|
(gdb) monitor step
|
(gdb) monitor step
|
(gdb) monitor step
|
(gdb) monitor step
|
(gdb) monitor step
|
(gdb) monitor step
|
(gdb) load
|
(gdb) load
|
(gdb) detach
|
(gdb) detach
|
(gdb) file gdb_module.img
|
(gdb) file gdb_module.img
|
(gdb) target remote localhost:2345
|
(gdb) target remote localhost:2345
|
(gdb) load
|
(gdb) load
|
(gdb) continue</P
|
(gdb) continue</P
|
><P
|
><P
|
>NOTE: The four "monitor step" commands are only required the
|
>NOTE: The four "monitor step" commands are only required the
|
first time the board is connected to the I.C.E., otherwise the program
|
first time the board is connected to the I.C.E., otherwise the program
|
will fail.</P
|
will fail.</P
|
><P
|
><P
|
>This is because of a limitation of the I.C.E. hardware that
|
>This is because of a limitation of the I.C.E. hardware that
|
means that the first time it is used, the "map" commands are not
|
means that the first time it is used, the "map" commands are not
|
acted on and the addresses "0x100000" and "0xfc0000" are not mapped.
|
acted on and the addresses "0x100000" and "0xfc0000" are not mapped.
|
This can be observed using the command "td e-20" in the MDI application"s
|
This can be observed using the command "td e-20" in the MDI application"s
|
console to display the trace buffer, which will show that the contents
|
console to display the trace buffer, which will show that the contents
|
of address 0x100000 are not valid. Subsequent runs do not require
|
of address 0x100000 are not valid. Subsequent runs do not require
|
the "monitor step" commands.</P
|
the "monitor step" commands.</P
|
><P
|
><P
|
>It is unusual to load two executable images to a target through
|
>It is unusual to load two executable images to a target through
|
gdb. From the example above notice that this is accomplished by
|
gdb. From the example above notice that this is accomplished by
|
attaching to the libremote server, loading the flash image, detaching,
|
attaching to the libremote server, loading the flash image, detaching,
|
reattaching, and loading the ROM/RAM image. It is more
|
reattaching, and loading the ROM/RAM image. It is more
|
normal to build an executable image that can be executed directly.
|
normal to build an executable image that can be executed directly.
|
In eCos this is achieved by selecting either the ROM or ROMRAM startup
|
In eCos this is achieved by selecting either the ROM or ROMRAM startup
|
type, and optionally enable building for the internal FLASH. The
|
type, and optionally enable building for the internal FLASH. The
|
I.C.E. emulator memory can emulate both the internal FLASH and the
|
I.C.E. emulator memory can emulate both the internal FLASH and the
|
EPROM, so real hardware programming is not required.</P
|
EPROM, so real hardware programming is not required.</P
|
><P
|
><P
|
>Upon running this example you will notice that the libremote
|
>Upon running this example you will notice that the libremote
|
server does not exit upon detecting a detach request, but simply
|
server does not exit upon detecting a detach request, but simply
|
begins listening for the next attach request. To cause v850ice
|
begins listening for the next attach request. To cause v850ice
|
to terminate, issue the "monitor quit" or "monitor exit" command
|
to terminate, issue the "monitor quit" or "monitor exit" command
|
from the gdb client. v850ice will then terminate with the next
|
from the gdb client. v850ice will then terminate with the next
|
detach request. (You can also enter control-c in the Cygwin/DOS
|
detach request. (You can also enter control-c in the Cygwin/DOS
|
window where v850ice is running.)</P
|
window where v850ice is running.)</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><H3
|
><H3
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><A
|
><A
|
NAME="AEN4380">MDI INTERFACE VS. GDB INTERFACE</H3
|
NAME="AEN4380">MDI INTERFACE VS. GDB INTERFACE</H3
|
><P
|
><P
|
>If a filename is referenced in an MDI command, whether the
|
>If a filename is referenced in an MDI command, whether the
|
command is entered in the MDI window or issued from the gdb client
|
command is entered in the MDI window or issued from the gdb client
|
with the monitor command, the file must reside on the Windows NT
|
with the monitor command, the file must reside on the Windows NT
|
libremote server system. When specifying a filename when entering
|
libremote server system. When specifying a filename when entering
|
a command in the MDI window it is obvious that a server local file
|
a command in the MDI window it is obvious that a server local file
|
is being referenced. When issuing an MDI command from the gdb client, the
|
is being referenced. When issuing an MDI command from the gdb client, the
|
user must remember that the command line is simply passed to the
|
user must remember that the command line is simply passed to the
|
I.C.E. software on the server system. The command is executed by
|
I.C.E. software on the server system. The command is executed by
|
the I.C.E. software as though it were entered locally.</P
|
the I.C.E. software as though it were entered locally.</P
|
><P
|
><P
|
>Executable images may be loaded into the V850 target by entering
|
>Executable images may be loaded into the V850 target by entering
|
the "load" command in the MDI window or with the gdb "load" command.
|
the "load" command in the MDI window or with the gdb "load" command.
|
If the MDI load command is used, the executable image must be located
|
If the MDI load command is used, the executable image must be located
|
on the server system and must be in S Record format. If the gdb
|
on the server system and must be in S Record format. If the gdb
|
load command is used, the executable image must be located on the
|
load command is used, the executable image must be located on the
|
client system and must be in ELF format.</P
|
client system and must be in ELF format.</P
|
><P
|
><P
|
>Be aware that the gdb client is not aware of debugger commands
|
>Be aware that the gdb client is not aware of debugger commands
|
issued from the MDI window. It is possible to cause the gdb client
|
issued from the MDI window. It is possible to cause the gdb client
|
and the I.C.E. software to get out of sync by issuing commands from
|
and the I.C.E. software to get out of sync by issuing commands from
|
both interfaces during the same debugging session.</P
|
both interfaces during the same debugging session.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><H3
|
><H3
|
CLASS="SECT3"
|
CLASS="SECT3"
|
><A
|
><A
|
NAME="AEN4385">eCos THREAD DEBUGGING</H3
|
NAME="AEN4385">eCos THREAD DEBUGGING</H3
|
><P
|
><P
|
>eCos and the V850 I.C.E. libremote server have been written
|
>eCos and the V850 I.C.E. libremote server have been written
|
to work together to allow debugging of eCos threads. This is an
|
to work together to allow debugging of eCos threads. This is an
|
optional feature, disabled by default because of the overheads trying
|
optional feature, disabled by default because of the overheads trying
|
to detect a threaded program involves.</P
|
to detect a threaded program involves.</P
|
><P
|
><P
|
>Obviously thread debugging is not possible for programs with
|
>Obviously thread debugging is not possible for programs with
|
"RAM" startup type, as they are expected to operate underneath a
|
"RAM" startup type, as they are expected to operate underneath a
|
separate ROM monitor (such as a GDB stub ROM), that itself would
|
separate ROM monitor (such as a GDB stub ROM), that itself would
|
provide its own thread debugging capabilities over the serial line.
|
provide its own thread debugging capabilities over the serial line.
|
Thread debugging is relevant only for programs built for Flash, ROM,
|
Thread debugging is relevant only for programs built for Flash, ROM,
|
or ROMRAM startup.</P
|
or ROMRAM startup.</P
|
><P
|
><P
|
>To configure the libremote server to support thread debugging,
|
>To configure the libremote server to support thread debugging,
|
use the command:</P
|
use the command:</P
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>(gdb) monitor syscallinfo ADDRESS</PRE
|
>(gdb) monitor syscallinfo ADDRESS</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></P
|
></P
|
><P
|
><P
|
>at the GDB console prompt, where ADDRESS is the address of
|
>at the GDB console prompt, where ADDRESS is the address of
|
the syscall information structure included in the applications.
|
the syscall information structure included in the applications.
|
In eCos this has been designed to be located at a consistent address
|
In eCos this has been designed to be located at a consistent address
|
for each CPU model (V850/SA1 or V850/SB1). It
|
for each CPU model (V850/SA1 or V850/SB1). It
|
may be determined from an eCos executable using the following command
|
may be determined from an eCos executable using the following command
|
at a cygwin bash prompt:</P
|
at a cygwin bash prompt:</P
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>v850-elf-nm EXECUTABLE | grep hal_v85x_ice_syscall_info</PRE
|
>v850-elf-nm EXECUTABLE | grep hal_v85x_ice_syscall_info</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></P
|
></P
|
><P
|
><P
|
>At the current time, this address is 0xfc0400 for a Cosmo
|
>At the current time, this address is 0xfc0400 for a Cosmo
|
board fitted with a V850/SA1, or 0xfc0540 for a Cosmo board
|
board fitted with a V850/SA1, or 0xfc0540 for a Cosmo board
|
fitted with a V850/SB1.</P
|
fitted with a V850/SB1.</P
|
><P
|
><P
|
>So for example, the GDB command for the SB1 would be:</P
|
>So for example, the GDB command for the SB1 would be:</P
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>(gdb) monitor syscallinfo 0xfc0540</PRE
|
>(gdb) monitor syscallinfo 0xfc0540</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></P
|
></P
|
><P
|
><P
|
>Given that the syscallinfo address is fixed over all eCos
|
>Given that the syscallinfo address is fixed over all eCos
|
executables for a given target, it is possible to define it on the
|
executables for a given target, it is possible to define it on the
|
libremote command line as well using the "-t" option, for example:</P
|
libremote command line as well using the "-t" option, for example:</P
|
><P
|
><P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>bash$ v850ice -t 0xfc0400
|
>bash$ v850ice -t 0xfc0400
|
v850ice: listening on port 2345</PRE
|
v850ice: listening on port 2345</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></P
|
></P
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NAVFOOTER"
|
CLASS="NAVFOOTER"
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"><TABLE
|
WIDTH="100%"><TABLE
|
SUMMARY="Footer navigation table"
|
SUMMARY="Footer navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="setup-sh-se7751.html"
|
HREF="setup-sh-se7751.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="ecos-user-guide.html"
|
HREF="ecos-user-guide.html"
|
ACCESSKEY="H"
|
ACCESSKEY="H"
|
>Home</A
|
>Home</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="setup-v850-cebsb1.html"
|
HREF="setup-v850-cebsb1.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
>SH4/SE7751 Hardware Setup</TD
|
>SH4/SE7751 Hardware Setup</TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="appendix-target-setup.html"
|
HREF="appendix-target-setup.html"
|
ACCESSKEY="U"
|
ACCESSKEY="U"
|
>Up</A
|
>Up</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
>NEC CEB-V850/SB1 Hardware Setup</TD
|
>NEC CEB-V850/SB1 Hardware Setup</TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|