Search code examples
stm32uart

Transmitting message with UART in STM32 Nucleo using Eclipse


I'm trying to send sample text for making sure that UART_GPIO_Transmit function works well. I'm using two char arrays:

char aMESSAGE[8] = "WHATEVER";
char bMESSAGE[10] = "0123456789";

and this code for UART transmission:

HAL_UART_Transmit(&UartHandle, &aMESSAGE,10, 0xFFF);
HAL_UART_Transmit(&UartHandle, &bMESSAGE,10, 0xFFF);

Using screen in Mac OS X for viewing the serial output. However, I see this:

W��TE�ER�12�4��78�

Solution

  • The problem is on receiving side, screen has probably enabled parity checking and your MCU program don't set parity for transmitting, so in your example all characters with even parity are not accepted and you see ?

    Or the problem could be also on opposite side that MCU set parity and computer don't accept characters with zero stop bit.