Community
cancel
Showing results for 
Search instead for 
Did you mean: 
YHade
New Contributor I
956 Views

How to increase Rx Buffer size on Galileo 2?

Hello all,

i have a big probleme with the Rx Buffer size in UART0, it can hold only 8 characters, i want to increase it untill 255 how can do it please? (i'm using Eclipse C++ downloaded from Intel website)

ISR interrupt works fine but 8 charachters is not enough...i tried with ring buffer but the the interrupt will be called every time the buffer (8 charachters) will be full.

If i just could increase this Buffer from 8 to 255 characters

Thank you very much in advance

Best regards

0 Kudos
6 Replies
idata
Community Manager
74 Views

Hi Yacine85,

 

 

If I'm not mistaken, the Rx buffer size cannot be modified. I'd suggest you to use a second buffer created through software of the length you need and copy the value received in the Rx buffer to this one. This way, once you receive a new byte, the ISR will be executed. In the ISR, you have to add the new byte that was received in the Rx buffer to the software buffer in the next position, so you don't lose the previous data. Then, the buffer you read is the one you created, not the Rx buffer.

 

 

Hope this approach helps you.

 

 

Regards,

 

Diego
YHade
New Contributor I
74 Views

Hello Diego,

Thank you for your reply.

I'll appreciate, if you could suggest me for a subject or something.

I tried with ring buffer, i did not got it.

Regards.

FTinetti
Honored Contributor I
74 Views

Hi Yacine85,

I think it's not difficult what Diego suggested:

a) Have your own array of 255 characters, with your own character counter (initially 0, of course)

b) Each time the ISR is called, you transfer

ISR interrupt works fine but 8 charachters is not enough...i tried with ring buffer but the the interrupt will be called every time the buffer (8 charachters) will be full.

the 8 character/s that fill/s the input buffer to your own buffer, increasing your buffer character counter. Once you get the 256 characters, your buffer is full and you should process as you want/need to.

HTH,

Fernando.

YHade
New Contributor I
74 Views

Thank you Fernando, i'll try it and will post my solution here for other members

Regards

idata
Community Manager
74 Views

Hi Yacine85,

 

 

You could also restart your counter to 0 once you reach the final position in your buffer in order to keep writing the incoming data from the Rx buffer. This is optional of course, but since you mentioned you tried setting a ring buffer, I though you would like to implement the buffer this way.

 

 

Regards,

 

Diego
FTinetti
Honored Contributor I
74 Views

 

You could also restart your counter to 0 once you reach the final position in your buffer in order to keep writing the incoming data from the Rx buffer. This is optional of course, but since you mentioned you tried setting a ring buffer, I though you would like to implement the buffer this way.

Hmm... for a ring buffer it is not necessarily enough to restart the counter, unless it is not a problem to lose data... Usually a ring buffer requires two pointers/indexes to avoid losing data...

Fernando.

Reply