<?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 MCUXpresso USB Virtual Com Port Class Support in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/MCUXpresso-USB-Virtual-Com-Port-Class-Support/m-p/991674#M2828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an MK22FN512 with FreeRTOS and it is running very well. In fact the product is basically done but I would like to now add USB Virtual Serial Port. Up until now, the USB port basically charges the LiOn battery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally, I would go into the pin selection, clock selection, and peripheral selection utilities in MCUXpresso but USB doesn't appear to be like the other peripherals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a step by step guide to add this peripheral. This sounds like an easy one many people may have&amp;nbsp; done.&lt;/P&gt;&lt;P&gt;Thanks, Gary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Dec 2019 23:23:23 GMT</pubDate>
    <dc:creator>gsinde</dc:creator>
    <dc:date>2019-12-17T23:23:23Z</dc:date>
    <item>
      <title>MCUXpresso USB Virtual Com Port Class Support</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/MCUXpresso-USB-Virtual-Com-Port-Class-Support/m-p/991674#M2828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an MK22FN512 with FreeRTOS and it is running very well. In fact the product is basically done but I would like to now add USB Virtual Serial Port. Up until now, the USB port basically charges the LiOn battery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally, I would go into the pin selection, clock selection, and peripheral selection utilities in MCUXpresso but USB doesn't appear to be like the other peripherals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a step by step guide to add this peripheral. This sounds like an easy one many people may have&amp;nbsp; done.&lt;/P&gt;&lt;P&gt;Thanks, Gary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2019 23:23:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/MCUXpresso-USB-Virtual-Com-Port-Class-Support/m-p/991674#M2828</guid>
      <dc:creator>gsinde</dc:creator>
      <dc:date>2019-12-17T23:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso USB Virtual Com Port Class Support</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/MCUXpresso-USB-Virtual-Com-Port-Class-Support/m-p/991675#M2829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I opened an example RTOS / USB project and I will begin from there.&lt;/P&gt;&lt;P&gt;(As I get each step working, I will update this thread)&lt;/P&gt;&lt;P&gt;(My Tool:&amp;nbsp;MCUXpresso IDE v10.3.0 [Build 2200] [2018-12-03])&lt;/P&gt;&lt;P&gt;Step 1) Enable USB pins in MCUXpresso Pin Management GUI&lt;/P&gt;&lt;P&gt;Step 2) Enable USB 48 MHz clock in MCUXpresso Clock Management GUI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2019 18:00:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/MCUXpresso-USB-Virtual-Com-Port-Class-Support/m-p/991675#M2829</guid>
      <dc:creator>gsinde</dc:creator>
      <dc:date>2019-12-19T18:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso USB Virtual Com Port Class Support</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/MCUXpresso-USB-Virtual-Com-Port-Class-Support/m-p/991676#M2830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order to enable the USB clock and get my code to run, I needed to add&amp;nbsp;this line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcIrc48M, 48000000U);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, my code basically just came from the VCOM demo that is included with MCUXpresso. I modified the task to handle my console commands via LPUART0 and USBVCOM through the same command processor and it basically worked as is. The UBS works on complicated call back functions and I tweaked the ISR as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void USB0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;BaseType_t xHigherPriorityTaskWoken = pdFALSE;&lt;/P&gt;&lt;P&gt;USB_DeviceKhciIsrFunction(s_cdcVcom.deviceHandle);&lt;/P&gt;&lt;P&gt;if ((1 == s_cdcVcom.attach) &amp;amp;&amp;amp; (1 == s_cdcVcom.startTransactions))&lt;BR /&gt; {&lt;BR /&gt; if ((0 != s_recvSize) &amp;amp;&amp;amp; (0xFFFFFFFF != s_recvSize))&lt;BR /&gt; {&lt;BR /&gt; uint8_t data = s_currRecvBuf[0];&lt;BR /&gt; s_recvSize = 0;&lt;/P&gt;&lt;P&gt;if (ConsoleProcess(data))&amp;nbsp;&amp;nbsp;&amp;nbsp;// Process one&amp;nbsp; Byte and look for '/r' aka RETURN&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;// User pressed RETURN&lt;BR /&gt; vTaskNotifyGiveFromISR(USBVCOM_TaskToNotify, &amp;amp;xHigherPriorityTaskWoken);&lt;BR /&gt; portYIELD_FROM_ISR(xHigherPriorityTaskWoken);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;/* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping&lt;BR /&gt; exception return operation might vector to incorrect interrupt */&lt;BR /&gt;#if defined __CORTEX_M &amp;amp;&amp;amp; (__CORTEX_M == 4U)&lt;BR /&gt; __DSB();&lt;BR /&gt;#endif&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Dec 2019 16:45:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/MCUXpresso-USB-Virtual-Com-Port-Class-Support/m-p/991676#M2830</guid>
      <dc:creator>gsinde</dc:creator>
      <dc:date>2019-12-21T16:45:23Z</dc:date>
    </item>
  </channel>
</rss>

