<?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>Adding printf() in UART caused stalling</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81938/adding-printf-in-uart-caused-stalling</link><description>I tried to use printf() to get the data from SPI buffers. It runs OK in the peripheral/spi example. But when I moved it to the ble_app_uart, the program stalled at printf. 
 
 Here is the code that stalled the debugging: 
 printf(&amp;quot;TX: %x %x %x %x, RX</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Dec 2021 08:58:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81938/adding-printf-in-uart-caused-stalling" /><item><title>RE: Adding printf() in UART caused stalling</title><link>https://devzone.nordicsemi.com/thread/341451?ContentTypeID=1</link><pubDate>Wed, 01 Dec 2021 08:58:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3dfb3d93-85d4-4193-9db9-e9813ba98f80</guid><dc:creator>JONATHAN LL</dc:creator><description>[quote user="Christopher Bilal"]For the SPI and TWI part, how can I know if I have the memory map issue?[/quote]
&lt;p&gt;In the section of the documentation it shows what address the different peripherals has, some peripherals has the same address, so they can not be used at the same time.&amp;nbsp;&amp;nbsp;&lt;br /&gt;Example, SPI0 and TWI0 share the same base address.&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638345457405v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Where in the in code is the printf() called?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Can you share you project?&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding printf() in UART caused stalling</title><link>https://devzone.nordicsemi.com/thread/341397?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 20:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:234b374c-7974-411d-ae0b-bb5f5bc3b678</guid><dc:creator>Christopher Bilal</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The RTT is enabled but &lt;span&gt;&amp;nbsp;NRF_LOG_BACKEND_UART_ENABLED&lt;/span&gt;&amp;nbsp;is not there.&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638304960936v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How should I add it?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For the SPI and TWI part, how can I know if I have the memory map issue?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding printf() in UART caused stalling</title><link>https://devzone.nordicsemi.com/thread/341193?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 08:22:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:796fd66c-5934-4f87-9f17-026a90e2f04f</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Have a look at&amp;nbsp;&amp;nbsp;NRF_LOG_BACKEND_RTT_ENABLED and NRF_LOG_BACKEND_UART_ENABLED. What is it in the sdk_config.h&lt;br /&gt;&lt;br /&gt;And could it be that you have a memory&amp;nbsp;map issue, where you have used SPI and TWI from the same address?&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/memory.html?cp=4_2_0_7_2#memorymap"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/memory.html?cp=4_2_0_7_2#memorymap&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding printf() in UART caused stalling</title><link>https://devzone.nordicsemi.com/thread/341146?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 18:11:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e444d0d4-f51b-4d26-aa8c-2e18f4819d6f</guid><dc:creator>Christopher Bilal</dc:creator><description>&lt;p&gt;I am using SDK 17.0.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I started with nrf_ble_uart and spi examples. I also added GPIOTE to trigger SPI. The program worked fine in spi but when I&amp;nbsp;added the code to uart it&amp;nbsp;can not work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding printf() in UART caused stalling</title><link>https://devzone.nordicsemi.com/thread/341007?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 09:08:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffc9ed49-7eac-4d39-aa80-02478b1cf56f</guid><dc:creator>JONATHAN LL</dc:creator><description>[quote user="Christopher Bilal"]I am using nRF52832[/quote]
&lt;p&gt;Nice&amp;nbsp;to know the HW but I was thinking about soft ware, What version of the nRF5 SDK are you using?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Did you use an example project to start working? If so what example, or could you share the project maybe?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding printf() in UART caused stalling</title><link>https://devzone.nordicsemi.com/thread/340975?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 01:06:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a771cbf9-c9e5-4204-84cf-d786befe52d1</guid><dc:creator>Christopher Bilal</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your help!&lt;/p&gt;
&lt;p&gt;I am using nRF52832.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tried to only print one buffer, but it still stalled the program.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638147938391v1.png" alt=" " /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638147966680v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding printf() in UART caused stalling</title><link>https://devzone.nordicsemi.com/thread/340060?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 12:37:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31b983f2-94b1-4f1e-8640-3eca9b6172cf</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi Chris,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What nRF5SDK are you using?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]printf(&amp;quot;TX: %x %x %x %x, RX :%x %x %x %x&amp;quot;, spi_tx_buf[0], spi_tx_buf[1], spi_tx_buf[2], spi_tx_buf[3], spi_rx_buf[0], spi_rx_buf[1], spi_rx_buf[2], spi_rx_buf[3]);[/quote]
&lt;p&gt;Have you tried to only print parts of this to se if it works?&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>