STM32 Usart Data Width

83 Views Asked by At

I am exchanging data with Stm32 via uart.

However, when exchanging data, I can only receive 255 pieces of data.

How can I increase the data size?

The problem occurs when the data size is larger than 255. How can I transfer data larger than 255? Datasheet said " DMA Tranfer capacity is 65536"

 #define RxBufferSize 1500
uint8_t RxBuffer[RxBufferSize];
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size){
    
if(huart->Instance == USART3){
    HAL_UARTEx_ReceiveToIdle_DMA(&huart3,RxBuffer,RxBufferSize);
    __HAL_DMA_DISABLE_IT(&hdma_usart3_rx,DMA_IT_HT);    
    sending1(RxBuffer,Size);
    memset(RxBuffer,'\0',Size);
}


HAL_UARTEx_ReceiveToIdle_DMA(&huart3,RxBuffer,RxBufferSize);
                  __HAL_DMA_DISABLE_IT(&hdma_usart3_rx,DMA_IT_HT);


while(1){

}
0

There are 0 best solutions below