When the driver is installed, the initial configuration is 115200 N81 with no flow control enabled. I can communicate both ways successfully.
I then enable xon/xoff software flow control with:
Code: Select all
uart_set_sw_flow_ctrl(uartPortNum, true, 8, (UART_FIFO_LEN - 8));
However, if I modify the initial configured baud rate to be something lower, such as such as 9600, or at runtime, change the baud rate the lower value using
Code: Select all
uart_set_baudrate(uartPortNum, 9600);
Initially, I can communicate just fine at the lower baud rate. But after I enable xon/xoff software flow control in the same manner as above, the characters transmitted are not correct. On the other end, it seems to be receiving mostly FF and FE characters, even though I'm transmitting normal, printable characters. And yes, I check the return value to uart_set_sw_flow_ctrl() and it is successful.
After trying many things, I found that, while in this bad state, I change the baud rate back to 115200, transmit at least one character, then change the baud rate back to 9600, it brings it out of the bad state and I can transmit characters successfully again. Of course, this isn't an acceptable workaround, but I'm hoping that someone with more knowledge in these things may be helped by knowing that.
I've tried other, lower baud rates and I see similar, but not exact results. For instance, at 57600, about every other characters is "bad", while the remaining are successfully transmitted.
I am able to change at runtime any other UART parameters, such as parity, stop bits, and data bits (and baud rate) without any trouble. It is just this one flow control setting that is causing havoc.
I appreciate any help.