linux串口调试stm32,STM32F4串口通信串口调试助手接收不到

编程入门 行业动态 更新时间:2024-10-07 20:25:14

回复【3楼】正点原子:

---------------------------------

额,我菜鸟。

是这样的:

void Usart1_init(void)

{

NVIC_InitTypeDef NVIC_InitStructure;

USART_InitTypeDef USART_InitStructure;

GPIO_InitTypeDef  GPIO_InitStruct;

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);

GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AF;

GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;

GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_UP;

GPIO_InitStruct.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10;

GPIO_Init(GPIOA, &GPIO_InitStruct);

GPIO_PinAFConfig(GPIOA,GPIO_PinSource9,GPIO_AF_USART1);

GPIO_PinAFConfig(GPIOA,GPIO_PinSource10,GPIO_AF_USART1);

RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);

NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;

NVIC

更多推荐

linux串口调试stm32,STM32F4串口通信串口调试助手接收不到

本文发布于:2023-06-13 20:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1402464.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:串口   助手   通信   linux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!