<?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>Zephyr Shell with custom interface transport layer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86501/zephyr-shell-with-custom-interface-transport-layer</link><description>I want to use the Zephyr Shell with my own transport layer. Since the only connection I will have to the modem is over SPI, I want to have the SPI read/writes handled with custom interface functions that replace, for example, the UART interface. 
 
 How</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Apr 2022 07:06:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86501/zephyr-shell-with-custom-interface-transport-layer" /><item><title>RE: Zephyr Shell with custom interface transport layer</title><link>https://devzone.nordicsemi.com/thread/361726?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2022 07:06:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d32ee6db-b0a5-4ded-8d82-43ed6a62fdf7</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Thanks! Looking forward to hear how it works! Good luck!&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Shell with custom interface transport layer</title><link>https://devzone.nordicsemi.com/thread/361564?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2022 14:11:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28307a5e-ed9a-46c3-8ca3-6853bf8565d2</guid><dc:creator>JonnyMN</dc:creator><description>&lt;p&gt;I haven&amp;#39;t started on the SPI implementation yet, but I will be operating the modem as a SPI slave, where the SPI packet will probably have the packet length as the first byte, then then ascii commands after that. Those ascii commands are what will be passed into the &amp;quot;shell_execute_cmd()&amp;quot; function. Reponses from the shell_backend_dummy_get_output() function will be stored in a buffer that will be transmitted out when the SPI master requests it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Shell with custom interface transport layer</title><link>https://devzone.nordicsemi.com/thread/361425?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2022 08:42:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78bd8725-5013-405d-901d-509dbed583a5</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Thanks for sharing! Could you share an example on how you use it with the SPI?&lt;br /&gt;&lt;br /&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Shell with custom interface transport layer</title><link>https://devzone.nordicsemi.com/thread/361292?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 19:52:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30c22f78-4b85-4018-bbf9-4459159faff1</guid><dc:creator>JonnyMN</dc:creator><description>&lt;p&gt;Thank you for the link to Discord! After asking on Discord, my solution is to use the&amp;nbsp;Dummy transport layer.&lt;/p&gt;
&lt;div&gt;&lt;span&gt;Set config in prj.conf:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SHELL_BACKEND_DUMMY=y&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;And then I can pass the text commands to the shell using (where &amp;quot;clear&amp;quot; can be any shell command you want)&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;shell/shell_dummy.h&amp;quot;
shell_execute_cmd(shell_backend_dummy_get_ptr(), &amp;quot;clear&amp;quot;)
&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;And I read the shell response using&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;size_t stringLength = 0;
printk(shell_backend_dummy_get_output(shell_backend_dummy_get_ptr(), &amp;amp;stringLength));&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Relevent links:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;a href="https://docs.zephyrproject.org/apidoc/latest/shell__dummy_8h.html"&gt;https://docs.zephyrproject.org/apidoc/latest/shell__dummy_8h.html&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Shell with custom interface transport layer</title><link>https://devzone.nordicsemi.com/thread/361268?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 14:15:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9a2a39c-aaf2-4d70-9e19-4b973ca37047</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;I&amp;#39;m afraid I can&amp;#39;t help with that. You will need to contact the &lt;a href="https://discord.com/invite/zephyrproject"&gt;Zephyr Community support via Discord&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Shell with custom interface transport layer</title><link>https://devzone.nordicsemi.com/thread/361266?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 14:10:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c393d93-2329-43c4-9afc-a405fbbf9f45</guid><dc:creator>JonnyMN</dc:creator><description>&lt;p&gt;I&amp;#39;ve seen that list of supported transport layers before, but I want a custom interface, something that I can just pass messages to and from directly in software (instead of directly through the UART, for example). That way my SPI receive functions can just pass the ascii text commands to the shell, and then the shell ascii text response can be passed into the SPI transmit functions, completely transparent to the shell.&lt;/p&gt;
&lt;p&gt;I took a look at the GPIO examples, and I think I already understand how to make my own custom commands, its just using a custom physical interface that is holding me back right now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Shell with custom interface transport layer</title><link>https://devzone.nordicsemi.com/thread/361259?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 13:56:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d63d710a-aca1-4f24-8dc0-7f54860841f1</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Could you elaborate some more on what you are trying to achieve?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The shell supports the following transport layers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Segger RTT&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;SMP&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Telnet&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;UART&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USB&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;DUMMY - not a physical transport layer.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want the shell to send SPI commands, you will need to &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/zephyr/reference/shell/index.html#creating-commands"&gt;configure your own shell commands&lt;/a&gt; which calls misc. SPI functions.&lt;/p&gt;
&lt;p&gt;Have a&amp;nbsp;&lt;a href="https://github.com/martelmy/NCS_examples/tree/main/peripheral/gpio_device"&gt;look at this sample using GPIO&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>