<?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>How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example</link><description>Hi, 
 The example that I use is from here . 
 I have to use the USB interface to send and receive data between the host PC and the nRF52840 chip. 
 In the example, I can only send the data from the chip to the computer through EPIN2, but can not send</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Dec 2022 12:00:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example" /><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/400812?ContentTypeID=1</link><pubDate>Thu, 15 Dec 2022 12:00:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3be03b8c-b354-4977-860a-2a739ae3c4f6</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ning&lt;/p&gt;
[quote user="425Ning"]If reliability is not considered, is it possible to use&amp;nbsp;an&amp;nbsp;&lt;span&gt;isochronous endpoint&lt;/span&gt; to get a higher data rate than&amp;nbsp;CDC?[/quote]
&lt;p&gt;Isochronous endpoints essentially give you a guaranteed and stable data rate, but without the guarantee that all the packets are received. The main use case for this is audio or video streaming where it is&amp;nbsp;more important to keep latency low and throughput stable, rather than make sure that all the data is successfully transmitted.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Our examples only use isochronous endpoints for CD quality audio, so we haven&amp;#39;t really tried to push the data rates to the limit.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/400525?ContentTypeID=1</link><pubDate>Wed, 14 Dec 2022 08:23:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad31210d-4680-4752-9044-66737a3cfebf</guid><dc:creator>425Ning</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;&lt;/span&gt;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example/399894"]You should be able to get a higher speed if you use a different USB class, such as CDC or MSC.&amp;nbsp;[/quote]
&lt;p&gt;I&amp;#39;d used CDC and PySerial(in Python) before. But I want to transfer the data through the endpoint directly but not through the virtual COM port.&amp;nbsp;So I tried to use HID and PyUSB(in Python) to implement my project.&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example/399894"]if you use an isochronous endpoint you are not guaranteed to have all the data come through, and you would have to accept a certain amount of packet loss.&amp;nbsp;[/quote]
&lt;p&gt;If reliability is not considered, is it possible to use&amp;nbsp;an&amp;nbsp;&lt;span&gt;isochronous endpoint&lt;/span&gt; to get a higher data rate than&amp;nbsp;CDC?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Ning&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/399894?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2022 11:07:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e0c4ce3-f126-45d9-aeef-44c434ab0b9e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ning&lt;/p&gt;
&lt;p&gt;You should be able to get a higher speed if you use a different USB class, such as CDC or MSC.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We have done some testing internally to evaluate the transfer speed using these classes, and got the following results:&lt;/p&gt;
&lt;p&gt;MSC write zeros to an empty drive (Linux): 513 kB/s (4104 kbit/s)&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CDC ACM binary file transfer (Linux): 323 kB/s (2584 kbit/s)&lt;br /&gt;&lt;/span&gt;CDC ACM binary file transfer (Windows): 215 kB/s (1720 kbit/s)&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know where the 8Mbps number comes from, but keep in mind that if you use an isochronous endpoint you are not guaranteed to have all the data come through, and you would have to accept a certain amount of packet loss.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/399816?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2022 05:41:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0222d6ee-c0f8-4beb-8628-84b64df5d07f</guid><dc:creator>425Ning</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;&lt;/span&gt;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example/396661"]If you set this to 1 instead you should be able to send a packet every millisecond.[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;After I set this parameter to 1, I could get the same speed as HID full speed(64,000&amp;nbsp;&lt;strong&gt;&lt;/strong&gt;bytes per second).&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for the answer. It is helpful.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Because HID defines the (interrupt) endpoint polling rate in the endpoint descriptor, the minimum is 1 ms.&amp;nbsp;I can&amp;#39;t change the parameter to less than 1 ms to get a higher data rate.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;So I searched online to confirm if I could use this example to get a higher data rate than HID full speed.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Then I found this &lt;a title="Simple interface between USBD and PyUSB" href="https://devzone.nordicsemi.com/f/nordic-q-a/58148/simple-interface-between-usbd-and-pyusb/236454"&gt;page&lt;/a&gt;. The questioner mentioned that he read in another post in the forum said the USB examples could achieve 8,184 Mbps. (I think he means 8.184Mbps.)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1670564098766v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;Could the program that I used achieve such a high data rate?&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;Or it can be higher than HID full speed is fine. (More than 2 Mbps is better.)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What method should I use to achieve it?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Ning&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/396661?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2022 13:10:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cba75ca9-ef3d-4cc1-b27e-c648049c3d16</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ning&lt;/p&gt;
&lt;p&gt;This sounds like an issue with the bInterval setting in the endpoint descriptor, as shown &lt;a href="https://github.com/too1/nrf52-usbd-custom-hid-ep/blob/master/main.c#L231"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In my example this was set to 8, which will limit the polling interval to 8ms.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you set this to 1 instead you should be able to send a packet every millisecond.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/396519?ContentTypeID=1</link><pubDate>Sun, 20 Nov 2022 12:39:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f55f8232-18b0-4cf5-857c-cebabe67f4f8</guid><dc:creator>425Ning</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;&lt;/span&gt;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Sorry for the late reply due to some peresonal reasons.&lt;/span&gt;&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example/388908"]You shouldn&amp;#39;t need to change the USB libraries to implement this[/quote]
&lt;p&gt;&lt;span style="vertical-align:inherit;"&gt;&lt;span style="vertical-align:inherit;"&gt;OK. I got it. Thank you so much for the answer.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="vertical-align:inherit;"&gt;&lt;span style="vertical-align:inherit;"&gt;Recently I encountered a problem when testing the speed, when I transfer data through pyUSB, I could only get a 64,000 bits per second data rate, but I cannot reach the 64,000 &lt;strong&gt;bytes&lt;/strong&gt; per second data rate of HID full speed.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="vertical-align:inherit;"&gt;&lt;span style="vertical-align:inherit;"&gt;How could I get a higher data rate?&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="vertical-align:inherit;"&gt;&lt;span style="vertical-align:inherit;"&gt;Or...Will this problem improve if I use ISO EP instead? Because ISO EP can receive more bytes at one time, I think the data rate may be higher because of this reason.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Ning&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/388908?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2022 08:06:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1abed1a-8f89-4dff-9018-fac3a6d955ff</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ning&lt;/p&gt;
&lt;p&gt;What is the problem of just sending two 64 byte payloads and assembling them to a single 128 byte payload on the receiving side?&lt;/p&gt;
&lt;p&gt;You shouldn&amp;#39;t need to change the USB libraries to implement this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/388827?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 15:55:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f230998-e7c3-4380-9fd6-f73b9c60b11f</guid><dc:creator>425Ning</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example/387274"]you could create multiple alternative reports with different lengths and differentiate between them by using a report ID. This method is described &lt;a href="https://www.microchip.com/forums/m466923.aspx"&gt;here&lt;/a&gt;.[/quote]
&lt;p&gt;After reading the content of the webpage, I understood that the report ID could be used to &lt;span&gt;differentiate&lt;/span&gt; the data length when the packet size less than 64 bytes. It fits the needs I mentioned. Thank you so much!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;But I have another question: this code doesn&amp;#39;t seem to receive the data larger than 64 bytes. When the data size is larger than 64 bytes, I would like to know &lt;strong&gt;if it is possible to give more space for the data.&lt;/strong&gt; (For example, 128 bytes of data must use two 64-byte packets, &lt;strong&gt;whether HID can achieve continuous reception of two 64-byte packets, instead of discarding the following 64 bytes of data.&lt;/strong&gt;)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;If the above method could work, &lt;strong&gt;I must find the function that handles the data receiving&lt;/strong&gt;, and modify it. I think the function is &lt;strong&gt;usbd_dmareq_process()&lt;/strong&gt; which in the nrfx_usbd.c file. &lt;strong&gt;Is the understanding correct? Or the function is at another place.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The code of usbd_dmareq_process() function is below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * @brief Process all DMA requests.
 *
 * Function that have to be called from USBD interrupt handler.
 * It have to be called when all the interrupts connected with endpoints transfer
 * and DMA transfer are already handled.
 */
static void usbd_dmareq_process(void)
{
    if (!m_dma_pending)
    {
        uint32_t req;
        while (0 != (req = m_ep_dma_waiting &amp;amp; m_ep_ready))
        {
            uint8_t pos;
            if (NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST &amp;amp;&amp;amp; ((req &amp;amp; USBD_EPISO_BIT_MASK) != 0))
            {
                pos = usbd_dma_scheduler_algorithm(req &amp;amp; USBD_EPISO_BIT_MASK);
            }
            else
            {
                pos = usbd_dma_scheduler_algorithm(req);
            }
            nrfx_usbd_ep_t ep = bit2ep(pos);
            usbd_ep_state_t * p_state = ep_state_access(ep);

            nrfx_usbd_ep_transfer_t transfer;
            bool continue_transfer;

            NRFX_STATIC_ASSERT(offsetof(usbd_ep_state_t, handler.feeder) ==
                offsetof(usbd_ep_state_t, handler.consumer));
            NRFX_ASSERT((p_state-&amp;gt;handler.feeder) != NULL);

            if (NRF_USBD_EPIN_CHECK(ep))
            {
                /* Device -&amp;gt; Host */
                continue_transfer = p_state-&amp;gt;handler.feeder(
                    &amp;amp;transfer,
                    p_state-&amp;gt;p_context,
                    p_state-&amp;gt;max_packet_size);

                if (!continue_transfer)
                {
                    p_state-&amp;gt;handler.feeder = NULL;
                }
            }
            else
            {
                /* Host -&amp;gt; Device */
                const size_t rx_size = nrfx_usbd_epout_size_get(ep);
                continue_transfer = p_state-&amp;gt;handler.consumer(
                    &amp;amp;transfer,
                    p_state-&amp;gt;p_context,
                    p_state-&amp;gt;max_packet_size,
                    rx_size);
                
                if (transfer.p_data.rx == NULL)
                {
                    /* Dropping transfer - allow processing */
                    NRFX_ASSERT(transfer.size == 0);
                }
                else if (transfer.size &amp;lt; rx_size)
                {
                    NRFX_LOG_DEBUG(&amp;quot;Endpoint %x overload (r: %u, e: %u)&amp;quot;, ep, rx_size, transfer.size);
                    p_state-&amp;gt;status = NRFX_USBD_EP_OVERLOAD;
                    (void)(NRFX_ATOMIC_FETCH_AND(&amp;amp;m_ep_dma_waiting, ~(1U &amp;lt;&amp;lt; pos)));
                    NRFX_USBD_EP_TRANSFER_EVENT(evt, ep, NRFX_USBD_EP_OVERLOAD);
                    m_event_handler(&amp;amp;evt);
                    /* This endpoint will not be transmitted now, repeat the loop */
                    continue;
                }
                else
                {
                    /* Nothing to do - only check integrity if assertions are enabled */
                    NRFX_ASSERT(transfer.size == rx_size);
                }

                if (!continue_transfer)
                {
                    p_state-&amp;gt;handler.consumer = NULL;
                }
            }

            usbd_dma_pending_set();
            m_ep_ready &amp;amp;= ~(1U &amp;lt;&amp;lt; pos);
            if (NRFX_USBD_ISO_DEBUG || (!NRF_USBD_EPISO_CHECK(ep)))
            {
                NRFX_LOG_DEBUG(
                    &amp;quot;USB DMA process: Starting transfer on EP: %x, size: %u&amp;quot;,
                    ep,
                    transfer.size);
            }
            /* Update number of currently transferred bytes */
            p_state-&amp;gt;transfer_cnt += transfer.size;
            /* Start transfer to the endpoint buffer */
            nrf_usbd_ep_easydma_set(ep, transfer.p_data.addr, (uint32_t)transfer.size);

            usbd_dma_start(ep);
            /* There is a lot of USBD registers that cannot be accessed during EasyDMA transfer.
             * This is quick fix to maintain stability of the stack.
             * It cost some performance but makes stack stable. */
            while (!nrf_usbd_event_check(nrfx_usbd_ep_to_endevent(ep)) &amp;amp;&amp;amp;
                   !nrf_usbd_event_check(NRF_USBD_EVENT_USBRESET))
            {
                /* Empty */
            }

            if (NRFX_USBD_DMAREQ_PROCESS_DEBUG)
            {
                NRFX_LOG_DEBUG(&amp;quot;USB DMA process - finishing&amp;quot;);
            }
            /* Transfer started - exit the loop */
            break;
        }
    }
    else
    {
        if (NRFX_USBD_DMAREQ_PROCESS_DEBUG)
        {
            NRFX_LOG_DEBUG(&amp;quot;USB DMA process - EasyDMA busy&amp;quot;);
        }
    }
}&lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Ning&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/387274?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 11:23:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39d24cec-bf04-4ce7-a482-f2d14f0a63c0</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ning&lt;/p&gt;
&lt;p&gt;Sorry for the slow response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After digging into this a bit more I realized this is probably just a limitation of the HID stack. Essentially HID reports operate with static fields in terms of size, you can&amp;#39;t have dynamically sized fields like you can do with USB CDC or libusb for instance.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In other words you either need to pad your messages to 64 bytes, even if you don&amp;#39;t have 64 byte to send, or you could create multiple alternative reports with different lengths and differentiate between them by using a report ID. This method is described &lt;a href="https://www.microchip.com/forums/m466923.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The drawback of the report ID method is that you lose one byte of the payload to the report ID itself (the report ID is always the first byte of the HID report).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/385627?ContentTypeID=1</link><pubDate>Mon, 12 Sep 2022 05:34:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87e018a3-d751-475c-9b00-4349bc326cee</guid><dc:creator>425Ning</dc:creator><description>&lt;p style="text-align:left;"&gt;Hi Torbj&amp;oslash;rn,&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align:left;"&gt;OK. I understand. I&amp;#39;ll try my best, too. Look forward to your reply.&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Best regards,&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Ning&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/384703?ContentTypeID=1</link><pubDate>Tue, 06 Sep 2022 07:10:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3f47ffa-e844-49c2-8fe2-9a8d5c28b3c4</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ning&lt;/p&gt;
&lt;p&gt;Thanks for sharing the code.&amp;nbsp;I&amp;nbsp;will be out of office for a couple of days and won&amp;#39;t be able to look into this until Friday unfortunately, and I will do my best to get back to you then with more information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that the example you are using is not an official example, and as such is&amp;nbsp;not officially supported by us. Still, I will do my best to help once I am back in the office.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/384352?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2022 13:25:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75d47eda-b261-4723-bf21-8a6806039916</guid><dc:creator>425Ning</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example/384054"]Would you be able to share your python script with me so I can test it on my end?&amp;nbsp;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sure! This is my pyUSB code. &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pyusb_5F00_HID.py"&gt;devzone.nordicsemi.com/.../pyusb_5F00_HID.py&lt;/a&gt;&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example/384054"]Have you tried to send exactly 64 bytes to see if that works?&amp;nbsp;&lt;br /&gt;As far as I recall I only tested the example with 64 byte packets[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t try it before getting your suggestion.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thanks to your suggestion, I tried sending 64-byte packets, then it works.&lt;/strong&gt;&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/91465/how-to-transfer-data-through-epout2-in-usbd-custom-hid-ep-example/384054"]it might need some modifications to support any packet size.&amp;nbsp;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I need to modify the packet size so that the chip could receive the data from the computer&amp;nbsp;regardless of the packet size.&lt;/p&gt;
&lt;p&gt;When the chip read the char &amp;#39;\n&amp;#39;, then it has to transfer the packet through EPOUT2.&lt;/p&gt;
&lt;p&gt;But I can not find where the chip receives the packet to make the&amp;nbsp;&lt;span&gt;NRF_DRV_USBD_EVT_EPTRANSFER&lt;/span&gt; event called.&lt;/p&gt;
&lt;p&gt;So... Now I have another question: &amp;quot;&lt;strong&gt;Where should I modify the packet size in this example?&lt;/strong&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Ning&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through EPOUT2 in usbd-custom-hid-ep example</title><link>https://devzone.nordicsemi.com/thread/384054?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2022 07:45:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a968d639-46a1-4744-8f92-b2d05941053e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Would you be able to share your python script with me so I can test it on my end?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried to send exactly 64 bytes to see if that works?&amp;nbsp;&lt;br /&gt;As far as I recall I only tested the example with 64 byte packets, it might need some modifications to support any packet size.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>