I am facing data missing probelm on UART. UART serial buffer losing some bytes when xQueueSendFromISR called from UART Rx ISR. Basically it is request and response communication over uart. response will come in 2 parts. after receiving the first part, called xQueueSendFromISR from UART Rx ISR. at the the same time 2nd part of response will receive. Also Data seeing by tapping UART Rx line, same is not receiving/seeing in UART Rx buffer (ISR Rx circular buffer)
Is xQueueSendFromISR will disable all the interrupts?
Other way i tried not calling xQueueSendFromISR, keeping rxflag, this time could not see the data bytes missed.
We are using 3 uarts in interrupt mode, 2 are connected to modem communication. Another one debug logging. One uart get data (size - 64bytes) for every 1 sec will be received in uart rx isr and from there data will be pushed to queue (xQueueSendFromISR(xQueue, &buffer, NULL) ).
second uart used for req and response communication, response will be received in 2 messages. one after one. first message received and pushed to queue during push the data into queue second message not able to receive by the uart serial buffer. if i remove xQueueSendFromISR from isr function i can be able to see data in uart rx isr circular buffer. Suspecting xQueueSendFromISR will disable the interrupts during data push into queue because of that few of the bytes missing in uart rx ISR
There is a chance of your circular isr buffer being too small so that the buffer is overwritten before the signalled tasks have a chance to copy the data into application space. Also, do you monitor the hardware error flags (overrun, parity and frame errors) in your isr?
Again, without seeing code, everything is guess work.
Note, you are sending via the queue the ADDRESS of the resp_pkt_isr structure, so that is what the receiving task will get, the ADDRESS of the structure. Then you immediately clear the structure before the task can do anything with it, so of course the task can’t see what was there.
You either need to send the whole structure, which will be a lot of data copying, or you need to have a list of these packet buffers, so you can send one to the task to process while you are filling another.
resp_pkt_isr seems to be the object and not the pointer. So passing &resp_pkt_isr should copy the object, assuming the queue item size (as given at the time of queue creation) is correct.
@srinivasa Is it possible for you to share complete code? May be put it somewhere in GitHub and share a link?