<?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_STATUS_CANCELED</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93199/usbd_status_canceled</link><description>Hi there, 
 as already mentioned in other tickets I&amp;#39;m developing a usb to uart bridge based on the nrf52820. The nRF5 SDK version I&amp;#39;m using is 17.1.0. 
 Right now I&amp;#39;m facing an error on the usb side. 
 A bit of a context: When connected, one of our test</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Nov 2022 16:52:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93199/usbd_status_canceled" /><item><title>RE: USBD_STATUS_CANCELED</title><link>https://devzone.nordicsemi.com/thread/394521?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 16:52:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83f3f1ad-935b-4f68-b0c7-7952a29ca446</guid><dc:creator>JoEi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I finally found a solution to my problem.&lt;/span&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/93199/usbd_status_canceled/393874"]This is set to &amp;#39;1&amp;#39; by default, and when sending binary data, it could be beneficial to have this set to &amp;#39;0&amp;#39;.[/quote]
&lt;p&gt;In my case it was exactly the other way round.&lt;/p&gt;
&lt;p&gt;Additionally I had to change the way I&amp;#39;m processing the UART data.&lt;br /&gt;Bit of a context:&lt;br /&gt;The UART message has a header so that the bridge knows how the message is encoded and on which USB interface the data must be sent or if is a control message for the bridge itself.&lt;/p&gt;
&lt;p&gt;Till now my UART_RxProcess function just took one byte at a time.&lt;br /&gt;After analysing the header the data get&amp;#39;s written into a buffer. When the buffer is full the data get&amp;#39;s put into my TX FIFO.&lt;br /&gt;&lt;span&gt;Additionally a timer was started that would put the data of the buffer into the FIFO if the buffer wasn&amp;#39;t completely filled and for 10ms no data was received.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now I&amp;#39;ve moved the loop from&amp;nbsp;&lt;/span&gt;uart_event_sched_handler into UART_RxProcess. Before returning from UART_RxProcess I&amp;#39;m putting the buffer into the FIFO so that I&amp;#39;m able to get rid of the timer.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;Johannes&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD_STATUS_CANCELED</title><link>https://devzone.nordicsemi.com/thread/393874?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 12:55:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf69e3f3-2bbf-42fd-8051-327c87dc9840</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;Sorry, my former suggestion was the wrong config setting.&lt;br /&gt;It should be sdk_config.h::APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE, not the USBD_CONFIG_ISO_IN_ZLP.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is set to &amp;#39;1&amp;#39; by default, and when sending binary data, it could be beneficial to have this set to &amp;#39;0&amp;#39;.&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_STATUS_CANCELED</title><link>https://devzone.nordicsemi.com/thread/393738?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 16:50:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7496188b-8bd8-4ae0-8240-c8d83bd79daf</guid><dc:creator>JoEi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m using a usbd class I specifically developed for our product and not the cdc_acm class. It has 2 bulk interfaces, one for debugging messages and one for control messages and file transfer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So far I&amp;#39;ve seen it on 3-4 different PCs.&lt;br /&gt;&lt;/span&gt;&lt;span&gt;I&amp;#39;ve seen this issue when working with our dev studio and it&amp;#39;s testbed.&lt;br /&gt;When being connected to the testbed every second some status information is retrieved from the device.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;ve added some debug messages before calling my usb_send function to get the amount of data I&amp;#39;m trying to transmit. I&amp;#39;ve noticed that the error happens when the length of the last chunk of data I&amp;#39;m trying to transmit is a multiple of 64.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Johannes&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD_STATUS_CANCELED</title><link>https://devzone.nordicsemi.com/thread/393698?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 14:27:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29dc99cf-2b02-425b-ac0f-c8569eeb7a5d</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;
[quote user="Johannes"]I&amp;#39;m wondering why the missing data get&amp;#39;s &amp;quot;received&amp;quot; when the program closes the connection to the device. Is there some sort of flush being performed?[/quote]
&lt;p&gt;USB is, like most other transports, driven by a host. If the host stops polling the device, incoming data stream also stops.&lt;/p&gt;
&lt;p&gt;Not saying that this happens here, but it might be a possibility.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Johannes"]&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;What happens if I try to send more than 64 byte at once and when will I receive TX finished in this case?&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;On the bus itself, it will be split up into 64 byte chunks.&lt;/p&gt;
&lt;p&gt;If you continuously send a size that is equal to the EP side, it might be beneficial to look at sdk_config.h::USBD_CONFIG_ISO_IN_ZLP.&lt;/p&gt;
&lt;p&gt;Also, what terminal are you using when you&amp;#39;re seeing this issue? Is it present on all computers, with different terminal programs?&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_STATUS_CANCELED</title><link>https://devzone.nordicsemi.com/thread/393643?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 12:32:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:898ff5b6-fa2b-40a4-96a1-7076cad2da3b</guid><dc:creator>JoEi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;sorry for the late reply I&amp;#39;ve been on vacation the last few days.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/93199/usbd_status_canceled/392628"]Did you set sdk_config.h:NRFX_USBD_CONFIG_LOG_ENABLED in addition to sdk_config.h:NRF_LOG_ENABLED?[/quote]
&lt;p&gt;Yes I did.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m wondering why the missing data get&amp;#39;s &amp;quot;received&amp;quot; when the program closes the connection to the device. Is there some sort of flush being performed?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;What happens if I try to send more than 64 byte at once and when will I receive TX finished in this case?&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;Johannes&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD_STATUS_CANCELED</title><link>https://devzone.nordicsemi.com/thread/392628?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 12:56:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7a07963-0ce2-473c-8710-a41c5449d468</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Johannes,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Schematic looks good.&lt;/p&gt;
&lt;p&gt;The sniffer trace unfortunately is on a OS level, and does not show much other than the communication stops on EP1 (ie. your data EP)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Johannes"]&lt;p&gt;&lt;span&gt;Sadly no. I&amp;#39;ve tried activating the logs in all USB modules but nothing happened.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Did you set sdk_config.h:NRFX_USBD_CONFIG_LOG_ENABLED in addition to sdk_config.h:NRF_LOG_ENABLED?&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_STATUS_CANCELED</title><link>https://devzone.nordicsemi.com/thread/392403?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 13:13:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:208424e4-6bac-475f-a6b2-ecfd727d3391</guid><dc:creator>JoEi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A1: Yeah sure. The interface in question is interface number 1.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/failed_5F00_communication_5F002D005F00_USBD_5F00_STATUS_5F00_CANCELED.pcapng"&gt;devzone.nordicsemi.com/.../failed_5F00_communication_5F002D005F00_USBD_5F00_STATUS_5F00_CANCELED.pcapng&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A2: Sadly no. I&amp;#39;ve tried activating the logs in all USB modules but nothing happened.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A3: The only thing between the usb port and the nRF D+/D- pins is a&amp;nbsp;USBLC6-2SC6 diode.&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/usb_5F00_connector.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;Johannes&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD_STATUS_CANCELED</title><link>https://devzone.nordicsemi.com/thread/392374?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 12:08:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d39dea2-a8ed-42c4-a5f4-80137f5ab91f</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: Could you share the .pcapng?&lt;/p&gt;
[quote user=""]Right now I&amp;#39;m facing the problem that after some time (20 seconds up to 10 minutes) one answer&amp;nbsp;isn&amp;#39;t completely received.&lt;br /&gt;Most of the time the answer get&amp;#39;s split into 2 parts (according to wireshark). The first part is always received. When the error happens the second&amp;nbsp;part&amp;nbsp;only gets transmitted when the connection get&amp;#39;s closed. When this happens the IRP USB_STATE is USBD_STATUS_CANCELED (0xc0010000).[/quote]
&lt;p&gt;Q2: any logs from the nRF side that could hint at what is happening?&lt;/p&gt;
&lt;p&gt;Q3: How does your schematic look wrt. D+/D- routing? There should not be any series-resistors on these lines (as a side-note: but we do recommend to use ESD protection diodes).&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>