<blockquote>
<p>(I believe they are the problem with volatile)</p>
</blockquote>
<p>I was able to deny by claim with the following patch:</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-c1">diff --git a/sys/include/tsrb.h b/sys/include/tsrb.h</span>
index 6dea0eca3..392c746b5 100644
<span class="pl-md">--- a/sys/include/tsrb.h</span>
<span class="pl-mi1">+++ b/sys/include/tsrb.h</span>
<span class="pl-mdr">@@ -30,6 +30,8 @@</span>
 #include <stddef.h>
 #include <stdint.h>
 
<span class="pl-mi1"><span class="pl-mi1">+</span>#include "irq.h"</span>
<span class="pl-mi1"><span class="pl-mi1">+</span></span>
 #ifdef __cplusplus
 extern "C" {
 #endif
<span class="pl-mdr">@@ -76,7 +78,11 @@</span> static inline void tsrb_init(tsrb_t *rb, void *buffer, unsigned bufsize)
  */
 static inline int tsrb_empty(const tsrb_t *rb)
 {
<span class="pl-md"><span class="pl-md">-</span>    return (rb->reads == rb->writes);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    int res;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned state = irq_disable();</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    res = (rb->reads == rb->writes);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    irq_restore(state);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    return res;</span>
 }
 
 
<span class="pl-mdr">@@ -87,7 +93,11 @@</span> static inline int tsrb_empty(const tsrb_t *rb)
  */
 static inline unsigned int tsrb_avail(const tsrb_t *rb)
 {
<span class="pl-md"><span class="pl-md">-</span>    return (rb->writes - rb->reads);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned int res;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned state = irq_disable();</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    res = (rb->writes - rb->reads);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    irq_restore(state);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    return res;</span>
 }
 
 /**
<span class="pl-mdr">@@ -98,7 +108,11 @@</span> static inline unsigned int tsrb_avail(const tsrb_t *rb)
  */
 static inline int tsrb_full(const tsrb_t *rb)
 {
<span class="pl-md"><span class="pl-md">-</span>    return (rb->writes - rb->reads) == rb->size;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    int res;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned state = irq_disable();</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    res = (rb->writes - rb->reads) == rb->size;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    irq_restore(state);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    return res;</span>
 }
 
 /**
<span class="pl-mdr">@@ -108,7 +122,11 @@</span> static inline int tsrb_full(const tsrb_t *rb)
  */
<span class="pl-mi1"><span class="pl-mi1">+</span>    int res;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned state = irq_disable();</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    res = (rb->reads == rb->writes);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    irq_restore(state);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    return res;</span>
 }
 
 
<span class="pl-mdr">@@ -87,7 +93,11 @@</span> static inline int tsrb_empty(const tsrb_t *rb)
  */
 static inline unsigned int tsrb_avail(const tsrb_t *rb)
 {
<span class="pl-md"><span class="pl-md">-</span>    return (rb->writes - rb->reads);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned int res;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned state = irq_disable();</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    res = (rb->writes - rb->reads);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    irq_restore(state);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    return res;</span>
 }
 
 /**
<span class="pl-mdr">@@ -98,7 +108,11 @@</span> static inline unsigned int tsrb_avail(const tsrb_t *rb)
  */
 static inline int tsrb_full(const tsrb_t *rb)
 {
<span class="pl-md"><span class="pl-md">-</span>    return (rb->writes - rb->reads) == rb->size;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    int res;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned state = irq_disable();</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    res = (rb->writes - rb->reads) == rb->size;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    irq_restore(state);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    return res;</span>
 }
 
 /**
<span class="pl-mdr">@@ -108,7 +122,11 @@</span> static inline int tsrb_full(const tsrb_t *rb)
  */
 static inline unsigned int tsrb_free(const tsrb_t *rb)
 {
<span class="pl-md"><span class="pl-md">-</span>    return (rb->size - rb->writes + rb->reads);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned int res;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    unsigned state = irq_disable();</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    res = (rb->size - rb->writes + rb->reads);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    irq_restore(state);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    return res;</span>
 }
 
 /**</pre></div>
<p>Still not working. Will try your proposal.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11634?email_source=notifications&email_token=ABE7WYBKWTABZBX32NB7PL3PY65F7A5CNFSM4HTU3XKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW7WEZI#issuecomment-499081829">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYFW4CSNZXB6QK5VMHDPY65F7ANCNFSM4HTU3XKA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYAJJXYQCWBI7URN4SLPY65F7A5CNFSM4HTU3XKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW7WEZI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11634?email_source=notifications\u0026email_token=ABE7WYBKWTABZBX32NB7PL3PY65F7A5CNFSM4HTU3XKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW7WEZI#issuecomment-499081829",
"url": "https://github.com/RIOT-OS/RIOT/pull/11634?email_source=notifications\u0026email_token=ABE7WYBKWTABZBX32NB7PL3PY65F7A5CNFSM4HTU3XKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW7WEZI#issuecomment-499081829",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>