<?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>Common serial interface over UART and USB</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49757/common-serial-interface-over-uart-and-usb</link><description>Hi, 
 I am developing firmware for both nRF52832 and nRF52840 chips. For serial communication, I would like to have a common interface for both chips, which means sending binary data over UART ( nRF52832) or over USB ( nRF52840) . The only solution that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Jul 2019 08:57:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49757/common-serial-interface-over-uart-and-usb" /><item><title>RE: Common serial interface over UART and USB</title><link>https://devzone.nordicsemi.com/thread/198890?ContentTypeID=1</link><pubDate>Wed, 17 Jul 2019 08:57:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b37f3d9-f555-4e64-8d24-46c5dd244de5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sorry, your description was clear, but I realize now that CLI probably isn&amp;#39;t the best choice for what you want to do.&amp;nbsp;It should be up to your&amp;nbsp;application to interpret the data passed as arguments to your custom command (doesn&amp;#39;t have to be a string), but I forgot the fact that the module&amp;nbsp;will still need to parse incoming data to detect newlines &amp;lt;\n or \r&amp;gt; (end of command), backspace &amp;lt;0x08&amp;gt; (new argument), and NULL termination in order for the interface to work. I&amp;nbsp;guess it could&amp;nbsp;have worked better if there were an option to use &lt;a href="https://en.wikipedia.org/wiki/Type-length-value"&gt;TLV &lt;/a&gt;encoded command arguments.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Maybe the CLI implementation can be more useful as a reference to implement your own abstraction layer. nrf_cli_cdc_acm.c and nrf_cli_uart.c how we&amp;#39;ve created the &amp;quot;serial port&amp;quot; API.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Common serial interface over UART and USB</title><link>https://devzone.nordicsemi.com/thread/198797?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 17:45:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7e8e4ff-d6e4-4376-bd10-e2d91f602128</guid><dc:creator>RedNodeLabs</dc:creator><description>&lt;p&gt;Hi Vidar, yes, as I said at the beginning, I took your CLI module&amp;nbsp;as reference, because it has a common interface to use both UART and USB.&lt;/p&gt;
&lt;p&gt;But maybe I did not express myself correctly. For the communication from the nRF52 to the host, I want to build a kind of serial protocol that works with UART and USB, and be able to send several types of binary packets. What I mean with binary packet is without formatting it by means of printf. I just want to send out arrays of bytes without having the overhead of formatting them as string, integer or whatever. But to do that, I did not&amp;nbsp;find any function in the CLI module. Is it now more clear?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Javier&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Common serial interface over UART and USB</title><link>https://devzone.nordicsemi.com/thread/198697?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 12:16:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41dcd787-65c1-4351-aa92-dbe244dd6076</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Javier, I think the CLI example in SDK 15.3.0 can be a good starting point (&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/cli_example.html?cp=5_1_4_6_7"&gt;link&lt;/a&gt;). The print function will for instance print out any arbitrary data you pass to it. You can find more documentation for the&amp;nbsp;module itself here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_cli.html?cp=5_1_3_10"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_cli.html?cp=5_1_3_10&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-60654659c0dd4a42931dc9c176303f2d/pastedimage1563279245102v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Common serial interface over UART and USB</title><link>https://devzone.nordicsemi.com/thread/198558?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2019 18:35:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c25e236d-f4b9-4e2b-9922-c1f8eae0655f</guid><dc:creator>RedNodeLabs</dc:creator><description>&lt;p&gt;Thank you for your reply, Vidar. That sounds good, and it would work for my use case :) But could you please provide any example of that, or any documentation of such functions/commands? That would help me a lot.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Javier&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Common serial interface over UART and USB</title><link>https://devzone.nordicsemi.com/thread/198441?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2019 12:07:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cd3395d-9a24-4b90-b32f-06da193de347</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Javier,&lt;/p&gt;
&lt;p&gt;The CLI module allows you to pass binary data as arguments to your commands.&amp;nbsp;Would&amp;nbsp;that work for your use case? I.e., prefix every data packet with a custom command?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>