STM32 Increase Uart RX buffer size

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Alan_37
Posts: 137
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 41 times
Been thanked: 19 times

STM32 Increase Uart RX buffer size

Post 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);

chipfryer27
Valued Contributor
Posts: 1188
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: STM32 Increase Uart RX buffer size

Post 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

Alan_37
Posts: 137
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 41 times
Been thanked: 19 times

Re: STM32 Increase Uart RX buffer size

Post 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

Alan_37
Posts: 137
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 41 times
Been thanked: 19 times

Re: STM32 Increase Uart RX buffer size

Post 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

Post Reply