<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Custom USB Device Endpoint doesn&amp;#39;t Read After first Transaction</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80041/custom-usb-device-endpoint-doesn-t-read-after-first-transaction</link><description>Hello I&amp;#39;m making a custom usb device class with 1 IN &amp;amp; OUT Bulk endpoints running on a nrf52840 with 340. The device reads the data correctly that are being sent by the host - from an OUT event- but it doesn&amp;#39;t seem to respond on later transfers. 
 There</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Oct 2021 15:54:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80041/custom-usb-device-endpoint-doesn-t-read-after-first-transaction" /><item><title>RE: Custom USB Device Endpoint doesn't Read After first Transaction</title><link>https://devzone.nordicsemi.com/thread/332688?ContentTypeID=1</link><pubDate>Tue, 05 Oct 2021 15:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ded2c829-153f-4857-bcb5-e2d356e4f90e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Try calling&amp;nbsp;app_usbd_ep_handled_transfer() at the end of your&amp;nbsp;app_usbd_antusb_read() function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom USB Device Endpoint doesn't Read After first Transaction</title><link>https://devzone.nordicsemi.com/thread/332687?ContentTypeID=1</link><pubDate>Tue, 05 Oct 2021 15:38:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d71f6a3-987a-4284-8b9f-65589380cc87</guid><dc:creator>purpl3F0x</dc:creator><description>&lt;p&gt;Yes I call&amp;nbsp;app_usbd_antusb_read but It&amp;#39;s much more simpler than the CDC ACM one&amp;#39;s.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code_t app_usbd_antusb_read(app_usbd_antusb_t const *     p_antusb,
                                  ANT_MESSAGE * const         p_antmsg)
{
    ASSERT(p_antusb != NULL);
    ASSERT(p_antmsg != NULL);

    ret_code_t ret = NRF_SUCCESS;

    app_usbd_antusb_ctx_t * p_antusb_ctx = antusb_ctx_get(p_antusb);
    const uint8_t* rx_buf = p_antusb_ctx-&amp;gt;rx_buf;
    const uint8_t rx_size =  p_antusb_ctx-&amp;gt;rx_buf_size;

    NRF_LOG_INFO(&amp;quot;Reading Buffer: (%i)&amp;quot;, rx_size);
    NRF_LOG_HEXDUMP_INFO(p_antusb_ctx-&amp;gt;rx_buf, rx_size);

    if (rx_buf[0] != MESG_TX_SYNC)
    {
        NRF_LOG_ERROR(&amp;quot;Rx buffer doesn&amp;#39;t start with sync&amp;quot;);
        return NRF_ERROR_INTERNAL;
    }
    
    const unsigned total_mesglen = rx_buf[1] + MESG_SYNC_SIZE + MESG_SIZE_SIZE + MESG_ID_SIZE;
    const uint8_t checksum = rx_buf[total_mesglen];
    

    memcpy(p_antmsg-&amp;gt;aucMessage, rx_buf + 1,  total_mesglen - 1);

    return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom USB Device Endpoint doesn't Read After first Transaction</title><link>https://devzone.nordicsemi.com/thread/332686?ContentTypeID=1</link><pubDate>Tue, 05 Oct 2021 15:25:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7e46a4c-b47c-4e89-8bda-8493335d67ae</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;I assume this somewhat similar to CDC ACM? What are you doing in the user_event handler? Are you calling a function similar to&amp;nbsp;app_usbd_cdc_acm_read() ? (that again calls app_usbd_ep_handled_transfer())&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom USB Device Endpoint doesn't Read After first Transaction</title><link>https://devzone.nordicsemi.com/thread/332189?ContentTypeID=1</link><pubDate>Fri, 01 Oct 2021 16:08:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:015b3fdd-db74-4689-8646-a6bd6d089575</guid><dc:creator>purpl3F0x</dc:creator><description>&lt;p&gt;@Sigurd&amp;nbsp;any clue ? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom USB Device Endpoint doesn't Read After first Transaction</title><link>https://devzone.nordicsemi.com/thread/331378?ContentTypeID=1</link><pubDate>Mon, 27 Sep 2021 16:59:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c86afad4-d5e7-4ac6-a40f-f32a8102cc4e</guid><dc:creator>purpl3F0x</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Sigurd, doesn&amp;#39;t seem to be the case. I only see 2 calls on&amp;nbsp;&lt;span&gt;antusb_endpoint_ev one for&amp;nbsp;NRF_USBD_EP_WAITING and one for&amp;nbsp;NRF_USBD_EP_OK. I also tried removing the call to `user_event_handler` in case it that was causing the issue&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom USB Device Endpoint doesn't Read After first Transaction</title><link>https://devzone.nordicsemi.com/thread/331371?ContentTypeID=1</link><pubDate>Mon, 27 Sep 2021 15:43:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:056412c9-9168-4a66-9577-8f46b1985bd8</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]The device reads the data correctly that are being sent by the host - from an OUT event- but it doesn&amp;#39;t seem to respond on later transfers.[/quote]
&lt;p&gt;Does it enter&amp;nbsp;antusb_endpoint_ev() on the later transfers?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>