<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/9881">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sniffing: decrease USB IRQ prioprity to prevent USART overrun<br><br>Handling the USB message queue is done in an ISR and take quite some time.<br>This can cause a USART/SIM sniffing buffer overrun, resulting in data loss.<br>By setting the USB IRQ lower than the USART IRQ, the USB ISR can be<br>interrupted (for short) and no data gets lost.<br><br>Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486<br>---<br>M firmware/libcommon/source/sniffer.c<br>1 file changed, 4 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c</span><br><span>index 1b6d5e7..2a7ae5f 100644</span><br><span>--- a/firmware/libcommon/source/sniffer.c</span><br><span>+++ b/firmware/libcommon/source/sniffer.c</span><br><span>@@ -829,6 +829,10 @@</span><br><span>  sniff_usart.base->US_RTOR = 9600-12; /* -12 because the timer starts at the end of the 12 ETU frame */</span><br><span>    /* Enable interrupt to indicate when data has been received or timeout occurred */</span><br><span>   USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT);</span><br><span style="color: hsl(120, 100%, 40%);">+      /* Set USB priority lower than USART to not miss sniffing data (both at 0 per default) */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (NVIC_GetPriority(IRQ_USART_SIM)>=NVIC_GetPriority(UDP_IRQn)) {</span><br><span style="color: hsl(120, 100%, 40%);">+         NVIC_SetPriority(UDP_IRQn, NVIC_GetPriority(IRQ_USART_SIM)+2);</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span>    /* Enable interrupt requests for the USART peripheral */</span><br><span>     NVIC_EnableIRQ(IRQ_USART_SIM);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9881">change 9881</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/9881"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 </div>
<div style="display:none"> Gerrit-Change-Number: 9881 </div>
<div style="display:none"> Gerrit-PatchSet: 15 </div>
<div style="display:none"> Gerrit-Owner: Kévin Redon <kredon@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>