Maximum baud rate supported by USBH_SerialUSB

Hi

I’m using a FEZ Cobra to do some experiments with it acting as a USB Host. I have downloaded the latest versions of the GHI SDK and .NET Micro Framework. I’m connecting a FTDI FT232RQ USB to UART bridge module that supports up to 3Mbaud. The module in turn connects to another FTDI USB/UART bridge which connects back to my PC. All works as expected at 921600. However, if I try to set the BaudRate via the property or in the constructor of the USBH_SerialUSB object to any larger value, the following Exception is thrown.

Exception System.Exception - 0xffffffff (3)

#### Message: 
#### GHIElectronics.NETMF.USBHost.USBH_SerialUSB::set_Baudrate [IP: 0000] ####
#### EmbeddedTest.Program::DeviceConnectedEvent [IP: 003a] ####
#### GHIElectronics.NETMF.USBHost.USBH_DeviceConnectionEventHandler::Invoke [IP: 0000] ####
#### GHIElectronics.NETMF.USBHost.USBHostController::nativeEventDispatcher_OnInterrupt [IP: 0037] ####
#### GHIElectronics.NETMF.System.InternalEvent::nativeEventDispatcher_OnInterrupt [IP: 0054] ####

A first chance exception of type ‘System.Exception’ occurred in GHIElectronics.NETMF.USBHost.dll
An unhandled exception of type ‘System.Exception’ occurred in GHIElectronics.NETMF.USBHost.dll

Is this by design - a limitation of the USBH_SerialUSB implementation? I have confirmed the FDTI bridges work without issue in a standard .NET SerialPort loopback application with a BaudRate set to 3000000.

<.NET Micro Code snippet initialising the port>
static void DeviceConnectedEvent(GHIElectronics.NETMF.USBHost.USBH_Device device)
{
Debug.Print(“Device connected”);

        switch (device.TYPE)
        {
            case USBH_DeviceType.Serial_FTDI: // FTDI connected
                serialUSB = new USBH_SerialUSB(device, 921600, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
                serialUSB.Baudrate = 1000000;
                serialUSB.Open();
                serialUSBThread = new Thread(SerialUSBThread);
                serialUSBThread.Start();

                break;

We only supports standard baud rates. Also, if we were to support 3M baud you will be losing a lot of data as the system can’t keep up, so your problem is not in having 3M baud but in rethinking the application. While our NETMF devices are powerful and do much in many way, they are not a 3Ghz PC.

Welcome to the community.