walnutcy

ltProbe v1.1中实现的probe协议 (原创)

0
阅读(2002)

其实也就是uC/OS-II v2.86中的simple read部分,具体如下:

ltprobe的下载地址:http://blog.ednchina.com/walnutcy/182183/message.aspx

1) 物理层封包:
   (A)  4 1-byte start delimiters, forming the ASCII of "uCPr".
   (B)  1 2-byte length, the length of the data segment;
   (C)  1 2-byte padding, unused;
   (D)  n   bytes of data; and
   (E)  1 1-byte checksum; and
   (F)  1 1-byte end delimiter, the character '/'.

 

    +-------------------+-------------------+
    |   'u'   |   'C'   |   'P'   |   'r'   |
    +-------------------+-------------------+
    |       Length      |     Padding       |
    +-------------------+-------------------+
    |                  Data                 |
    |                   .                   |
    |                   .                   |
    |                   .                   |
    +-------------------+-------------------+
    | Checksum|   '/'   |
    +-------------------+

 

2)  Data区数据格式分析:(蓝色部分在ltProbe中已实现)
    index(1,0) = format  {注: (rx[1]<<8)+rx[0] }
   
    format value:  (Rx)  {注: Tx |= 0x8000; }
    0x0000 ---Error
    0x0001 ---Query
    0x0002 ---Simple Read
    0x0003 ---Simple Write
    0x0004 ---Info
    0x0007 ---Multiple Read
    0x0008 ---Multiple Write
    0x0009 ---String Read
    0x000A ---String Write

--------------------------------------------------------------
++++++++++++++++0x0002 ---Simple Read ++++++++++++++++++++++++
--------------------------------------------------------------
(1) The RX format:
    (A) A 2-byte format , indicating the data segment format;
    (B) A 2-byte length , indicating the number of bytes to read;
    (C) A 4-byte address, the starting address of the data to read.


          +-------------------------+-------------------------+
          |          Format         |     Number of bytes     |
          +-------------------------+-------------------------+
          |                      Address                      |
          +-------------------------+-------------------------+


(2) The TX format:
    (A) A 2-byte format, indicating the data segment format;
    (B) A 1-byte status, indicating the status after the request;
    (C) A 1-byte modifier;
    (D) The memory data.


          +-------------------------+------------+------------+
          |          Format         |   Status   |  Modifier  |
          +-------------------------+------------+------------+
          |                        Data                       |
          |                         .                         |
          |                         .                         |
          |                         .                         |
          +---------------------------------------------------+