<?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>BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75923/ble-demo-with-uart-not-working</link><description>Hi there, 
 I was able to successfully compile and run the &amp;quot;BLE HIDS keyboard&amp;quot; example on my nRF52832 using Segger SES 5.44 
 My Nordic chip is connected via UART Rx/Tx to another MSP430 and I like to send some data bytes from the MSP to the Nordic chip</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Jun 2021 11:31:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75923/ble-demo-with-uart-not-working" /><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313630?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 11:31:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75da798a-a317-4861-a3d9-86de0eea8f98</guid><dc:creator>awneil</dc:creator><description>[quote userid="104149" url="~/f/nordic-q-a/75923/ble-demo-with-uart-not-working/313609#313609"]RxD is set to RX_PIN_NUMBER = 8, so this is P0.08, right ?&lt;br /&gt;and TX pin number is 6, so P0.06, right ?&lt;br /&gt;[/quote]
&lt;p&gt;Yes.&lt;/p&gt;
[quote userid="104149" url="~/f/nordic-q-a/75923/ble-demo-with-uart-not-working/313609#313609"]I assume its correct to cross connect Nordic:RxD &amp;lt;&amp;gt; CP2102:TxD and Nordic TxD &amp;lt;&amp;gt; CP2102 RxD ?[/quote]
&lt;p&gt;Almost certainly, but check the datasheets:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The UART output from the nRF needs to go to the UART input of the CP2102;&lt;/li&gt;
&lt;li&gt;The UART input to the nRF needs to come from to the UART output of the CP2102.&lt;/li&gt;
&lt;/ul&gt;
[quote userid="104149" url="~/f/nordic-q-a/75923/ble-demo-with-uart-not-working/313609#313609"]Is it necessary to wire RTS/CTS in any way[/quote]
&lt;p&gt;It depends:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;does your code &lt;em&gt;implement&lt;/em&gt; flow control?&lt;/li&gt;
&lt;li&gt;does whatever&amp;#39;s connected to the CP2102 &lt;em&gt;require&lt;/em&gt; flow control?&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313629?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 11:27:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:061970ce-cc22-4403-814e-70fb04d5699f</guid><dc:creator>awneil</dc:creator><description>[quote userid="104149" url="~/f/nordic-q-a/75923/ble-demo-with-uart-not-working/313605#313605"]its only this line&amp;nbsp; : 181 : APP_ERROR_CHECK(err_code);[/quote]
&lt;p&gt;Well, of course it is - that&amp;#39;s the line that catches&amp;nbsp;&amp;amp; throws the error&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What you need to look at is the lines immediately before that - what is it which gives that error_code ?&lt;/p&gt;
&lt;p&gt;And then look-up that function&amp;#39;s documentation - that will tell you the reasons why it might return an error code of 4.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313609?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 10:32:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:502fe982-b0ff-476c-96f9-81620436bd3c</guid><dc:creator>MDF</dc:creator><description>&lt;p&gt;I tried in the meanwhile the ble_app_uart example - I can connect over BLE, but see no data. I&amp;#39;m using a CP2102 serial USB chip to connect to my windows PC as virtual COM7 with putty.&lt;/p&gt;
&lt;p&gt;From the defines in pca10040.h : RxD is set to RX_PIN_NUMBER = 8, so this is P0.08, right ?&lt;br /&gt;and TX pin number is 6, so P0.06, right ?&lt;br /&gt;I assume its correct to cross connect Nordic:RxD &amp;lt;&amp;gt; CP2102:TxD and Nordic TxD &amp;lt;&amp;gt; CP2102 RxD ?&lt;br /&gt;Is it necessary to wire RTS/CTS in any way ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313605?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 10:25:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d104559-055d-48b0-a0b0-25576d18867d</guid><dc:creator>MDF</dc:creator><description>&lt;p&gt;its only this line&amp;nbsp; : 181 : APP_ERROR_CHECK(err_code);&lt;br /&gt;the file app_timer2.c is the original from the SDK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313587?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 09:35:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:110fa48e-61ec-4626-bef4-f33de0c62787</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;sorry - I meant show us the C &lt;em&gt;source&lt;/em&gt; code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/1122._5F00_Insert-Code-_2D00_-Nordic-2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313585?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 09:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a92babdf-4d58-4720-b1d3-d271a9595e7e</guid><dc:creator>MDF</dc:creator><description>&lt;p&gt;error_code = 4&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313581?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 09:19:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93d57ea6-69c8-4a93-8d53-8cbdcb10ea4b</guid><dc:creator>awneil</dc:creator><description>[quote userid="104149" url="~/f/nordic-q-a/75923/ble-demo-with-uart-not-working/313579#313579"]&amp;lt;error&amp;gt; app: ERROR 4 [NRF_ERROR_NO_MEM] at F:\Keil\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:181[/quote]
&lt;p&gt;So what is the code at&amp;nbsp;&lt;span&gt;app_timer2.c: line 181 ?&lt;/span&gt;&lt;/p&gt;
[quote userid="2111" url="~/f/nordic-q-a/75923/ble-demo-with-uart-not-working/313376#313376"]Seems much like an assert, likely due to framing error on the uart[/quote]
&lt;p&gt;&lt;span&gt;And the SDK has been known to misleadingly give&amp;nbsp;NRF_ERROR_NO_MEM for UART framing errors:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/41480/multiperipheral-nus-crashes/161677#161677"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/41480/multiperipheral-nus-crashes/161677#161677&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61e.svg" title="Disappointed"&gt;&amp;#x1f61e;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313579?ContentTypeID=1</link><pubDate>Fri, 04 Jun 2021 09:08:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f108595-743c-4954-b1b3-57776adc8647</guid><dc:creator>MDF</dc:creator><description>&lt;p&gt;I build with Debug and I also switched to another Hardware board (UTO-NBL-42a) - its a small breakout board - to eliminate any possible issue with the MSP430&lt;/p&gt;
&lt;p&gt;Without &amp;quot;uart_init&amp;quot; the debug terminal output is like this, just fine&lt;/p&gt;
&lt;p&gt;Starting..&lt;br /&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.&lt;br /&gt;&amp;lt;info&amp;gt; app: &amp;nbsp;&amp;nbsp; &amp;nbsp;m_whitelist_peer_cnt 2, MAX_PEERS_WLIST 8&lt;br /&gt;&amp;lt;info&amp;gt; app: Fast advertising with whitelist.&lt;br /&gt;&amp;lt;info&amp;gt; app: Slow advertising with whitelist.&lt;/p&gt;
&lt;p&gt;With &amp;quot;uart_init&amp;quot; is see this&lt;/p&gt;
&lt;p&gt;Starting..&lt;br /&gt;UartInit&lt;br /&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.&lt;br /&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.&lt;br /&gt;&amp;lt;info&amp;gt; app: &amp;nbsp;&amp;nbsp; &amp;nbsp;m_whitelist_peer_cnt 2, MAX_PEERS_WLIST 8&lt;br /&gt;&amp;lt;info&amp;gt; app: Fast advertising with whitelist.&lt;br /&gt;&amp;lt;error&amp;gt; app: ERROR 4 [NRF_ERROR_NO_MEM] at F:\Keil\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:181&lt;br /&gt;PC at: 0x00028427&lt;/p&gt;
&lt;p&gt;After the first &amp;quot;RTC initialized&amp;quot; it takes approx 20 secs, then I see the 2nd &amp;quot;RTC initialised&amp;quot; and the error in app_error_fault_handler() with ID=0x4001&lt;/p&gt;
&lt;p&gt;APP_UART_FIFO_INIT returns =8, but according to some other posts, I assume this is ok&lt;/p&gt;
&lt;p&gt;I added a 10 kOhm resistor to Uart RX (P0.08) but see no change either.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313376?ContentTypeID=1</link><pubDate>Thu, 03 Jun 2021 11:20:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:303cc5ca-94f4-4674-a910-1e7d49544b47</guid><dc:creator>Kenneth</dc:creator><description>[quote user=""]Led goes solid on and I&amp;#39;m not able to connect to the device in any way.[/quote]
&lt;p&gt;Seems much like an assert, likely due to framing error on the uart, if you build with Debug (not Release) you should get some more information from your fault_handler (typically app_error_fault_handler()).&lt;/p&gt;
&lt;p&gt;Can you for quick test just try to add a 10kohm pull up on the UART RX pin?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE demo with UART not working</title><link>https://devzone.nordicsemi.com/thread/313189?ContentTypeID=1</link><pubDate>Wed, 02 Jun 2021 15:56:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18abe77c-f4d2-4b33-8fce-a6847ae755bc</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;have you checked what error code is returned?&lt;/p&gt;
&lt;p&gt;Does this help: &lt;a href="https://acassis.wordpress.com/2016/06/26/how-i-got-fooled-by-nordics-app_uart_init/"&gt;https://acassis.wordpress.com/2016/06/26/how-i-got-fooled-by-nordics-app_uart_init/&lt;/a&gt;&amp;nbsp;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>