📄 setup-v850-cebsa1.html
字号:
><PRE
CLASS="PROGRAMLISTING"
>CpuOption=SB1</PRE
></TD
></TR
></TABLE
><P
>if using a V850/SB1 module.</P
></LI
><LI
><P
>Set the environment variable IEPATH to point to the libremote
server</P
><P
>directory.</P
></LI
></OL
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN4343">BUILD PROCEDURES</H3
><P
>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
will allow the rebuilding of this executable if required:</P
><P
>For this example assume the v850ice libremote tree has been
copied to a directory named "server". The directory structure will
be similar to the following diagram:</P
><P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
> server
|
devo
/ \
config libremote
/ \
lib v850ice</PRE
></TD
></TR
></TABLE
></P
><P
>Build the v850ice source as follows. Be sure to use the native
Cygwin compiler tools that were supplied alongside eCos.</P
><P
>cd server
mkdir build
cd build
../devo/configure --target=v850-elf --host=i686-pc-cygwin
make</P
><P
>The resultant libremote server image (v850ice.exe) can be
found in build/libremote/v850ice. Copy v850ice.exe
to the lib remote server directory.</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN4352">V850ICE.EXE EXECUTION</H3
><P
>The v850ice command line syntax is:</P
><P
>v850ice [-d] [-t addr] [port number]</P
><P
>The optional -d option enables debug output. The -t option
is associated with thread debugging - see the "eCos thread debugging"
section below for details. By default v850ice listens on port 2345
for an attach request from a gdb client. A different port number
may be specified on the command line.</P
><P
>To run the libremote server:</P
><P
></P
><OL
TYPE="1"
><LI
><P
>Power on the I.C.E. and target board.</P
></LI
><LI
><P
>Open a Cygwin window.</P
></LI
><LI
><P
>Run v850ice.</P
></LI
><LI
><P
>You will see the MDI interface window appear. In this
window you should see the "Connected to In-Circuit Emulator" message.
In the Cygwin window, the libremote server will indicate it is
ready to accept a gdb client connection with the message "v850ice:
listening on port 2345."</P
></LI
></OL
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN4367">V850-ELF-GDB EXECUTION</H3
><P
>Run the v850-elf-gdb client to debug the V850 target. It
is necessary to issue certain configuration commands to the I.C.E.
software. These commands may be issued directly in the MDI window
or they may be issued from the gdb client through the "monitor"
command.</P
><P
>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.
Since a stand alone V850 will start executing from address 0x0 on
reset, it is normal to load either an application or a bootstrap
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
EPROM, it would be expected that the Flash will contain the default
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
><P
>In stand alone operation, normally the code in this flash image
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
application located there. In the case of eCos, this application
may be a GDB stub ROM application, allowing the further download
to RAM over serial of actual applications to debug.</P
><P
>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.
emulator memory only, and not requiring any actual programming of
devices.</P
><P
>v850-elf-gdb -nw
(gdb) file v850flash.img
(gdb) target remote localhost:2345
(gdb) monitor reset
(gdb) monitor cpu r=256 a=16
(gdb) monitor map r=0x100000-L 0x80000
(gdb) monitor map u=0xfc0000-L 0x40000
(gdb) monitor pinmask k
(gdb) monitor step
(gdb) monitor step
(gdb) monitor step
(gdb) monitor step
(gdb) load
(gdb) detach
(gdb) file gdb_module.img
(gdb) target remote localhost:2345
(gdb) load
(gdb) continue</P
><P
>NOTE: The four "monitor step" commands are only required the
first time the board is connected to the I.C.E., otherwise the program
will fail.</P
><P
>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
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
console to display the trace buffer, which will show that the contents
of address 0x100000 are not valid. Subsequent runs do not require
the "monitor step" commands.</P
><P
>It is unusual to load two executable images to a target through
gdb. From the example above notice that this is accomplished by
attaching to the libremote server, loading the flash image, detaching,
reattaching, and loading the ROM/RAM image. It is more
normal to build an executable image that can be executed directly.
In eCos this is achieved by selecting either the ROM or ROMRAM startup
type, and optionally enable building for the internal FLASH. The
I.C.E. emulator memory can emulate both the internal FLASH and the
EPROM, so real hardware programming is not required.</P
><P
>Upon running this example you will notice that the libremote
server does not exit upon detecting a detach request, but simply
begins listening for the next attach request. To cause v850ice
to terminate, issue the "monitor quit" or "monitor exit" command
from the gdb client. v850ice will then terminate with the next
detach request. (You can also enter control-c in the Cygwin/DOS
window where v850ice is running.)</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN4378">MDI INTERFACE VS. GDB INTERFACE</H3
><P
>If a filename is referenced in an MDI command, whether the
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
libremote server system. When specifying a filename when entering
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
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
the I.C.E. software as though it were entered locally.</P
><P
>Executable images may be loaded into the V850 target by entering
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
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
client system and must be in ELF format.</P
><P
>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
and the I.C.E. software to get out of sync by issuing commands from
both interfaces during the same debugging session.</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AEN4383">eCos THREAD DEBUGGING</H3
><P
>eCos and the V850 I.C.E. libremote server have been written
to work together to allow debugging of eCos threads. This is an
optional feature, disabled by default because of the overheads trying
to detect a threaded program involves.</P
><P
>Obviously thread debugging is not possible for programs with
"RAM" startup type, as they are expected to operate underneath a
separate ROM monitor (such as a GDB stub ROM), that itself would
provide its own thread debugging capabilities over the serial line.
Thread debugging is relevant only for programs built for Flash, ROM,
or ROMRAM startup.</P
><P
>To configure the libremote server to support thread debugging,
use the command:</P
><P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>(gdb) monitor syscallinfo ADDRESS</PRE
></TD
></TR
></TABLE
></P
><P
>at the GDB console prompt, where ADDRESS is the address of
the syscall information structure included in the applications.
In eCos this has been designed to be located at a consistent address
for each CPU model (V850/SA1 or V850/SB1). It
may be determined from an eCos executable using the following command
at a cygwin bash prompt:</P
><P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>v850-elf-nm EXECUTABLE | grep hal_v85x_ice_syscall_info</PRE
></TD
></TR
></TABLE
></P
><P
>At the current time, this address is 0xfc0400 for a Cosmo
board fitted with a V850/SA1, or 0xfc0540 for a Cosmo board
fitted with a V850/SB1.</P
><P
>So for example, the GDB command for the SB1 would be:</P
><P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>(gdb) monitor syscallinfo 0xfc0540</PRE
></TD
></TR
></TABLE
></P
><P
>Given that the syscallinfo address is fixed over all eCos
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
><P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>bash$ v850ice -t 0xfc0400
v850ice: listening on port 2345</PRE
></TD
></TR
></TABLE
></P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="setup-sh-se7751.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ecos-user-guide.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="setup-v850-cebsb1.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SH4/SE7751 Hardware Setup</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="appendix-target-setup.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>NEC CEB-V850/SB1 Hardware Setup</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -