I tried the transmit and read in one thread, ie main(), the problem I notices is that after my transmit bytes (3 bytes), the read is able to read in the echo from the uart device attached to Beaglebone, then the process terminated where the terminal seemingly waiting for input uart message. Noted that, the uart device echo each byte received.
As I use command: ps ax | grep readComm in another terminal, and it only shows 2179 pts/1 S+ 0:00 grep readComm where I know the process readComm has terminated. I'm wondering, can uart in beaglebone support full duplex? Because if the device does not echo byte, the uart read is normal. On Sunday, July 31, 2016 at 11:58:51 PM UTC+8, Wally Bkg wrote: > > Since you are not getting the timeout errors from your read thread, there > is definitely something wrong with your UART initilization. And since you > need to kill your program with Ctr-C, your read thread would seem to be > running and blocking main() in the pthread_join(). > > Have you read through this guide: > https://www.cmrr.umn.edu/~strupp/serial.html > > While your device is not a modem, odds are you want to talk to it as if it > were, but instead of using "AT commands" your device will have its own > command-response protocol for your program to implement. > > The suggestion to use separate programs communicating by shared memory > protected by a named semaphore is viable but should not be necessary. But > I often first write a thread function as main() in a stand alone program > and move it into a thread function once I've got it basically working. > > On Monday, July 25, 2016 at 10:32:09 PM UTC-5, Regina Choi wrote: >> >> Thanks for reply. >> >> I'm not sure why, but I don't get timeout error messages from the read >> thread (though I have set it to 1 sec) !? It just freeze there waiting for >> UART input, even though there are UART input coming in. >> >> Yes, I got the Byte sent message printf from TX thread. Please see the >> attachement. >> >> >> -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/b1bcf558-75c9-43ed-aa5a-44b297c8c82a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
