<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=1172125" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/yegorich">@yegorich</a> , I gave it a try but it didn't work! I know that I need to invert RX for my scenario so I added the following code (at the very end before you enable uart):</p>
<pre><code>MODIFY_REG(dev(uart)->CR2, USART_CR2_RXINV_Msk, USART_CR2_RXINV);
</code></pre>
<p>but this didn't help!</p>
<p>I'll look bit more tomorrow, in case its something with my environment.</p>
<p>Here is how I initialize (working case):</p>
<pre><code>uart_init_ex(uart, baudrate, UartReceiveCallback, this, false);
uart_configure(uart, UART_9BITS, UART_PARITY_EVEN, UART_STOPBITS_TWO, UART_RX_INVERT);
uart_enable(uart);
</code></pre>
<p>Here is with new uart_mode (not working case):</p>
<pre><code>uart_init(uart, baudrate, UartReceiveCallback, this);
uart_mode(uart, UART_DATABITS_8, UART_PARITY_EVEN, UART_STOPBITS_2);
</code></pre>
<p>Couple notes on implementation:</p>
<ul>
<li>I'm not an expert in this, but not a fan of starting up device, stopping it to configure, then starting it again.</li>
<li>Not sure why we have UART_DATABITS_9 if we are setting this internally (code could use some comment around this as it's not intuitive)</li>
</ul>

<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/10743#issuecomment-456260016">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AEn7YBACsAlNxc8sOkKW93xoOLXKSaNHks5vFoaJgaJpZM4Z5HDD">mute the thread</a>.<img src="https://github.com/notifications/beacon/AEn7YJ6ZhsO2G3oPgmEspulmHiAeBHbRks5vFoaJgaJpZM4Z5HDD.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/RIOT-OS/RIOT","title":"RIOT-OS/RIOT","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/RIOT-OS/RIOT"}},"updates":{"snippets":[{"icon":"PERSON","message":"@bluephoton in #10743: @yegorich , I gave it a try but it didn't work! I know that I need to invert RX for my scenario so I added the following code (at the very end before you enable uart):\r\n```\r\nMODIFY_REG(dev(uart)-\u003eCR2, USART_CR2_RXINV_Msk, USART_CR2_RXINV);\r\n```\r\nbut this didn't help!\r\n\r\nI'll look bit more tomorrow, in case its something with my environment.\r\n\r\nHere is how I initialize (working case):\r\n```\r\nuart_init_ex(uart, baudrate, UartReceiveCallback, this, false);\r\nuart_configure(uart, UART_9BITS, UART_PARITY_EVEN, UART_STOPBITS_TWO, UART_RX_INVERT);\r\nuart_enable(uart);\r\n```\r\n\r\nHere is with new uart_mode (not working case):\r\n```\r\nuart_init(uart, baudrate, UartReceiveCallback, this);\r\nuart_mode(uart, UART_DATABITS_8, UART_PARITY_EVEN, UART_STOPBITS_2);\r\n```\r\n\r\nCouple notes on implementation:\r\n- I'm not an expert in this, but not a fan of starting up device, stopping it to configure, then starting it again.\r\n- Not sure why we have UART_DATABITS_9 if we are setting this internally (code could use some comment around this as it's not intuitive)\r\n"}],"action":{"name":"View Pull Request","url":"https://github.com/RIOT-OS/RIOT/pull/10743#issuecomment-456260016"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/10743#issuecomment-456260016",
"url": "https://github.com/RIOT-OS/RIOT/pull/10743#issuecomment-456260016",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>