[Tinyos-help] Matchbox signed byte data corrupted through UART

Scott Schoen schoen at mac.com
Wed Jan 21 12:31:04 PST 2004

I'm using the TestRemote application under 
$TOSROOT/apps/TestMatchbox/Remote/ which uses UARTComm as Comm and wires 
it up directly to the ReceiveMsg and SendMsg interfaces used by the 
Remote component (under $TOSROOT/tos/lib/FS/).

components Remote, UARTComm as Comm ...

Remote.ReceiveCommandMsg -> Comm.ReceiveMsg[AM_FSOPMSG]
Remote.SendReplyMsg -> Comm.SendMsg[AM_FSREPLYMSG]
Remote.sendDone <- Comm;

Note that I only tested near and around that range of bytes, I'm not 
sure if there are other ranges of bytes with the high end bit set that 
also cause problems.

Also, I have my serial port (COM3) set up with the following parameters:

Bits per second: 57600
Data bits: 8
Parity: None
Stop bits: 1
Flow control None

Are there any other options for communicating with the TestRemote app 
across the serial port that don't involve special flag bytes?


William J Maurer wrote:

>	The SerialForwarder<->Mote link uses an HDLC protocol for flow
>control which does escape some characters:
>  enum {
>    HDLC_QUEUESIZE	   = 2,
>    HDLC_MTU		   = (sizeof(TOS_Msg)),
>    HDLC_FLAG_BYTE	   = 0x7e,
>    HDLC_CTLESC_BYTE	   = 0x7d,
>    PROTO_ACK              = 64,
>    PROTO_PACKET_ACK       = 65,
>    PROTO_PACKET_NOACK     = 66,
>    PROTO_UNKNOWN          = 255
>  };
>I can't imagine HDLC is limited to 7 bit data. See
>tos/system/FramerM.nc which is used by UartComm.nc . I'm not sure why
>you would be having problems on the '0x80' to '0xa0' character
>range. Perhaps a subtle implementation gotcha?  What is your
>configuration wiring up?
>>Date: Wed, 21 Jan 2004 11:58:11 -0700
>>From: Scott Schoen <schoen at mac.com>
>>I'm using the serial port to download files to a Matchbox file system on 
>>a mica2.  I use the SerialForwarder  in conjunction with the java 
>>net.tinyos.matchbox.tools.CopyIn tool to send the bytes to the mote 
>>loaded with the TestRemote app.
>>I've found that any bytes that are in the range '0x80' to '0xa0' are 
>>converted to '0x3f'.  I am able to send bytes in this range between 
>>motes across the radio so I assume there must be something in the UART 
>>and serial port configuration that is using these high end bits.  Am I 
>>limited to transferring 7 bit data across the serial port?  Anyone know 
>>what I'm doing wrong?

More information about the Tinyos-help mailing list