AnsweredAssumed Answered

gadget serial hangs kernel after open(dev/ttyGS0)

Question asked by chandra sekhar on May 3, 2017
Latest reply on May 11, 2017 by Bio_TICFSL


I am facing a strange issue 

Below is my sample code 


iSerialFD = open("/dev/ttyGS0",O_RDWR | O_NONBLOCK);

if(iSerialFD < 0)
   printf("\n Error! in Opening ttyGS0\n");
   return 0;

   printf("\n ttyGS0 Opened Successfully\n");
   printf("I am here\n");

After performing open it is printing the ttyGS0 Opened successfully but it is not going after that statement. Kernel hangs up there. 

Another strange issue is I can perform open read write of the same gadget serial port if I compile the serial program as a single C file. But when I link all the output files to single executable I am facing this problem. 

Attached is the code.

Original Attachment has been moved to: