大家好: 现在我调试dma串口时,接收的数据是重复的,发不同数据会有重复在里面,是u不是要清除buffer,百度各种方法无法实现。 void u_uart_dma_receive_idle(UART_HandleTypeDef *huart, uint8_t index) { if((__HAL_UART_GET_FLAG(huart, UART_FLAG_IDLE) != RESET)) { __HAL_UART_CLEAR_IDLEFLAG(huart); UartRawPack[index-1]->len = UART_MAX_LEN - ((DMA_Stream_TypeDef*)huart->hdmarx->Instance)->NDTR; //Send Data to queue here. if(UartRawPack[index-1]->len > 0){ u_uart_dma_RxCpltCallback(huart, UartRawPack[index-1]); } HAL_UART_DMAStop(huart); //HAL_UART_Transmit_DMA(huart, UartRawPack[index-1]->Data, UartRawPack[index-1]->len); HAL_UART_Receive_DMA(huart, UartRawPack[index-1]->Data, UART_MAX_LEN); } } |
STM32H750使用FMC控制LCD数据异常
STM32H7 CANFD过滤问题
关于STM32H750采用DMA方式发送数据到DAC产生正弦波
STM32H7配置成USB DEVICE时,连接电脑时不进入中断
STM32H753XIH6运行时发热达到五六十度
STM32H750电池供电后AD采样的电容板子电压变化异常
STM32H750VB芯片整片无法擦出
STM32H743IIT6Flash擦除问题
STM32H750 ADC 发现结果跳动很严重
STM32H743ZI无法串口下载程序
/* Configure the MPU attributes as Device not cacheable
for UART DMA descriptors */
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = 0x38000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_64KB;
MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER3;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.SubRegionDisable = 0x00;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
评分
查看全部评分
这个是怎么解决的,是打开cache,还是关闭cache,我目前发送两包不同的数据到串口,接收到的一包数据会有这两个包的内容,感觉数据被覆盖了