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

📄 iabuild.htm

📁 mips架构的bootloader,99左右的版本 但源代码现在没人更新了
💻 HTM
字号:
	 <title>Building an Application for Execution in a SerialICE Debug Environment</title><h1 align=center>Building an Application for Execution in a SerialICE Debug Environment</h1><!--INDEX "Building a SerialICE application" --><!--INDEX xflash board prom -->To build an application for execution under SerialICE, you should use the <ahref="tools/pmcc.htm">pmcc</a> command. This command "knows" about therequirements of the SerialICE execution environment, and will use thecorrect include files and run-time library.<p>Before you use the pmcc command, you will need to <ahref="setenv.htm">set your environment</a> in order to add the pmcccommand to your command search path.<p>The pmcc command accepts most of the usual options that are recognizedby a UNIX-style "cc" command. For example, you may..<p><ul><li>specify multiple modules that can be either, .c, .s, or .o files.<li>name the output file using "-o filename".<li>stop at a .o file using the "-c" option.<li>specify that the compiler should include full debugging informationby using the "-g" option.</ul>Please refer to the <a href="tools/pmcc.htm">pmcc</a> documentation for acomplete listing of the options supported by this command.<p>For example, to build a simple "Hello world" program for execution ona BDMR4101 evaluation board, you would type:<p><pre>	pmcc -board bdmr4101 -o hello hello.c</pre>The <tt>-board</tt> option "tells" pmcc which startup files to include.<p>The above command produces three files: hello, hello.map, andhello.rec. The file hello contains the linked and located <ahref="objcode.htm">object code</a>, hello.map contains a globalsymbol map, and hello.rec contains the downloadable <ahref="dlrt.htm">records</a>.<p><h3>SOURCE-LEVEL DEBUGGERS</h3>Note that if you are using a source-level debugger as your host-residentdebugger, you will also need to specify the "-g" option. For example,<pre>	pmcc -board bdmr4101 -g -o hello hello.c</pre>In general it is better to place all of the options before the list offiles.<p><h3>PROMABLE APPLICATIONS</h3>If you want to "burn" your application into ROM, you can specifiy theoption <tt>-prom</tt>. For example,<p><pre>	pmcc -prom -board bdmr4101 -o hello hello.c</pre>This will produce an S-record file that can be used by a PROM Programmerto create a bootable ROM (or ROMS).  The image generated willautomatically include a SerialICE Kernel to permit debugging of theROM-based application.  Note that the <tt>-prom</tt> option <b>must</b>preceed the <tt>-board</tt> option. If you find that the S4 records thatthis command creates, confuse your PROM Programmer, you can omit themby adding the <tt>-syms</tt> option.<p>If you wish to use <a href="imon95.htm">imon95</a> to debug this ROM-based application.  You canload the symbol information into imon95 by using the command, "<tt><a href=c_load.htm>load</a> -m hello.rec</tt>". But this won't work ifyou used the <tt>-syms</tt> option to exclude the symbol informationfrom the file.<p><h3>IN-CIRCUIT PROGRAMMING</h3>If you would prefer to self-update the flashes by using in-circuitprogramming. You can created a self-updating image using the followingcommand together with the hello.rec file created from the previous example.<p><pre>	pmcc -board bdmr4101 -xflash -o xhello hello.rec</pre>This will create a downloadable image that, when executed, will copyitself into the flashes. Note that the <tt>-xflash</tt> option <b>must</b>come after the <tt>-board</tt> option.<p>If you are using the BDMR4101, you might find it convenient to use thefollowing self-updating scheme to "burn" your program into flash.<p><ol><li>Starting with a SerialICE Kernel in the flashes.<li>Build your application using <tt>-xflash</tt> as shown above.<li>Download the xflashed .rec file.<li>Type "g", and then wait for at least double the number ofestimated seconds (the message is printed to tty0).<li>Press reset.</ol><p>If you are using either the BDMR4011 or BDMR4102, you might find itconvenient to use the following scheme to "burn" your program intoflash.<p><ol><li> Jumper the board to boot from EPROM, and install a PMON EPROM.<li>Build your romable application    but don't perform the <tt>-xflash</tt> step.<li> At the PMON prompt, type "load e0420000" and then download the kernel or rom-based application. The value a0420000 is an offset thatcauses the S-records that start at bfc00000 or 9fc00000 to be loadedinto memory at a0020000 or 80020000 respectively.<li> At the PMON prompt, type "copy -f a0020000 bfd00000 size", where<i>size</i> is the size of the download as reported by the load command.<li>Rejumper the board to boot from flash, and then press reset.</ol><p><h3>R4000 EXCEPTIONS</h3>If your processor supports R4000-style exceptions (eret vs rfe), and youwish to operate in that mode, you should include the <tt>-mips2</tt>option. This will instruct the compiler to use instructions from themips2 architecture, and will cause your application to be linked withthe correct startup code for using r4000-style exceptions. Note thatthe <tt>-mips2</tt> option <b>must</b> preceed the <tt>-board</tt> option.If you do place it after the <tt>-board</tt> option, it will stillinstruct the compiler to use mips2 instructions, but you won't get ther4000-compatible startup files.<p><h3>CUSTOM START ADDRESS</h3>If you wish to override the start address selected by the <tt>-board</tt>option that you specified. You may use the <tt>-T</tt> and <tt>-D</tt>options, but they <b>must</b> appear after the <tt>-board</tt> option.<p><h3>HOW IT WORKS</h3>The general rule for combining these pmcc options is, that you mayinclude <tt>-prom</tt> and <tt>-mips2</tt>, but these must appear before<tt>-board</tt>.  The <tt>-T</tt> and <tt>-xflash</tt> options, ifspecified, must appear after <tt>-board</tt>.  You may not specify boththe <tt>-prom</tt> and <tt>-xflash</tt> options.  It can be summarizedas follows:<p><pre>	pmcc [-prom] [-mips2] -board <i>boardname</i> [-xflash] [-T <i>address</i>]</pre>You can find the code that implements most of the board-specific logicin <a href="../tools/misc.c">tools/misc.c</a>. The <tt>-board</tt>switch causes pmcc to use one of the following sets of files as thestartup code.<p><dl><dd><table border><tr><th>Files</th><th>Board</th></tr><tr><td align=center>	<a href="../lib/ia4101.s">lib/ia4101.s</a> 	<a href="../lib/ic4101.c">lib/ic4101.c</a></td><td align=center><a href="bdmr4101.htm">bdmr4101</a></td></tr><tr><td align=center>	<a href="../lib/ia4011.s">lib/ia4011.s</a> 	<a href="../lib/ic4011.c">lib/ic4011.c</a></td><td align=center><a href="bdmr4011.htm">bdmr4011</a></td></tr><tr><td align=center>	<a href="../lib/ia4102.s">lib/ia4102.s</a> 	<a href="../lib/ic4102.c">lib/ic4102.c</a></td><td align=center><a href="bdmr4102.htm">bdmr4102</a></td></tr></table></dl>These startup files use the standard PMON mechanisms to provide:<p><ul><li>Polled serial I/O (eg.  	<a href="../lib/p2681.c">lib/p2681.c</a>, or 	<a href="../lib/p16550.c">lib/p16550.c</a>).<li>Support for time() via timer interrupts (eg. via clkinit in	<a href="../lib/p2681.c">lib/p2681.c</a> or	<a href="../lib/tmr1.c">lib/tmr1.c</a>).<li>Ethernet download via tftp (eg. 	<a href="../lib/ether.c">lib/ether.c</a> and	<a href="../lib/am79970.c">lib/am79970.c</a> or	<a href="../lib/sonic.c">lib/sonic.c</a>).</ul><p></dl><p><hr><b>Navigation:</b> <a href="index.htm">Document Home</a> | <a href="doctoc.htm">Document Contents</a> | <a href="docindex.htm">Document Index</a> <p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -