Main Site Documentation

FEZ Raptor / Serial line open exception


#1

Hi All,

I have a problem opening a serial line on the FEZ raptor :

Gadgeteer.Interfaces.Serial sr = new GT.Interfaces.Serial(GT.Socket.GetSocket(10, true,null,“U”),9600,GT.Interfaces.Serial.SerialParity.None,GT.Interfaces.Serial.SerialStopBits.None,8,GT.Interfaces.Serial.HardwareFlowControl.NotRequired, null);
sr.Open();

I tried on socket 1 & 10 (other ones are already taken).

An I always get this message :

Exception System.ArgumentException - 0xfd000000 (1)

#### Message: 
#### System.IO.Ports.SerialPort::InternalOpen [IP: 0000] ####
#### System.IO.Ports.SerialPort::Open [IP: 0018] ####
#### Gadgeteer.Interfaces.NativeSerial::Open [IP: 0010] ####
#### Gadgeteer.Interfaces.Serial::Open [IP: 0007] ####
#### IADrone.EmbeddedMain.Program::Main [IP: 0015] ####

A first chance exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.SerialPort.dll
An unhandled exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.SerialPort.dll

Do you have any ideas ?

Thx


#2

there have been a recent discussion about a problem with no stop bits. no stop bits are not supported. try with one stop bit.


#3

YES !!! You’re right !! It’s now working !

Thanks a lot Mike !!!


#4

@ GMISoft -


Did you get your code from our documentation, code-share, or the forum? I'd like to correct any example that uses .SerialParity.None

#5

Hi Jeff,
No, I don’t think I get this code from anywhere (as much as I can remember).

You mean that with a SerialParity.None, we can only use a 9600 baudrate ? Or did I miss something else ?

Thx


#6

I use that code to communicate between a cerberus and a raptor through a null modem :wink:


#7

@ GMISoft - sorry, brain stroke , I was referring to the the same parameter as mike (SerialStopBits.None).

Thanks. On my side all is good since the line didn’t come from sample code.