<?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>Async UART and shell module in Zephyr on  nRF52480</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86789/async-uart-and-shell-module-in-zephyr-on-nrf52480</link><description>I have shell working with the following configuration 
 
 CONFIG_SHELL =y 
 CONFIG_SHELL_BACKENDS =y 
 CONFIG_SHELL_BACKEND_SERIAL =y #also selects serial 
 CONFIG_SHELL_CMDS =y 
 CONFIG_SHELL_ECHO_STATUS =y 
 
 Now I need to add async UART to send some</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Sep 2022 17:54:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86789/async-uart-and-shell-module-in-zephyr-on-nrf52480" /><item><title>RE: Async UART and shell module in Zephyr on  nRF52480</title><link>https://devzone.nordicsemi.com/thread/387992?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 17:54:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93949062-6897-45d5-b778-228f0ae9652b</guid><dc:creator>Stew</dc:creator><description>&lt;p&gt;As requested by Nordic support, I reposted my query in this new thread: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/92325/use-shell-over-uart-and-uart-async-api-on-nrf52840"&gt;Use Shell over UART and UART ASYNC API on nRF52840&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART and shell module in Zephyr on  nRF52480</title><link>https://devzone.nordicsemi.com/thread/387350?ContentTypeID=1</link><pubDate>Wed, 21 Sep 2022 16:01:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:546d4f36-36b2-4f78-a2db-d814b2688e77</guid><dc:creator>Stew</dc:creator><description>&lt;p&gt;AndyM, I&amp;#39;m glad that you were able to find an answer to your 2nd question (how to&amp;nbsp;&lt;span&gt;send data asynchronously over UART from a thread other than the shell&lt;/span&gt;), but did you get the 1st (original) question answered?&lt;/p&gt;
&lt;p&gt;...is it possible to enable async UART support and the shell module in the same project?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to use the shell on uart0 and the UART async API on uart1, but I&amp;#39;m beginning to think that these features are mutually exclusive.&lt;/p&gt;
&lt;p&gt;When I enable UART async API support with these settings (in prj.conf),&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I see these settings being applied to the project as a whole (in .config):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Serial Drivers
#
CONFIG_UART_NRFX=y
CONFIG_UART_ASYNC_TX_CACHE_SIZE=8
CONFIG_UART_0_NRF_UARTE=y
CONFIG_UART_0_ENHANCED_POLL_OUT=y
CONFIG_UART_0_ASYNC=y # &amp;lt;======================================
# CONFIG_UART_0_NRF_PARITY_BIT is not set
CONFIG_UART_0_NRF_TX_BUFFER_SIZE=32
# CONFIG_UART_0_NRF_HW_ASYNC is not set
# CONFIG_UART_0_NRF_ASYNC_LOW_POWER is not set
CONFIG_UART_1_NRF_UARTE=y
CONFIG_UART_1_ASYNC=y # &amp;lt;======================================
CONFIG_UART_1_ENHANCED_POLL_OUT=y
# CONFIG_UART_1_NRF_PARITY_BIT is not set
# CONFIG_UART_1_NRF_HW_ASYNC is not set
# CONFIG_UART_1_NRF_ASYNC_LOW_POWER is not set
CONFIG_UART_ENHANCED_POLL_OUT=y
CONFIG_NRF_UARTE_PERIPHERAL=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note the &amp;quot;&lt;span&gt;CONFIG_UART_0_ASYNC=y&lt;/span&gt;&amp;quot; and &amp;quot;&lt;span&gt;CONFIG_UART_1_ASYNC=y&lt;/span&gt;&amp;quot; settings.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However, when I add shell module support with these settings (in prj.conf),&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
CONFIG_SHELL=y # &amp;lt;======================================&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I see these settings being applied to the project as a whole (in .config):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Serial Drivers
#
CONFIG_UART_NRFX=y
CONFIG_UART_ASYNC_TX_CACHE_SIZE=8
CONFIG_UART_0_NRF_UARTE=y
CONFIG_UART_0_ENHANCED_POLL_OUT=y
CONFIG_UART_0_INTERRUPT_DRIVEN=y # &amp;lt;======================================
# CONFIG_UART_0_NRF_PARITY_BIT is not set
CONFIG_UART_0_NRF_TX_BUFFER_SIZE=32
# CONFIG_UART_0_NRF_HW_ASYNC is not set
# CONFIG_UART_0_NRF_ASYNC_LOW_POWER is not set
CONFIG_UART_1_NRF_UARTE=y
CONFIG_UART_1_INTERRUPT_DRIVEN=y # &amp;lt;======================================
CONFIG_UART_1_ENHANCED_POLL_OUT=y
# CONFIG_UART_1_NRF_PARITY_BIT is not set
CONFIG_UART_1_NRF_TX_BUFFER_SIZE=32
# CONFIG_UART_1_NRF_ASYNC_LOW_POWER is not set
CONFIG_UART_ENHANCED_POLL_OUT=y
CONFIG_NRF_UARTE_PERIPHERAL=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note the &amp;quot;&lt;span&gt;CONFIG_UART_0_INTERRUPT_DRIVEN&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&amp;quot; and &amp;quot;&lt;span&gt;CONFIG_UART_1_INTERRUPT_DRIVEN&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&amp;quot; settings.&lt;/p&gt;
&lt;p&gt;With this project change, the async API function &amp;quot;uart_callback_set&amp;quot; now errors out because the define &amp;quot;UARTE_INTERRUPT_DRIVEN&amp;quot; is now defined instead of &amp;quot;UARTE_ANY_ASYNC&amp;quot; in uart_nrfx_uarte.c, line 1771 (SDK v2.1.0) since the struct element &amp;quot;.callback_set&amp;quot; no longer exists.&lt;/p&gt;
&lt;p&gt;Is there a way to have &amp;quot;&lt;span&gt;CONFIG_UART_0_INTERRUPT_DRIVEN&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&amp;quot; (the 2nd project settings window above - compatible with the shell module) while &amp;quot;CONFIG_UART_1_ASYNC=y&amp;quot; (the 1st project settings window above - compatible with the UART async API)?&lt;/p&gt;
&lt;p&gt;FYI, I am using the &lt;a href="https://academy.nordicsemi.com/topic/exercise-1-5/"&gt;DevAcademy, lesson 5, exercise 1 example code&lt;/a&gt; to reproduce this on an nRF52840 DK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART and shell module in Zephyr on  nRF52480</title><link>https://devzone.nordicsemi.com/thread/377684?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2022 14:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0750d1e-548d-4074-b2e0-76abc5811081</guid><dc:creator>AndyM</dc:creator><description>&lt;p&gt;Found the solution&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;shell_print(shell_backend_uart_get_ptr(),&lt;/span&gt;&lt;span&gt;&amp;quot;%s&amp;quot;&lt;/span&gt;&lt;span&gt;,data);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART and shell module in Zephyr on  nRF52480</title><link>https://devzone.nordicsemi.com/thread/377500?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2022 04:53:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2d315b6-9fb1-485e-b963-64aeabe9fca3</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It might be possible but you need to have some inter-thread communication implemented between the shell module and your thread to synchronize the access to uart in your application. There is no config to temporarily disable shell to give other threads access to uart.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART and shell module in Zephyr on  nRF52480</title><link>https://devzone.nordicsemi.com/thread/377256?ContentTypeID=1</link><pubDate>Fri, 15 Jul 2022 20:01:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cf5f56e-8b22-48be-a851-c6e66d0af049</guid><dc:creator>AndyM</dc:creator><description>&lt;p&gt;Revisiting... I have a shell module&amp;nbsp; and I need to send data asynchronously over UART from a thread other than the shell. Is this possible? Is there a way to temporarily disable shell UART handlers and re-enable them when I&amp;#39;m done sending the data?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Async UART and shell module in Zephyr on  nRF52480</title><link>https://devzone.nordicsemi.com/thread/362854?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2022 12:33:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:267bd269-91bc-4693-b0d6-223f1dbfd85c</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Now I need to add async UART to send some data outside the shell[/quote]
&lt;p&gt;Could you check out&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/topic/exercise-1-5/"&gt;this detailed sample using asynchronous UART&lt;/a&gt;&amp;nbsp;in our&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/lessons/lesson-4-serial-communication-uart/"&gt;nRF Connect SDK course&lt;/a&gt;&amp;nbsp;to see if&amp;nbsp;you have missed anything in the setup of the asynchronous UART?&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/hardware/peripherals/uart.html?highlight=uart_callback_set#c.uart_callback_set"&gt;uart_callback_set()&lt;/a&gt;&amp;nbsp;should only return ENOSYS if async api is not supported by the device, but this should be supported by the nRF52840, leading me to think there is something missing in your setup.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]Is there a way to use UART async API with the shell?[/quote]
&lt;p&gt;Regarding this, I will ask around and come back with more details before Wednesday (within 2 working days). In the meanwhile, you may investigate this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/support-private/support/264421"&gt;open ticket with a somewhat similar issue&lt;/a&gt;&amp;nbsp;to see if you are able to spot your issue through&amp;nbsp;their fix.&lt;br /&gt;&lt;br /&gt;Let me know if these guides help you before I am able to reach back to you with additional information.&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>