1100 views|1 replies

7171

Posts

195

Resources
The OP
 

[STM32H5 development board] Chapter 6 CubeMx serial port printf test [Copy link]

This post was last edited by Changjianze1 on 2023-5-13 22:36

Chapter 6 STM32H5 serial printf project

1. USART Hardware Selection

I really can't find the schematic diagram, I can only read the introduction of Nucleo

Select an onboard USART

Look at the data sheet for these two pins

2. USART Introduction

In the STM32 reference manual, the serial port USART (Universal Synchronous Asynchronous Receiver and Transmitter) is a serial communication device that can flexibly exchange full-duplex data with external devices. UART (Universal Asynchronous Receiver and Transmitter) is based on USART and has only asynchronous communication functions. The simple distinction between synchronous and asynchronous is to see whether a clock output is required during communication. The serial port communication we generally use is basically UART, that is, asynchronous UART, which needs to be paid attention to when generating projects later.

Look at the serial port characteristics of STM32H5

Three creation projects

Based on the previous project, the clock and other things are based on the previous 250M

Start serial port configuration directly

Generate Project

After generating the project, open the project and add a piece of code to main.c

Because I chose uart3 here

/* USER CODE END 0 */

int fputc(int ch, FILE *f)

{

 HAL_UART_Transmit(&huart3, (uint8_t *)&ch, 1, 2);//huart根据你的配置修改

 return ch;

}

I was struggling with this problem for dozens of minutes, and I couldn't solve it no matter what I did. I tried many solutions and modified the startup file, but it didn't work. The final solution was to just click Recompile.

Four test situations

【STM32H5开发板】第六篇 CubeMx串口printf测试.pdf (1.1 MB, downloads: 7)

This post is from stm32/stm8

Latest reply

Printf should be quite big if it is in bin   Details Published on 2023-5-14 15:36
 

7422

Posts

2

Resources
2
 

Printf should be quite big if it is in bin

This post is from stm32/stm8
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list