<?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>Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58363/getting-cli-to-work-over-uart-on-custom-board</link><description>Hi support, 
 I&amp;#39;m currently using pca10040 on my custom board and want to be able to implement the CLI over uart port. My SDK is 15.2. 
 To get started, I test my board&amp;#39;s hardware with the uart example and it&amp;#39;s working fine (the only modification I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Mar 2020 13:59:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58363/getting-cli-to-work-over-uart-on-custom-board" /><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/239150?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 13:59:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c71fdd7-762b-431e-a8dc-e2acd3e4c613</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;That is indeed the problem. Swapping TX and RX and it&amp;#39;s working correctly now. This seems strange because the UART example is working fine with the previous TX and RX configuration but for CLI example I have to swap it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/239033?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 09:54:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e994155-4811-487d-a288-a7b8fcecdc20</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;So no data is being sent out on the TX pin from the nRF on startup, correct? I&amp;#39;m not sure if I can explain that. The register content you posted earlier shows that data has been transmitted so it seems strange it&amp;#39;s not reflected on the output. I assume the same board still works with the UART example? Is it possible that you may have swapped the TX and RX&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/238938?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 18:45:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9aeb93c2-7bbd-4d17-904c-f2b563464b91</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;1. Data is clocked out from the PC on TX line to the nRF device, but nRF is not sending back anything on the RX line so it has to do with the nRF.&lt;/p&gt;
&lt;p&gt;2. Call the function properly this time but it doesn&amp;#39;t make a difference unfortunately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/238835?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 13:32:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc3a29ec-ff5e-40b7-b91a-bfa5089529f4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks again for checking. With regards to point 1, if data is clocked out, but not received by the PC, doesn&amp;#39;t that indicate that the problem is external to the nRF? 2. It must be called after the clock init. You can do it at the same time you request the LF clock.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/238618?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 19:40:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c5e7eb2-fcbb-4be7-ad6a-5c5a509fe284</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;Still no luck with all the changes:&lt;/p&gt;
&lt;p&gt;1. TX line in clocked out and I can verify it on the scope&lt;/p&gt;
&lt;p&gt;2. When I called nrf_drv_clock_hfclk_request(NULL), the&amp;nbsp;ASSERT(m_clock_cb.module_initialized) in the function failed.&lt;/p&gt;
&lt;p&gt;3. Swap out another cable but still no luck&lt;/p&gt;
&lt;p&gt;4. Test out lower baudrate (38400 and 9600) but no response as well.&lt;/p&gt;
&lt;p&gt;I see this on the rtt_cli, not sure if it&amp;#39;s related&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1583523624935v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/238220?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 10:08:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fda98e8d-220d-4e2f-b85e-5419e1b7d00d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks&amp;nbsp;for checking. The registers indicate that data has been transmitted (DMA amount is 3 bytes, and the tx event is triggered), which makes me suspect that it might not be a&amp;nbsp;SW configuration problem after all even though it worked with the UART example earlier.&lt;/p&gt;
&lt;p&gt;Some more ideas of what you can try:&lt;/p&gt;
&lt;p&gt;1. Probe the TX line with Logic analyzer or scope to verify if data is clocked out&lt;/p&gt;
&lt;p&gt;2. Call&amp;nbsp;nrf_drv_clock_hfclk_request(NULL); on startup to turn on the HF crystal oscillator. It will increase the baudrate accuracy.&lt;/p&gt;
&lt;p&gt;3. Try with a different USB UART bridge&lt;/p&gt;
&lt;p&gt;4. Lower the baudrate. E.g., 38400&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/238104?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 15:57:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e430f16-826b-44e3-aab5-91f6b0d8b6f5</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1583337446981v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/238103?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 15:57:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c3deec5-8e89-469c-9981-3afd5152b388</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;My registers look similar to yours, with the major difference just being that I&amp;#39;m using pin 22 and 23 for TX and RX respectively&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/238054?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 14:01:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:375dec81-954f-495d-9f5f-8d57242343bb</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Please try to&amp;nbsp;read out the UARTE registers as well to see if it looks as expected. E.g., go over PSEL registers, see if any of the event registers are set, .TXD.AMOUNT != 0, etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-274efde902854851914fc02108321245/pastedimage1583330480838v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/237870?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 16:52:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:701b619a-1612-4b42-ad06-e1edd9a0aa95</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;Sorry for the confusion, my target is the PCA10040 on my custom board. The tag is because I&amp;#39;m using the nrf52840 dk to test/develop code on.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/237441?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 12:59:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55d146a6-f289-476d-8999-02317a0a4816</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for confirming. Note that the ASSERT() macro is unlike the APP_ERROR_CHECK() maco excluded from &amp;quot;release&amp;quot; builds. But that doesn&amp;#39;t matter now as you&amp;#39;re already using the Debug configuration.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I noticed now that you&amp;#39;re using the PCA10040 configuration which is for the nRF52 DK + 52832 while the original question is tagged with nRF52840 DK (PCA10056). Please try the PCA10056 if your target is a nRF52840.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/237252?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 22:25:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a2b8da2-6821-42ce-b551-39f270f9d155</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;All of my APP_ERROR_CHECK is passed and ret is returning 0 which means NRF_SUCCESS. I also have it in debug mode.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1582928738489v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/237216?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 16:26:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d7c10c8-8e4c-4256-a7d2-0ff4d42e9d82</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Have you tried to debugging in Segger embedded studio and with the &amp;quot;Debug&amp;quot; configuration instead of &amp;quot;Release&amp;quot;. If not I think it may be worth trying. There are some ASSERT checks in the CLI backend&amp;nbsp;that will be excluded otherwise.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-274efde902854851914fc02108321245/pastedimage1582907155707v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/236960?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 16:31:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:566ba3eb-c21e-4445-b246-db38e9d31396</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;By the way, rtt_cli is working. The only thing that is not working is uart_cli.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/236944?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 15:44:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1801f17-f56a-43e0-b1ad-7c8a4afee036</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;I have tried debugging it and it doesn&amp;#39;t get stuck anywhere. It does get to the infinite loop with cli_process().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/236942?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 15:39:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27d2569c-c4eb-4422-a40b-af8047e973d3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you able to debug the running FW on the custom with Segger embedded studio, etc to see if the program is stuck somewhere? Maybe it ends up in the&amp;nbsp;app_error_fault_handler().&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/236933?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 15:19:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a4cc87d-a8ee-4518-bf74-c4b7443db7bb</guid><dc:creator>Henry Dang</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Thank you for your quick reply. My board doesn&amp;#39;t have the optional 32Khz mounted so I have disabled CLOCK_CONFIG_LF_SRC. However, uart is still not working. Any other places I can check?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting CLI to work over UART on custom board</title><link>https://devzone.nordicsemi.com/thread/236888?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 13:48:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db0775ee-6c1e-4858-b6b6-19cd9b7f36a7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s good that you already validated the HW by running the UART example.&amp;nbsp;So, maybe it&amp;#39;s not related to the UART. Do you have&amp;nbsp;the optional 32Khz mounted on your custom board? If not you need to make sure the internal RC oscillator is selected (ie., set&amp;nbsp;&amp;nbsp;CLOCK_CONFIG_LF_SRC=0 in sdk_config.h)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>