📄 iceproto.htm
字号:
<title>SerialICE Serial Communications Protcol</title> <h1 align=center>SerialICE Serial Communications Protcol</h1><!--INDEX "SerialICE Kernel" -->This page describes the SerialICE Kernel that runs on the customer'starget board, and communicates with the SerialICE Monitor that runs on the SerialICE Controller.<p>On power up, the SerialICE Kernel initializes the SIO and the RAM, andthen transfers control to the application (state0).<p></dl><h2>State0</h2><dl><dd>In state0 the target is executing the application. Transition out ofthis state can only occur as a result of an exception. <p>All exceptions are first checked by the application. The applicationshould tranfer control to the SerialICE Kernel's exception handler under thefollowing two conditions:<p><ul> <li>A byte arriving on the SIO from the SerialICE Controller <li>A non-handled exception</ul><p>The SerialICE Kernel's exception handler (located at 0xbfc00180) saves a smallnumber of registers (currently 9) in the RAM save area. This operationrequires the use of general registers k0 and k1. This means that theSerialICE Kernel cannot be used to debug code in which registers k0 and k1hold useful values while interrupts are enabled, or to set breakpointsin a region of code where k0 and k1 are in use.<p>Once the registers have been saved, the SerialICE Kernel checks the exceptiontype. If it is an SIO interrupt, the byte on the SIO is checkedfor value. If the byte has a value of 0x55 (ATTN) the SerialICE Kernel willrespond with an 0xaa (ACK) and move to state1. For all other values theSerialICE Kernel will remain in state0 and return control to the applicationwithout sending any bytes back to the SerialICE Controller. If any otherexception occurs, the the SerialICE Kernel will respond with an 0xaa (ACK)and move to state1.<p></dl><h2>State1</h2><dl><dd>In state1 the SerialICE Kernel reads bytes from the SIO using polledmode. Groups of four bytes are assembled into words. Once a word hasbeen assembled, there are four possibilties depending on the value. Ifthe word has one of 3 special values, the action taken will be asfollows:<p><dl><dd><dl><dt> 0x12345678 (SENDA0) <dd> Execute the code that is currently in the instruction buffer area. Transmit the 4-byte value of register a0 on completion.<p><dt> 0xdeadbeef (SENDSAP) <dd> Transmit a 4-byte value containing the address of the register save area in the target memory.<p><dt> 0x87654321 (RUN_MODE)<dd> Transfer control back to the application and switch to state0.<p></dl></dl>However, while the bytes are being assembled into words, the Kernelalso checks the value of the first byte. If an ATTN byte (0x55) is seen,the kernel will send an ACK (0xaa), and go back to waiting for the firstbyte of the word.<p>For all other cases, the words are written to the instruction bufferarea in RAM. In this case, the SerialICE Kernel does not transmit any bytesback to the SerialICE Controller. The instruction buffer has a capacity of 27instructions.<p></dl><h2>Programming issues</h2><dl><dd>The routines that are downloaded to the instruction buffer execute fromkseg1 (non cacheable) and may use the following scratch registers: t0,t1, t2, a0, a1, k0, k1, and s0. If you choose to call a subroutine, youmust save and restore register ra appropriately. The addresses of theget_word and put_word subroutines can be obtained from the registersave area. These subroutines use registers k0, k1, and a1. get_wordreturns the word in register v0; put_word transmits the word inregister a0.<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 + -