Apology for late reply.
I've tried with options.c_cc[VMIN] = 0; it's still the same issue.
>From the datasheet of AM335x, uart rx/tx buffers are 64 bytes.
I've also tried putting tx command in tx thread that activated later than
rx thread. Nothing changed as well.
void* uartTxWait(void *param){
int count;
usleep(1000000);
unsigned char cmd[] = {0x10, 0x00, 0x32}; //"Tx From Beaglebone ";
if ((count = write(file, (char*)cmd, 3))<0){
perror("Failed to write to the output\n");
//tcsetattr(file, TCSAFLUSH, &oriopt); //before exit,
undo raw setting
//return -1;
}else{
printf("Byte sent: %d \n", count);
}
pthread_exit(0);
}
On Friday, July 22, 2016 at 10:50:52 PM UTC+8, Wally Bkg wrote:
>
> I noticed you have options.c_cc[VMIN] = 2; If for some reason only one
> character comes in, it'll block forever. Try using options.c_cc[VMIN] =
> 0; so that each char can timeout if its not received.
>
> How big are the Beaglebone uart buffers?
>
> You may still have a race between your write of the data and starting your
> RX thread. Try putting the write into your TX thread and launch it after
> you've launched the RX thread.
>
>
>
> On Thursday, July 21, 2016 at 10:10:11 PM UTC-5, Regina Choi wrote:
>>
>>
>> Hi Wally,
>>
>> I have tried adding fflush(stdout and fflush(stderr) in the while loop,
>> however, in the UartRxWait thread, the read( ) function is in block waiting
>> for incoming data. Which doesn't output anything. In the case, after start
>> and shut down minicom, the UartRxWait thread running as usual, there is no
>> output from the fflush(stdout) and fflush(stderr) either.
>>
>> yes, at the moment I have to kill the program to terminate. I have
>> modified the code such that it loop for only 5 times and terminate the
>> thread.
>>
>>
>>
--
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/580a687c-fde8-479f-9b40-9ac63a56898a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.