<?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 USB CDC VCOM error &amp;quot;The semaphore timeout period has expired&amp;quot; from .NET host in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-CDC-VCOM-error-quot-The-semaphore-timeout-period-has-expired/m-p/1278214#M45035</link>
    <description>&lt;P&gt;When trying to send anything to an opened serial port from a simple .NET/C# application, on most Windows PCs I get the error&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Unhandled Exception: System.IO.IOException: The semaphore timeout period has expired.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)&lt;BR /&gt;at System.IO.Ports.SerialStream.EndWrite(IAsyncResult asyncResult)&lt;BR /&gt;at System.IO.Ports.SerialStream.Write(Byte[] array, Int32 offset, Int32 count, Int32 timeout)&lt;BR /&gt;at System.IO.Ports.SerialPort.Write(String text)&lt;BR /&gt;at System.IO.Ports.SerialPort.WriteLine(String text)&lt;BR /&gt;at TestSerial.Executer.Go(UInt32 COMPort, UInt32 BaudRate, List`1 Operations)&lt;BR /&gt;at TestSerial.Program.Main(String[] args)&lt;/PRE&gt;&lt;P&gt;This is using the standard SDK example &lt;EM&gt;lpcxpresso54628_dev_composite_cdc_vcom_cdc_vcom_bm&lt;/EM&gt; with the following single code change in usb_device_config.h:&lt;/P&gt;&lt;PRE&gt;/*! @brief LPC USB IP3511 FS instance count */&lt;BR /&gt;#define USB_DEVICE_CONFIG_LPCIP3511FS (&lt;STRONG&gt;0&lt;/STRONG&gt;U)&lt;BR /&gt;&lt;BR /&gt;/*! @brief LPC USB IP3511 HS instance count */&lt;BR /&gt;#define USB_DEVICE_CONFIG_LPCIP3511HS (&lt;STRONG&gt;1&lt;/STRONG&gt;U)&lt;/PRE&gt;&lt;P&gt;So instead of the FS port I use the HS port, everything else is 100% the SDK code.&lt;/P&gt;&lt;P&gt;This problem does not happen with native C++ applications or with Python/pyserial which also uses native programming underneath, it only happens with .NET applications using System.IO like my test or Termie from codeproject.&lt;/P&gt;&lt;P&gt;It also doesn't happen with all PCs, but from 4 I tried it happened on 3 of them even though they all use the same standard class USB virtual serial port driver usbser.sys version 10.0.19041.906 from Windows 10.&lt;/P&gt;&lt;P&gt;This doesn't happen with other non-NXP VCOM interfaces like FTDI ones so it must be something specific to the NXP-provided implementation.&lt;/P&gt;&lt;P&gt;Using an LPCXpresso54628 eval board.&lt;/P&gt;</description>
    <pubDate>Tue, 18 May 2021 12:20:42 GMT</pubDate>
    <dc:creator>Chris-at-EmSA</dc:creator>
    <dc:date>2021-05-18T12:20:42Z</dc:date>
    <item>
      <title>USB CDC VCOM error "The semaphore timeout period has expired" from .NET host</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-CDC-VCOM-error-quot-The-semaphore-timeout-period-has-expired/m-p/1278214#M45035</link>
      <description>&lt;P&gt;When trying to send anything to an opened serial port from a simple .NET/C# application, on most Windows PCs I get the error&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Unhandled Exception: System.IO.IOException: The semaphore timeout period has expired.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)&lt;BR /&gt;at System.IO.Ports.SerialStream.EndWrite(IAsyncResult asyncResult)&lt;BR /&gt;at System.IO.Ports.SerialStream.Write(Byte[] array, Int32 offset, Int32 count, Int32 timeout)&lt;BR /&gt;at System.IO.Ports.SerialPort.Write(String text)&lt;BR /&gt;at System.IO.Ports.SerialPort.WriteLine(String text)&lt;BR /&gt;at TestSerial.Executer.Go(UInt32 COMPort, UInt32 BaudRate, List`1 Operations)&lt;BR /&gt;at TestSerial.Program.Main(String[] args)&lt;/PRE&gt;&lt;P&gt;This is using the standard SDK example &lt;EM&gt;lpcxpresso54628_dev_composite_cdc_vcom_cdc_vcom_bm&lt;/EM&gt; with the following single code change in usb_device_config.h:&lt;/P&gt;&lt;PRE&gt;/*! @brief LPC USB IP3511 FS instance count */&lt;BR /&gt;#define USB_DEVICE_CONFIG_LPCIP3511FS (&lt;STRONG&gt;0&lt;/STRONG&gt;U)&lt;BR /&gt;&lt;BR /&gt;/*! @brief LPC USB IP3511 HS instance count */&lt;BR /&gt;#define USB_DEVICE_CONFIG_LPCIP3511HS (&lt;STRONG&gt;1&lt;/STRONG&gt;U)&lt;/PRE&gt;&lt;P&gt;So instead of the FS port I use the HS port, everything else is 100% the SDK code.&lt;/P&gt;&lt;P&gt;This problem does not happen with native C++ applications or with Python/pyserial which also uses native programming underneath, it only happens with .NET applications using System.IO like my test or Termie from codeproject.&lt;/P&gt;&lt;P&gt;It also doesn't happen with all PCs, but from 4 I tried it happened on 3 of them even though they all use the same standard class USB virtual serial port driver usbser.sys version 10.0.19041.906 from Windows 10.&lt;/P&gt;&lt;P&gt;This doesn't happen with other non-NXP VCOM interfaces like FTDI ones so it must be something specific to the NXP-provided implementation.&lt;/P&gt;&lt;P&gt;Using an LPCXpresso54628 eval board.&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 12:20:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-CDC-VCOM-error-quot-The-semaphore-timeout-period-has-expired/m-p/1278214#M45035</guid>
      <dc:creator>Chris-at-EmSA</dc:creator>
      <dc:date>2021-05-18T12:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC VCOM error "The semaphore timeout period has expired" from .NET host</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-CDC-VCOM-error-quot-The-semaphore-timeout-period-has-expired/m-p/1279989#M45081</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/186836"&gt;@Chris-at-EmSA&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Looking around,&amp;nbsp; I found many problems reported using System.IO.Ports.SerialPort class, and in the following &lt;A href="https://www.sparxeng.com/blog/software/must-use-net-system-io-ports-serialport" target="_self"&gt;post&lt;/A&gt; explain the unreliability of this class. Since it works using shells (TeraTerm or putty) and&amp;nbsp;&lt;SPAN&gt;native C++ applications or with Python/pyserial. I think this is only a problem with this .NET implementation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;BR /&gt;Alexis Andalon&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 23:09:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-CDC-VCOM-error-quot-The-semaphore-timeout-period-has-expired/m-p/1279989#M45081</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2021-05-20T23:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: USB CDC VCOM error "The semaphore timeout period has expired" from .NET host</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-CDC-VCOM-error-quot-The-semaphore-timeout-period-has-expired/m-p/1280355#M45090</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/167559"&gt;@Alexis_A&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your reply. The issue, on the same PCs using the same code, only shows with the NXP VCOMs, not any other implementations like FTDI or Prolific. In the code, I am not using any of the unreliable methods that the article mentions, only open the port and send a few bytes. The error also shows in this little tool:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.codeproject.com/Articles/23656/Termie-A-Simple-RS232-Terminal" target="_blank"&gt;https://www.codeproject.com/Articles/23656/Termie-A-Simple-RS232-Terminal&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So it should be easy to reproduce, just connect to an NXP VCOM (built for HS USB, not FS) and try to send something. As I said three from four PCs showed the problem.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 10:58:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-CDC-VCOM-error-quot-The-semaphore-timeout-period-has-expired/m-p/1280355#M45090</guid>
      <dc:creator>Chris-at-EmSA</dc:creator>
      <dc:date>2021-05-21T10:58:04Z</dc:date>
    </item>
  </channel>
</rss>

