cancel
Showing results for 
Search instead for 
Did you mean: 

UART transmit error character

mal h
Associate II

0690X00000ArRaqQAF.png0690X00000ArRb0QAF.png0690X00000ArRbAQAV.png0690X00000ArRb5QAF.pngHello,

i have problem for using STM32H743VI. start from the basic problem, that is transmit UART standard. i use latest firmware of STM32H7 version 1.5.0, latest update STM32CUBEIDE 1.1.0 and latest update STM32CUBEMX 5.3.

here the code:

int main(void)

{

 /* USER CODE BEGIN 1 */

 /* USER CODE END 1 */

  

 /* MCU Configuration--------------------------------------------------------*/

 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */

 HAL_Init();

 /* USER CODE BEGIN Init */

 /* USER CODE END Init */

 /* Configure the system clock */

 SystemClock_Config();

 /* USER CODE BEGIN SysInit */

 /* USER CODE END SysInit */

 /* Initialize all configured peripherals */

 MX_GPIO_Init();

 MX_UART8_Init();

 /* USER CODE BEGIN 2 */

 /* USER CODE END 2 */

 /* Infinite loop */

 /* USER CODE BEGIN WHILE */

 while (1)

 {

  /* USER CODE END WHILE */

 HAL_UART_Transmit( &huart8, (uint8_t *)"test send data \n", sizeof("test send data \n"), 1000 );

 HAL_Delay(1000);

  /* USER CODE BEGIN 3 */

 }

 /* USER CODE END 3 */

}

the output is showed by image that i attach here. please any help?

Thankyou very much.

1 ACCEPTED SOLUTION

Accepted Solutions
mal h
Associate II

Thanks guys for the answer..

i got the problem. First, yes timing/clock problem. So, i switch manually from HSI to HSE for clock source. little bit tricky, but nice learn. Thank you.

View solution in original post

4 REPLIES 4

Timing looks close.

Hows this all connected from STM32 to PC?

The STM32 doesn't output RS232 compatible voltages, needs MAX3232 or similar to do voltage conversion/inversion.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
mal h
Associate II

Thank you for the response.

i use IC ft232rl for converting UART to USB. and the USB plug into laptop and receive data with software (Realterm and Serial Monitor Arduino). i have done with this method for another STM32 IC like STM32F3 on another project. but, it stuck here for STM32H7.

RMcCa
Senior II

I had uart trouble with an f7 ​after switching from hsi to hse oscillators. Turns out hal was not calculating the baud rate correctly, so i just wrote my own initialization routine with the correct baud rate hard coded. I don't trust hal.

mal h
Associate II

Thanks guys for the answer..

i got the problem. First, yes timing/clock problem. So, i switch manually from HSI to HSE for clock source. little bit tricky, but nice learn. Thank you.