Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor II
1,795 Views

Direct Memory Access Serial Port

I need to know the exact moment when the serial buffer is empty.

I'm using PySerial but flush() or out_waiting indicates that the buffer is empty too early. I toggle a digital pin when flush() and out_waiting is done and look at the signal on an oscilloscope but the bit change is too early.

Is there a way to know when the buffer is empty in a low level way?

5 Replies
Highlighted
Employee
29 Views

Hi

Can you provide the code you're using so we can test it? Also provide the pictures that show the oscilloscope and the measurements using both flush() and out_waiting functions.

What image are you using, the eglibc or the uClibc image? Do you have any external circuitry connected?

Sergio

0 Kudos
Highlighted
Employee
29 Views

Hi BrechtW,

Were you able to solve the issue on your own? Do you still need help?

Regards,

Pablo

0 Kudos
Highlighted
New Contributor II
29 Views

I'm busy at the moment but I'm using eglibc and no external circuitry connected. I write some data to the serial port and directly toggle a pin. Later I used the flush and out_waiting functions. I was wondering if it was possible to get the number of bytes in the buffer with direct memory acces.

0 Kudos
Highlighted
Employee
29 Views

You can see more information on the DMA's buffer, registers etc. here http://www.intel.com/content/www/us/en/embedded/products/quark/quark-x1000-datasheet.html Intel® Quark™ SoC X1000: Datasheet .

If you can, please provide the code and the oscilloscope pictures with the results of the functions you're using.

Sergio

0 Kudos
Highlighted
New Contributor II
29 Views

Thank you. I will look into the "18.3.1 DMA Mode Operation" section.

0 Kudos