gadget serial hangs kernel after open(dev/ttyGS0)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

gadget serial hangs kernel after open(dev/ttyGS0)

2,276 次查看
chandraevolute
Contributor V

Hi 

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;

}
else
   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: SerialTesting.c.zip

标签 (2)
0 项奖励
回复
1 回复

1,478 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi chandra

Looks like kernel hangs because USB gadget is not enable correctly, please make sure that your USBgadget is enable on your kernel config on Device Drivers --> USB support --> USB Gadget support --> [*] Function Filesystem (Function FS).

After reboot 

# mount -t configfs none /sys/kernel/config

# cd /sys/kernel/config/

# ls usb_gadget

# cd usb_gadget

If USB Gadget configfs support is enabled we’ll have a usb_gadget subdirectory present. then try to make your tests again.

hope this helps

0 项奖励
回复