6 Replies Latest reply on Jun 7, 2016 12:53 PM by FGT

    How to increase Rx Buffer size on Galileo 2?

    Yacine85

      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

        • 1. Re: How to increase Rx Buffer size on Galileo 2?
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          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

          2 of 2 people found this helpful
          • 2. Re: How to increase Rx Buffer size on Galileo 2?
            Yacine85

            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.

            • 3. Re: How to increase Rx Buffer size on Galileo 2?
              FGT

              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.

              1 of 1 people found this helpful
              • 4. Re: How to increase Rx Buffer size on Galileo 2?
                Yacine85

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

                Regards

                • 5. Re: How to increase Rx Buffer size on Galileo 2?
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  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

                  1 of 1 people found this helpful
                  • 6. Re: How to increase Rx Buffer size on Galileo 2?
                    FGT


                    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.

                    1 of 1 people found this helpful