Page 1 of 1

STM32 Increase Uart RX buffer size

Posted: Wed May 01, 2024 8:17 pm
by Alan_37
Hello

I am trying to send a 256Byte serial data to write 1 page of W25 flash
but is seems that the max number of bytes I can receive is 255, I think is the Uart RX buffer Size
that is limiting this , is there a way to increase the RX buffer size ?

Tried the following but dose not work

Code: Select all

HAL_UART_DeInit(&MX_UART_NUMBER_1);
MX_UART_NUMBER_1.Init.RxSize = 280;
HAL_UART_Init(&MX_UART_NUMBER_1);

Re: STM32 Increase Uart RX buffer size

Posted: Wed May 01, 2024 8:23 pm
by chipfryer27
Hi

Would the circular buffer be of use?

Usually I use the RxINT to grab a byte and immediately store in the buffer for processing within the Main loop.

Just a thought.

Regards

Re: STM32 Increase Uart RX buffer size

Posted: Wed May 01, 2024 8:53 pm
by Alan_37
Hi chipfryer27,

Thanks for your reply

I am using a circular buffer, have set number of bytes to 260
have also tested the buffer it can hold 260 bytes so buffer is not the issue .

I am still not 100% sure it is the RX buffer :idea: maybe I try Uart in software mode
that should eliminate the hardware buffer

Re: STM32 Increase Uart RX buffer size

Posted: Wed May 01, 2024 9:21 pm
by Alan_37
Found it ,

Was not the RX Buffer , I was trying to get the circular buffer size into a byte variable
which 255 is the max .

Jeez, that was kinda stupid :lol:

Thanks again

Reagrds