<?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 How to implement back-pressure Flow control with ROM driver, RegisterEpHandler(,,,) for BULK_OUT,  in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-implement-back-pressure-Flow-control-with-ROM-driver/m-p/523768#M6404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larsen on Wed Jan 02 09:08:12 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to figure out how I can postpone the buffer read after the callback VCOM_bulk_out_hdlr has given a an event of type USB_EVT_OUT. I want to hold back the host until the downstream channel has room for the data, but I dont want to idle inside the callback nor to buffer-up in yet a buffer layer. The callback is running at interrupt priority. I.e. ReadEP() function should be run later (and at task priority). Is that possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Returning ERR_USBD_UNHANDLED in the callback. Will that hold back the host for sending new data until the present ones are read? If yes, will reading the out data using -&amp;gt;ReadEP(hUsb, USB_CDC_EP_BULK_OUT, &amp;amp;buffer) actually unblock the host (sending ACK's) when more data arrives?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, in reading the code comments with the fine looking-glass I found the following surprising information:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The RegisterEpHandler() in the ROM driver assigns a callback for users application. In the typedef for this callback the comments says among other&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/** &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; *&amp;nbsp; The application layer should define the custom class's &amp;lt;B&amp;gt;EP0&amp;lt;/B&amp;gt; handler with function signature. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why does it say EP0 (which I translate to EndPoint_Zero)? I would expect it to read simply 'EndPoint'. Is the code comment really true in which case I dont understand how the code should operate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any advice you may have&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:46:44 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:46:44Z</dc:date>
    <item>
      <title>How to implement back-pressure Flow control with ROM driver, RegisterEpHandler(,,,) for BULK_OUT,</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-implement-back-pressure-Flow-control-with-ROM-driver/m-p/523768#M6404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larsen on Wed Jan 02 09:08:12 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to figure out how I can postpone the buffer read after the callback VCOM_bulk_out_hdlr has given a an event of type USB_EVT_OUT. I want to hold back the host until the downstream channel has room for the data, but I dont want to idle inside the callback nor to buffer-up in yet a buffer layer. The callback is running at interrupt priority. I.e. ReadEP() function should be run later (and at task priority). Is that possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Returning ERR_USBD_UNHANDLED in the callback. Will that hold back the host for sending new data until the present ones are read? If yes, will reading the out data using -&amp;gt;ReadEP(hUsb, USB_CDC_EP_BULK_OUT, &amp;amp;buffer) actually unblock the host (sending ACK's) when more data arrives?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, in reading the code comments with the fine looking-glass I found the following surprising information:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The RegisterEpHandler() in the ROM driver assigns a callback for users application. In the typedef for this callback the comments says among other&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/** &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; *&amp;nbsp; The application layer should define the custom class's &amp;lt;B&amp;gt;EP0&amp;lt;/B&amp;gt; handler with function signature. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why does it say EP0 (which I translate to EndPoint_Zero)? I would expect it to read simply 'EndPoint'. Is the code comment really true in which case I dont understand how the code should operate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any advice you may have&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:46:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-implement-back-pressure-Flow-control-with-ROM-driver/m-p/523768#M6404</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement back-pressure Flow control with ROM driver, RegisterEpHandler(,,,) for BULK_OUT,</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-implement-back-pressure-Flow-control-with-ROM-driver/m-p/523769#M6405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larsen on Wed Jan 02 14:47:35 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;ok I think I can answer one of my own questions: &amp;lt;B&amp;gt;Yes - returning ERR_USBD_UNHANDLED in the VCOM_bulk_out_hdlr callback will hold-back further data from the host, and subsequently reading the buffer with -&amp;gt;ReadEP(hUsb, USB_CDC_EP_BULK_OUT, &amp;amp;buffer)&amp;nbsp; in the worker thread, actually works nicely&amp;lt;/B&amp;gt;. So the callback just sets a semphore "Data ready" in the timecritical raised interrupt level code section, and the consumer thread reads: first the semaphore, then the data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As to the second part of my question about the code comments, I would like to have some comments - I think accurate documentation is important.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:46:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-implement-back-pressure-Flow-control-with-ROM-driver/m-p/523769#M6405</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:46:45Z</dc:date>
    </item>
  </channel>
</rss>

