SCM20100E - UART2 hardware flow control

Using SCM20100E.

I am trying to use hardware flow control to connect to a cellular modem. I am using UART2. When I try to use Uart Setting, Handshaking = UartHandshake.RequestToSend I get a “CLR_E_INVALID_OPERATION” error.

    var serial = GHIElectronics.TinyCLR.Devices.Uart.UartController.FromName(GHIElectronics.TinyCLR.Pins.SC20260.UartPort.Uart2);

    var uartSettings = new UartSetting()
    {
        BaudRate = 115200,
        DataBits = 8,
        Parity = UartParity.None,
        StopBits = UartStopBitCount.One,
        Handshaking = UartHandshake.RequestToSend
    };

    serial.SetActiveSettings(uartSettings);
    serial.Enable();

I have tried:

GHIElectronics.TinyCLR.Devices.Uart.UartController.FromName(GHIElectronics.TinyCLR.Pins.SC20260.UartPort.Uart2);

GHIElectronics.TinyCLR.Devices.Uart.UartController.FromName(GHIElectronics.TinyCLR.Pins.SC20100.UartPort.Uart2); 

GHIElectronics.TinyCLR.Devices.Uart.UartController.FromName(GHIElectronics.TinyCLR.Pins.STM32H7.UartPort.Usart2)

All three give me the same error. Anything else I could be missing?

******Edit
Same error when setting up and using the UartNetworkCommunicationInterfaceSettings() and attempting to use Handshaking = UartHandshake.RequestToSend.

does it raise exception when call “uart.SetActiveSetting()” for uart.Enable()?

Error is at serial.SetActiveSettings(uartSettings);

#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (4) ####
#### Message: 
#### GHIElectronics.TinyCLR.Devices.Uart.Provider.UartControllerApiWrapper::SetActiveSettings [IP: 0000] ####
#### GHIElectronics.TinyCLR.Devices.Uart.UartController::SetActiveSettings [IP: 0033] ####
#### ssg3_v0_0_1.CellularConnection::Start [IP: 009b] ####
Exception thrown: 'System.InvalidOperationException' in GHIElectronics.TinyCLR.Devices.Uart.dll

Do you use cts rts pin anywhere else?

Dang it I missed that, sorry. I had RTS and CTS initialized as I/O further up in my code and forgot to remove it.
Sorry to waste your time.

2 Likes