⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup-v850-cebsa1.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
📖 第 1 页 / 共 2 页
字号:
><PRECLASS="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 libremoteserver</P><P>directory.</P></LI></OL></DIV><DIVCLASS="SECT3"><H3CLASS="SECT3"><ANAME="AEN4345">BUILD PROCEDURES</H3><P>A pre-built v850ice.exe executable is supplied in the loaders/v850-ceb_v850 directoryrelative to the root of the eCos installation. However the following processwill allow the rebuilding of this executable if required:</P><P>For this example assume the v850ice libremote tree has beencopied to a directory named "server".  The directory structure willbe similar to the following diagram:</P><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">                server                   |                 devo                 /  \           config    libremote                      /     \                   lib       v850ice</PRE></TD></TR></TABLE></P><P>Build the v850ice source as follows.  Be sure to use the nativeCygwin compiler tools that were supplied alongside eCos.</P><P>cd servermkdir buildcd build../devo/configure --target=v850-elf --host=i686-pc-cygwinmake</P><P>The resultant libremote server image (v850ice.exe) can befound in build/libremote/v850ice.  Copy v850ice.exeto the lib remote server directory.</P></DIV><DIVCLASS="SECT3"><H3CLASS="SECT3"><ANAME="AEN4354">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 optionis associated with thread debugging - see the "eCos thread debugging"section below for details. By default v850ice listens on port 2345for an attach request from a gdb client.  A different port numbermay be specified on the command line.</P><P>To run the libremote server:</P><P></P><OLTYPE="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 thiswindow you should see the "Connected to In-Circuit Emulator" message. In the Cygwin window, the libremote server will indicate it isready to accept a gdb client connection with the message "v850ice: listening on port 2345."</P></LI></OL></DIV><DIVCLASS="SECT3"><H3CLASS="SECT3"><ANAME="AEN4369">V850-ELF-GDB EXECUTION</H3><P>Run the v850-elf-gdb client to debug the V850 target.  Itis necessary to issue certain configuration commands to the I.C.E.software.  These commands may be issued directly in the MDI windowor 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 address0x0, the on-board EPROM at 0x100000 and the on-board RAM at 0xfc0000.Since a stand alone V850 will start executing from address 0x0 onreset, it is normal to load either an application or a bootstraploader for Flash at this address. eCos programs may be built toboot from Flash or the on-board EPROM. If building for the on-boardEPROM, it would be expected that the Flash will contain the defaultCEB-V850 flash contents. An ELF format version of the default contentsmay be found in the eCos distribution with the name v850flash.img.</P><P>In stand alone operation, normally the code in this flash imagewould have been programmed into the V850 on the Cosmo board, andthis would cause it to vector into the on-board EPROM to run theapplication located there. In the case of eCos, this applicationmay be a GDB stub ROM application, allowing the further downloadto 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 ofdevices.</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 thefirst time the board is connected to the I.C.E., otherwise the programwill fail.</P><P>This is because of a limitation of the I.C.E. hardware thatmeans that the first time it is used, the "map" commands are notacted on and the addresses "0x100000" and "0xfc0000" are not mapped.This can be observed using the command "td e-20" in the MDI application&quot;sconsole to display the trace buffer, which will show that the contentsof address 0x100000 are not valid. Subsequent runs do not requirethe "monitor step" commands.</P><P>It is unusual to load two executable images to a target throughgdb.  From the example above notice that this is accomplished byattaching to the libremote server, loading the flash image, detaching,reattaching, and loading the ROM/RAM image. It is morenormal to build an executable image that can be executed directly.In eCos this is achieved by selecting either the ROM or ROMRAM startuptype, and optionally enable building for the internal FLASH. TheI.C.E. emulator memory can emulate both the internal FLASH and theEPROM, so real hardware programming is not required.</P><P>Upon running this example you will notice that the libremoteserver does not exit upon detecting a detach request, but simplybegins listening for the next attach request.  To cause v850iceto terminate, issue the "monitor quit" or "monitor exit" commandfrom the gdb client.  v850ice will then terminate with the nextdetach request.  (You can also enter control-c in the Cygwin/DOSwindow where v850ice is running.)</P></DIV><DIVCLASS="SECT3"><H3CLASS="SECT3"><ANAME="AEN4380">MDI INTERFACE VS. GDB INTERFACE</H3><P>If a filename is referenced in an MDI command, whether thecommand is entered in the MDI window or issued from the gdb clientwith the monitor command, the file must reside on the Windows NTlibremote server system.  When specifying a filename when enteringa command in the MDI window it is obvious that a server local fileis being referenced.  When issuing an MDI command from the gdb client, theuser must remember that the command line is simply passed to theI.C.E. software on the server system.  The command is executed bythe I.C.E. software as though it were entered locally.</P><P>Executable images may be loaded into the V850 target by enteringthe "load" command in the MDI window or with the gdb "load" command. If the MDI load command is used, the executable image must be locatedon the server system and must be in S Record format.  If the gdbload command is used, the executable image must be located on theclient system and must be in ELF format.</P><P>Be aware that the gdb client is not aware of debugger commandsissued from the MDI window.  It is possible to cause the gdb clientand the I.C.E. software to get out of sync by issuing commands fromboth interfaces during the same debugging session.</P></DIV><DIVCLASS="SECT3"><H3CLASS="SECT3"><ANAME="AEN4385">eCos THREAD DEBUGGING</H3><P>eCos and the V850 I.C.E. libremote server have been writtento work together to allow debugging of eCos threads. This is anoptional feature, disabled by default because of the overheads tryingto 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 aseparate ROM monitor (such as a GDB stub ROM), that itself wouldprovide 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><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">(gdb) monitor syscallinfo ADDRESS</PRE></TD></TR></TABLE></P><P>at the GDB console prompt, where ADDRESS is the address ofthe syscall information structure included in the applications.In eCos this has been designed to be located at a consistent addressfor each CPU model (V850/SA1 or V850/SB1). Itmay be determined from an eCos executable using the following commandat a cygwin bash prompt:</P><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="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 Cosmoboard fitted with a V850/SA1, or 0xfc0540 for a Cosmo boardfitted with a V850/SB1.</P><P>So for example, the GDB command for the SB1 would be:</P><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">(gdb) monitor syscallinfo 0xfc0540</PRE></TD></TR></TABLE></P><P>Given that the syscallinfo address is fixed over all eCosexecutables for a given target, it is possible to define it on thelibremote command line as well using the "-t" option, for example:</P><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">bash$ v850ice -t 0xfc0400v850ice: listening on port 2345</PRE></TD></TR></TABLE></P></DIV></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="setup-sh-se7751.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-user-guide.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="setup-v850-cebsb1.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">SH4/SE7751 Hardware Setup</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="appendix-target-setup.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="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 + -