<?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>Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65173/problem-with-setting-two-uart-on-pca10040-board</link><description>Problem with setting two uart on pca10040 board 
 
 hello 
 I am reading the log by teraterm by connecting pca10040 board to PC via USB. 
 I am trying to connect 6pin and 8pin of the board to other devices through uart. 
 The example used ble_app_uart</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Aug 2020 16:41:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65173/problem-with-setting-two-uart-on-pca10040-board" /><item><title>RE: Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/thread/266813?ContentTypeID=1</link><pubDate>Thu, 27 Aug 2020 16:41:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b62163d9-fc50-4c40-8442-44f0ec42e2b5</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Tobaro4,&lt;/p&gt;
[quote user="tobaro4"]Thanks to you, I am encouraged.[/quote]
&lt;p&gt;I am happy to hear that!&lt;/p&gt;
[quote user="tobaro4"]When I say that the program dies, it dies with NRF_BREAKPOINT_COND as in the screenshot I posted above.&lt;br /&gt;When looking at the IMU&amp;#39;s menual, it seems that flow control is not used.[/quote]
&lt;p&gt;I understand. Do you get the exact same error generated, as in the screenshot you shared earlier?&lt;br /&gt;In that case, I would think it is an overrun error, i.e a start bit is received while the previous data is still in the RXD buffer.&lt;br /&gt;Do you have access to a logic analyzer? That would make this very easy to confirm.&lt;/p&gt;
[quote user="tobaro4"]Attach the c file of the program I modified.[/quote]
&lt;p&gt;When reading your main.c file I am not entirely sure what the intentions of some of your commented out code is.&lt;br /&gt;Could you walk me through the changes you have made to the uart_event_handler - what is the purpose and goal of these changes?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/thread/266392?ContentTypeID=1</link><pubDate>Wed, 26 Aug 2020 08:36:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ba59ac6-9163-487b-9dd1-f592732b06fa</guid><dc:creator>tobaro4</dc:creator><description>&lt;p&gt;ok&lt;br /&gt;Thanks to you, I am encouraged.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;When I say that the program dies, it dies with NRF_BREAKPOINT_COND as in the screenshot I posted above.&lt;br /&gt;When looking at the IMU&amp;#39;s menual, it seems that flow control is not used.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Attach the c file of the program I modified.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/16367.main.c"&gt;devzone.nordicsemi.com/.../16367.main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Even if it doesn&amp;#39;t solve the problem, I&amp;#39;ll try to find another way.&lt;br /&gt;Thank you again.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;tobaro4&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/thread/266379?ContentTypeID=1</link><pubDate>Wed, 26 Aug 2020 08:06:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d122b6d5-64e4-4af8-996b-d3a575015530</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="tobaro4"]I know you&amp;#39;re doing your best for me. Thanks for this.[/quote][quote user="tobaro4"]But I am completely newbie on this part. I&amp;#39;m using an unmodified example and I don&amp;#39;t know how to fix it.[/quote]
&lt;p&gt;It is truly no problem at all, do not worry :)&amp;nbsp;&lt;/p&gt;
[quote user="tobaro4"]Should I call the ble_stack_init() function before the uart_init() function? I really don&amp;#39;t understand. I&amp;#39;m really sorry.[/quote]
&lt;p&gt;Lets take it from the start instead. Have you tried running an unmodified version of the example? I.e, does the example work as intended when you program your device with an unmodified version?&lt;br /&gt;The unmodified Nordic UART peripheral example &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/ble_sdk_app_nus_eval.html"&gt;should behave as described in its documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;When we have confirmed that this is working as intended, then we may move on to modifying the example to suit the needs of your application.&amp;nbsp;&lt;/p&gt;
[quote user="tobaro4"]If the IMU device is connected to the rx pin, the program will not run. If you don&amp;#39;t connect the rx pin, the program will run. However, if I connect the rx pin while the program is running, it dies quickly.[/quote]
&lt;p&gt;This is very interesting. Could you elaborate what you mean when you say that the program dies, or what happens if it does not start at all?&lt;br /&gt;Perhaps this is caused by the buffers being overrun.&lt;/p&gt;
[quote user="tobaro4"]It seems to die reading about 147 bytes. How to process or empty the buffer size?[/quote]
&lt;p&gt;Is it an option to use flow control on the UART communication to the IMU?&lt;br /&gt;Or, could you share the parts of the code in which you empty / process the contents of the RX buffer?&lt;br /&gt;&lt;br /&gt;Looking forward to resolving this issue together!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/thread/266340?ContentTypeID=1</link><pubDate>Wed, 26 Aug 2020 00:41:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0eae941-ba74-49df-89a1-3ea4f384f66f</guid><dc:creator>tobaro4</dc:creator><description>&lt;p&gt;I know you&amp;#39;re doing your best for me. Thanks for this.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;But I am completely newbie on this part. I&amp;#39;m using an unmodified example and I don&amp;#39;t know how to fix it.&lt;br /&gt;Should I call the ble_stack_init() function before the uart_init() function? I really don&amp;#39;t understand. I&amp;#39;m really sorry.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;If the IMU device is connected to the rx pin, the program will not run. If you don&amp;#39;t connect the rx pin, the program will run. However, if I connect the rx pin while the program is running, it dies quickly. It seems to die reading about 147 bytes. How to process or empty the buffer size?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;tobaro4&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/thread/266215?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 11:52:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48156ba0-7710-4076-9789-f37ff850cc36</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Tobaro4,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="tobaro4"]Thank you.[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;/p&gt;
[quote user="tobaro4"]&lt;p&gt;&lt;/p&gt;&lt;p&gt;If it is sd_ble_enable, do you mean NRF_SDH_BLE_ENABLED in sdk_config.h?&lt;/p&gt;&lt;p&gt;If so, it is active.&lt;/p&gt;&lt;p&gt;If not, can you tell me which SoftDevice to set up?&lt;/p&gt;&lt;p&gt;Sorry, but maybe I didn&amp;#39;t understand your advice.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;I will try to be more specific. Please let me know if anything still should be unclear.&lt;br /&gt;In the unmodified ble_app_uart example the SoftDevice is enabled as part of the &lt;em&gt;ble_stack_init&amp;nbsp;&lt;/em&gt;function ( specifically during the &lt;em&gt;nrf_sdh_enable_request&lt;/em&gt; ).&lt;br /&gt;Have you made any changes to this?&lt;br /&gt;Does your application start, or could you go into debugger mode to see if the application gets past this function call at all?&lt;br /&gt;If it does not, then there is a problem with the SoftDevice configuration or setup.&lt;/p&gt;
&lt;p&gt;[quote user="tobaro4"][/quote]&lt;/p&gt;
&lt;p&gt;I searched for the related error message:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37193/nrf_error_svc_handler_missing-of-uart"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/37193/nrf_error_svc_handler_missing-of-uart&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is something like this, but I still don&amp;#39;t understand.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is a good find, and may apply to your situation if the debugging check I mentioned above does not produce anything. If your application is able to start, and begin communication before suddenly failing during uart transfer, then it might indeed be an overrun error.&lt;br /&gt;In that case, we will need to take a look at the buffer size you have specified, and how frequently they are processed and emptied.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/thread/266145?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 08:59:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dedcd476-3cb0-4adb-be85-cf6523ad30e9</guid><dc:creator>tobaro4</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If it is sd_ble_enable, do you mean NRF_SDH_BLE_ENABLED in sdk_config.h?&lt;/p&gt;
&lt;p&gt;If so, it is active.&lt;/p&gt;
&lt;p&gt;If not, can you tell me which SoftDevice to set up?&lt;/p&gt;
&lt;p&gt;Sorry, but maybe I didn&amp;#39;t understand your advice.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;add&lt;/p&gt;
&lt;p&gt;It leaves a detailed compilation error message:&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.&lt;br /&gt;&amp;lt;error&amp;gt; app: Communication error occurred while handling UART.&lt;br /&gt;&amp;lt;error&amp;gt; app: ERROR 1 [NRF_ERROR_SVC_HANDLER_MISSING] at C:\work\99.study\nordic\Nordic_SDK_v17\nRF5_SDK_17.0.0_9d13099\examples\ble_central\ble_app_uart_c\main.c:394&lt;br /&gt;PC at: 0x00027587&lt;br /&gt;&amp;lt;error&amp;gt; app: End of error report&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I searched for the related error message:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37193/nrf_error_svc_handler_missing-of-uart"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/37193/nrf_error_svc_handler_missing-of-uart&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is something like this, but I still don&amp;#39;t understand.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;tobaro4&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/thread/266133?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 08:38:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34dfd83f-1ffb-4d9c-981c-0da7294aa479</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Tobaro,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="tobaro4"]&lt;p&gt;&lt;/p&gt;&lt;p&gt;The device I am trying to connect is the IMU Module.&lt;/p&gt;&lt;p&gt;I am trying to connect the uart pin (vcc,gnd,rx,tx) of the device with the PCA10040 board.&lt;/p&gt;&lt;p&gt;The purpose is to send the value of the IMU Module to the PCA10040 board&lt;/p&gt;&lt;p&gt;and then send the value back to the terminal of the PC via USB.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for the clarification.&lt;br /&gt;&lt;br /&gt;The error NRF_ERROR_SVC_HANDLER_MISSING is often caused by not having&lt;span&gt;&amp;nbsp;enabled the SoftDevice (using sd_ble_enable) or if the headers included for the SoftDevice are not the correct headers for the particular SoftDevice you are using.&lt;br /&gt;Could you verify that you have indeed enabled the SoftDevice, and that the included headers match the particular SoftDevice you are using?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/thread/266126?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 08:17:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d23c1b25-c161-49fd-acd1-996e7535ad38</guid><dc:creator>tobaro4</dc:creator><description>&lt;p&gt;Thanks for your kind response.&lt;/p&gt;
&lt;p&gt;The device I am trying to connect is the IMU Module.&lt;/p&gt;
&lt;p&gt;I am trying to connect the uart pin (vcc,gnd,rx,tx) of the device with the PCA10040 board.&lt;/p&gt;
&lt;p&gt;The purpose is to send the value of the IMU Module to the PCA10040 board&lt;/p&gt;
&lt;p&gt;and then send the value back to the terminal of the PC via USB.&lt;/p&gt;
&lt;p&gt;Recompiled using the method you indicated.&lt;/p&gt;
&lt;p&gt;&lt;img alt="DEBUG Massage" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/7178.problem.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Is there any way to solve the problem?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;tobaro4&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with setting two uart on pca10040 board</title><link>https://devzone.nordicsemi.com/thread/266116?ContentTypeID=1</link><pubDate>Tue, 25 Aug 2020 07:52:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06ac4215-84ba-4049-8fac-f21fc9eb050f</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]Is there a way to use two uarts separately?[/quote]
&lt;p&gt;Unfortunately no, &lt;a href="https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/nrf52832_ps.html"&gt;the nRF52832 SoC only has 1 UART instance&lt;/a&gt;.&lt;/p&gt;
[quote user=""]The problem occurs with NRF_BREAKPOINT_COND in uart init.[/quote]
&lt;p&gt;I would think this error you are seeing is from trying to initialize the one instance twice.&lt;br /&gt;If you would like to verify this, please add DEBUG to your preprocessor defines as shown in the included picture, to see what error is being generated.&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-feb022f154df4f44a08377f40d741872/enabling_5F00_debug_5F00_SES.PNG" /&gt;&lt;/p&gt;
[quote user=""]I am trying to connect 6pin and 8pin of the board to other devices through uart.[/quote]
&lt;p&gt;What other devices are you trying to connect with? Perhaps the other devices support another serial interface?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>