UART IRQ using Queue example

akashmeras wrote on Friday, May 24, 2019:

I have update to latest FreeRTOS version 10.2.1 and tried to run my program but at the starting of the code itself it getting into SVC_Handler

rtel wrote on Friday, May 24, 2019:

The SCV interrupt handler is not installed. Search for vPortSVCHandler
on this page: https://www.freertos.org/FAQHelp.html

akashmeras wrote on Saturday, May 25, 2019:

Thank you It solved my Issue now Queue from ISR is working good…and my issue gets solved…

Need another help from my project regarding queue now using queue inside ISR it sends data to queue by single char is there is any other way to send the total string to the queue…

richarddamon wrote on Saturday, May 25, 2019:

There is also the StreamBuffer interface, which lets you put an arbitrary number of characters (still limited by the size of the buffer) at a time, and the MessageBuffer which puts a variable length message (which is retreived as a whole block). The StreamBuffer interface may be what you are looking for.

akashmeras wrote on Monday, May 27, 2019:

Can you provide me any sample or example program or link using c it will be more usefull for me

rtel wrote on Monday, May 27, 2019:

On 5/26/2019 11:37 PM, Akash wrote:

Can you provide me any sample or emple program or link it will be more
usefull for me

https://www.google.com/search?q=freertos+stream+buffers+interrupt

akashmeras wrote on Tuesday, June 04, 2019:

Hi, I have read about the stream buffer in freeRTOS but one thing not getting clear. In-stream buffer only one data can be stored or we can able to store more than one data like a queue. Is stream buffer can be used as a queue, or we can push the data from stream buffer to queue.

My objective is to receive data from the UART and put it inside a queue because i don’t need to miss any data receiving from the UART while using queue inside ISR I can able to fill only single-single byte but I need to store more than one byte in one queue location and receive the data from the queue location, not as a single-single byte. Is there is any other way for this operation to be performed?

richarddamon wrote on Tuesday, June 04, 2019:

A stream buffer is created with a size that indicates how many bytes of data it can hold, which can be inserted or read in one big chunk or multiple smaller chunks. You can sort of think of a stream buffer as a queue that allows the inserting/removing of a variable nuber of bytes at a time.

The basic stream buffer is really designed for sending amorphous character data from one source to one sync.(The Message Buffer builds on this base protocal to send a variable sized message chunk from a sender to a receiver by imposing structhre to the byte stream).

A Queue can also store multiple bytes if you make the queue larger. With a queue you provide 2 parameters to control its size, one is the size of each thing put in (which would be 1 for a character) and the second is how many of them it can hold. (For Stream Buffers, the size of the chunck is I beleive always a single byte), The ISR can insert multiple bytes into the queue, it just needs to add them one at a time. A Uart ISR could easily have a loop to insert multiple bytes into the queue, and the receiver can have a loop to retrieve multiple bytes from the queue.

The Stream Buffer might be a bit more efficient for this as you need to make just a single call to transfer multiple bytes, so there is less overhead.

You say you need to store more than one byte IN A SINGLE LOCATION, which can not work, as a single location can only store a single character. You can store multiple bytes in multiple locationas within a single queue (up to its size)