<?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>USBD EPIN AMOUNT and MAXCNT values different</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36845/usbd-epin-amount-and-maxcnt-values-different</link><description>Hi, 
 I&amp;#39;m working on treating the nrf as a CDC ACM device and in order to test it I&amp;#39;ve been using a script to send input to the chip through echo commands to the /dev/ttyACM. 
 I find that if I don&amp;#39;t set a delay on the commands, it&amp;#39;ll run through several</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Aug 2018 07:42:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36845/usbd-epin-amount-and-maxcnt-values-different" /><item><title>RE: USBD EPIN AMOUNT and MAXCNT values different</title><link>https://devzone.nordicsemi.com/thread/142741?ContentTypeID=1</link><pubDate>Fri, 03 Aug 2018 07:42:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8a59c56-449b-4dad-bd9d-25a7e8dc0962</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I do not think you should rely on the nrf_log interface to print out every byte, as nrf_log with UART as the backend is slower than the USB.&lt;/p&gt;
&lt;p&gt;Instead, do something like this pseudo code and peek at the variables while in debug mode:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// You may need extra logic to handle the initial state of this variable
static uint8_t last_byte;

static uint32_t num_of_failures;
static uint32_t num_of_success;
// Assume receiving iterative data
if (received_usb_data[0] != (last_byte + 1))
{
  num_of_failure++;
}
else
{
  num_of_success++;
}
last_byte = received_usb_data[0];&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD EPIN AMOUNT and MAXCNT values different</title><link>https://devzone.nordicsemi.com/thread/142690?ContentTypeID=1</link><pubDate>Thu, 02 Aug 2018 16:59:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d39c8dc6-0559-48d1-bf65-452cd7f21637</guid><dc:creator>ryan_g</dc:creator><description>&lt;p&gt;By data pattern I&amp;#39;m assuming you&amp;#39;re talking about the output to the console. It looks like data is being dropped. It&amp;#39;ll print out the first few inputs or so and then it will get stuck with this set of messages&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: Bytes waiting: 3
Logs dropped (3)
&amp;lt;info&amp;gt; app: RX: size: 1 char: 7
Logs dropped (1)
&amp;lt;info&amp;gt; app: RX: size: 1 char: 0
Logs dropped (4)
&amp;lt;info&amp;gt; app: RX: size: 1 char: 8
Logs dropped (2)
&amp;lt;info&amp;gt; app: RX: size: 1 char: 
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I stop the input script, it doesn&amp;#39;t end up displaying the rest of the expected input that was sent over.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD EPIN AMOUNT and MAXCNT values different</title><link>https://devzone.nordicsemi.com/thread/142586?ContentTypeID=1</link><pubDate>Thu, 02 Aug 2018 11:24:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3dca460-9ba4-4e1c-8915-920481f29d0a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;Logs Dropped (x)&amp;quot; means that the logger interface is generating too much logging compared to what it can send out (thus flushes x messages), it does not mean that the USB data will be dropped.&lt;/p&gt;
&lt;p&gt;Did you check the data pattern to see if any USB data was dropped?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD EPIN AMOUNT and MAXCNT values different</title><link>https://devzone.nordicsemi.com/thread/142252?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 17:05:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c896650-6617-4c59-8572-7929a65354c6</guid><dc:creator>ryan_g</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not using any of the libraries or drivers from the SDK in my project as it had to be custom made for the system I&amp;#39;m working on. I tried to replicate the issue with the usbd_cdc example and I&amp;#39;ll get a message &amp;#39;Logs Dropped (1)&amp;#39; which seems like it&amp;#39;s losing some input values if it&amp;#39;s taking in inputs too fast.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t get the same hang that I do in my implementation so I guess I can snoop around what causes that error and how it&amp;#39;s handled.&lt;/p&gt;
&lt;p&gt;I would have assumed that there would have been locks in place to allow the input buffer to fully be consumed before the next input though.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD EPIN AMOUNT and MAXCNT values different</title><link>https://devzone.nordicsemi.com/thread/142147?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 11:57:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:facfbf97-c472-46e9-a108-f84f4b937cdf</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you not using any libraries or drivers from the SDK at all?&lt;/p&gt;
&lt;p&gt;Have you tried replicating this with the usbd_cdc example in the SDK, with the former mentioned fix present, to see if it behaves similar?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD EPIN AMOUNT and MAXCNT values different</title><link>https://devzone.nordicsemi.com/thread/142014?ContentTypeID=1</link><pubDate>Mon, 30 Jul 2018 20:21:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e565435-0000-4419-9702-d08f76a6663b</guid><dc:creator>ryan_g</dc:creator><description>&lt;p&gt;Hi Hakon I&amp;#39;m using revision C. I should have specified that I am not using the SDK for my testing. &lt;span class="user-name"&gt;&lt;/span&gt;&lt;span class="user-name"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I do not have that workaround in my code as I&amp;#39;m not using the errata calls (nor the nordic usb stack although the general structure is mimicked). I do have necessary workarounds applied in my code such as Errata 166 and 187.&lt;/p&gt;
&lt;p&gt;I forgot to mention that is issue only comes up on inputs that are coming in quickly via a script. Right now I have to have a 1ms delay between each input to have it working consistently, any faster and the OUT endpoint will not fire EPDATA event anymore.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD EPIN AMOUNT and MAXCNT values different</title><link>https://devzone.nordicsemi.com/thread/141909?ContentTypeID=1</link><pubDate>Mon, 30 Jul 2018 12:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38a16f9c-d43a-4064-a7ec-160a4ce38fc7</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q1: Which revision of the nRF52840 are you using? Note that workarounds for older engineering revisions have been removed from SDK v15, and we recommend using the latest production release of the silicon for development.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q2: If you are using the latest revision (engineering C or Rev 1), we have an issue with our current SDK, where the erratas is not properly applied.&lt;/p&gt;
&lt;p&gt;Do you have this workaround in your code-base?&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34605/usb-not-enumerating-after-reset/133051#133051"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/34605/usb-not-enumerating-after-reset/133051#133051&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>