<?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>Too early EPDATA interrupt during an USB data transfer IN transaction with DMA</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97728/too-early-epdata-interrupt-during-an-usb-data-transfer-in-transaction-with-dma</link><description>I am investigating a strange issue I have and it seems it&amp;#39;s more present when softdevice is enabled, but maybe it&amp;#39;s just a coincidence 
 I have a working design in place that is using dma transfer to send data to host using IN transaction and generally</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Mar 2023 12:33:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97728/too-early-epdata-interrupt-during-an-usb-data-transfer-in-transaction-with-dma" /><item><title>RE: Too early EPDATA interrupt during an USB data transfer IN transaction with DMA</title><link>https://devzone.nordicsemi.com/thread/415999?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 12:33:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7be5310-c944-4a64-938b-ca016d3397a1</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="DaviT"]I am using softdevice 6.1.1 S140 version.[/quote]
&lt;p&gt;nRF5 SDK v15.3.0?&lt;/p&gt;
[quote user="DaviT"]&lt;p&gt;I verified all the easydma programming sequences in the past (when it s working OK) and compared to failing case, I don&amp;#39;t see anything weird and it seems the easydma transfer is done because the AMOUNT register in EPIN[2] section is = MAXCNT value. PTR register is positioned on the data to be sent.&lt;/p&gt;
&lt;p&gt;I checked doing a Wireshark trace in parallel and I can see that the easydma data is NOT seen on host side but all previous ones are.&lt;/p&gt;[/quote]
&lt;p&gt;Could you share the log?&lt;/p&gt;
[quote user="DaviT"]I am lucky I have a lauterbach trace box to make accurate trace of PC counter and I am seeing that in failing case I have the SWI2_EGU2_IRQHandler occuring just before the STARTED event USBD IRQ handler, I dont know if it could generate problems but I am observing this difference here.[/quote]
&lt;p&gt;SWI2 is the SoftDevice handler for the application side.&lt;/p&gt;
&lt;p&gt;What is the IRQ priority for the USBD interrupt? this is in your sdk_config.h::NRFX_USBD_CONFIG_IRQ_PRIORITY&lt;/p&gt;
&lt;p&gt;Have you tried to change this to a higher priority?&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the levels available for the application when running S140:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s140%2FSDS%2Fs1xx%2Fprocessor_avail_interrupt_latency%2Fexception_mgmt_sd.html&amp;amp;cp=5_7_4_0_15_1"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s140%2FSDS%2Fs1xx%2Fprocessor_avail_interrupt_latency%2Fexception_mgmt_sd.html&amp;amp;cp=5_7_4_0_15_1&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><item><title>RE: Too early EPDATA interrupt during an USB data transfer IN transaction with DMA</title><link>https://devzone.nordicsemi.com/thread/415640?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2023 09:50:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e8ef7ad-e297-49b9-94d7-dbf480b48ef0</guid><dc:creator>DaviT</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am using softdevice 6.1.1 S140 version.&lt;/p&gt;
&lt;p&gt;I verified all the easydma programming sequences in the past (when it s working OK) and compared to failing case, I don&amp;#39;t see anything weird and it seems the easydma transfer is done because the AMOUNT register in EPIN[2] section is = MAXCNT value. PTR register is positioned on the data to be sent.&lt;/p&gt;
&lt;p&gt;I checked doing a Wireshark trace in parallel and I can see that the easydma data is NOT seen on host side but all previous ones are.&lt;/p&gt;
&lt;p&gt;I am lucky I have a lauterbach trace box to make accurate trace of PC counter and I am seeing that in failing case I have the SWI2_EGU2_IRQHandler occuring just before the STARTED event USBD IRQ handler, I dont know if it could generate problems but I am observing this difference here.&lt;/p&gt;
&lt;p&gt;In the same USBD IRQ handler I see the STARTED and EPDATA events raised at same time when entering in interrupt code. Then I get the USBD ENDEPIN interrupt some 10/20us later. The SWI2 EGU2 interrupt occured due to BLE events (I am doing scan of advertising devices in parallel of USB transfers).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Is there some care to be done between USBD programming and BLE events or shall it work without side effects ?&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Too early EPDATA interrupt during an USB data transfer IN transaction with DMA</title><link>https://devzone.nordicsemi.com/thread/415490?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2023 13:54:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c58be52-7469-403d-b4f9-10f69ec958c1</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;Hard to say without seeing a bit more context about what is running; however:&lt;/p&gt;
&lt;p&gt;Could it be that a higher priority interrupt is occurring, which makes both events to be triggered almost simultaneously in the application space?&lt;/p&gt;
&lt;p&gt;What SDK version are you using?&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>