UART problem with G80

UART does not work as expected with my G80.

Dim uart As New SerialPort("COM3", 9600)
uart.Parity = Parity.Even
uart.Open()

Thread.Sleep(3000)
uart.WriteByte(137)

Debug.Print("Done!")
Thread.Sleep(-1)

I get parity errors and sent data does not look right (look at the first image attached).
I don’t have time to investigate, so I am moving to G120, which works fine (look at the second image attached).

Should be easy enough to test on our end. Thanks.

If STM32F4_usart_functions.cpp has this then Parity will be wrong…

UINT16 ctrl = USART_CR1_TE | USART_CR1_RE;
    if (DataBits == 9) ctrl |= USART_CR1_M;
    if (Parity) ctrl |= USART_CR1_PCE;
    if (Parity == USART_PARITY_ODD) ctrl |= USART_CR1_PS;
    uart->CR1 = ctrl;
1 Like

That is because ST has a bit different about configuration for data length and Parity. Use code below as workaround.

uart.Parity = Parity.Even;
uart.DataBits =9;

We will fix in next release.

1 Like