
我发送数据量为640个十六进制数据是正常的,上位机有收到书籍。但是我想发送3600个数据就一直灭有反应,不知道为啥什么,求助。我使用的是A9,A10的usart接口。以下是部分代码 #include "stm32f10x.h" // Device header #include <stdio.h> #include <stdarg.h> void Serial_Init(void) { RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOA, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOA, &GPIO_InitStructure); USART_InitTypeDef USART_InitStructure; USART_InitStructure.USART_BaudRate = 9600; USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx; USART_InitStructure.USART_Parity = USART_Parity_No; USART_InitStructure.USART_StopBits = USART_StopBits_1; USART_InitStructure.USART_WordLength = USART_WordLength_8b; USART_Init(USART1, &USART_InitStructure); USART_ITConfig(USART1, USART_IT_RXNE, ENABLE); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); NVIC_InitTypeDef NVIC_InitStructure; NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_Init(&NVIC_InitStructure); USART_Cmd(USART1, ENABLE); } void Serial_SendByte(uint8_t Byte) { USART_SendData(USART1, Byte); while (USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET); } void Serial_SendArray(uint8_t *Array, uint16_t Length) { uint16_t i; for (i = 0; i < Length; i ++) { Serial_SendByte(Array[i]); } } 然后我定义了一个数组arra[3600],用 Serial_SendArray函数发送后没有反应 |
stm32编码器模式计数问题
关于ASM330LHH TR调试中的问题
STM32会存在单个IO口坏掉的情况吗?
STM32N6570-DK开发板,哪里还有卖的?
STM32的DCode bus是连接到bus matrix的吗?参考手册描述和图片是不符吗?
stm32ide怎么正确的导出项目
STM32F105RBT6 2025年 ROSH REACH 报告
STM32CubeMX 使用"FW_F1 V1.8.6"生成FreeRTOS代码缺少"freertos_mpool.h"?
你好,我的setting里面设置都没有问题。但是显示failed download cortexm3
STM32L431偶发串口乱码问题。
BootLoader 上用的
我都是接0