<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic gadget serial hangs kernel after open(dev/ttyGS0) in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/gadget-serial-hangs-kernel-after-open-dev-ttyGS0/m-p/665924#M102450</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing a strange issue&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my sample code&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;iSerialFD = open("/dev/ttyGS0",O_RDWR | O_NONBLOCK);&lt;/P&gt;&lt;P&gt;if(iSerialFD &amp;lt; 0)&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;printf("\n Error! in Opening ttyGS0\n");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;return 0;&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;printf("\n ttyGS0 Opened Successfully\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf("I am here\n");&lt;/P&gt;&lt;P&gt;After performing open it is printing the ttyGS0 Opened successfully but it is not going after that statement. Kernel hangs up there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the code.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-335964"&gt;SerialTesting.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 May 2017 06:21:37 GMT</pubDate>
    <dc:creator>chandraevolute</dc:creator>
    <dc:date>2017-05-04T06:21:37Z</dc:date>
    <item>
      <title>gadget serial hangs kernel after open(dev/ttyGS0)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/gadget-serial-hangs-kernel-after-open-dev-ttyGS0/m-p/665924#M102450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing a strange issue&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my sample code&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;iSerialFD = open("/dev/ttyGS0",O_RDWR | O_NONBLOCK);&lt;/P&gt;&lt;P&gt;if(iSerialFD &amp;lt; 0)&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;printf("\n Error! in Opening ttyGS0\n");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;return 0;&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;printf("\n ttyGS0 Opened Successfully\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf("I am here\n");&lt;/P&gt;&lt;P&gt;After performing open it is printing the ttyGS0 Opened successfully but it is not going after that statement. Kernel hangs up there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the code.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-335964"&gt;SerialTesting.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 06:21:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/gadget-serial-hangs-kernel-after-open-dev-ttyGS0/m-p/665924#M102450</guid>
      <dc:creator>chandraevolute</dc:creator>
      <dc:date>2017-05-04T06:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: gadget serial hangs kernel after open(dev/ttyGS0)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/gadget-serial-hangs-kernel-after-open-dev-ttyGS0/m-p/665925#M102451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chandra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 --&amp;gt; USB support --&amp;gt; USB Gadget support --&amp;gt; [*] Function Filesystem (Function FS).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After reboot&amp;nbsp;&lt;/P&gt;&lt;P&gt;# mount -t configfs none /sys/kernel/config&lt;/P&gt;&lt;P&gt;# cd /sys/kernel/config/&lt;/P&gt;&lt;P&gt;# ls usb_gadget&lt;/P&gt;&lt;P&gt;# cd usb_gadget&lt;/P&gt;&lt;P&gt;If USB Gadget configfs support is enabled we’ll have a usb_gadget subdirectory present. then try to make your tests again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 16:17:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/gadget-serial-hangs-kernel-after-open-dev-ttyGS0/m-p/665925#M102451</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2017-05-11T16:17:53Z</dc:date>
    </item>
  </channel>
</rss>

