<?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>UART printf stops in spi_event_handler function</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16487/uart-printf-stops-in-spi_event_handler-function</link><description>Hi, 
 Hope this is not a duplicate post. I am using nRF52832 and SDK Ver 11 and am facing the following issue: 
 After configuring the UART and SPI, I put a string e.g. &amp;quot;start...&amp;quot; in the printf function. Immediately after that the SPI function and then</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Sep 2016 09:43:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16487/uart-printf-stops-in-spi_event_handler-function" /><item><title>RE: UART printf stops in spi_event_handler function</title><link>https://devzone.nordicsemi.com/thread/63115?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 09:43:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5a98081-13e8-4bc8-b410-05670fc4f634</guid><dc:creator>Vala</dc:creator><description>&lt;p&gt;Thanks for your answer Aryan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART printf stops in spi_event_handler function</title><link>https://devzone.nordicsemi.com/thread/63114?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2016 11:22:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b699147f-08e5-467d-ba3c-8c1b535fc1a4</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Printf uses UART and depending on what drivers you are using it can be blocking or non blocking.
In SDK6, using simple_uart.c API in retarget.c made printf blocking because then UART did not use any interrupts and waited until it sends/receives a byte.&lt;/p&gt;
&lt;p&gt;But at later SDKs UART drivers and libraries became asynchronous using their interrupt handlers.&lt;/p&gt;
&lt;p&gt;Since you are using SDK11 so you are using app_uart with fifo.  Then the UART irq priority will be defined in the nrf_drv_config.h file&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define UART0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If SPI drivers are using APP_IRQ_PRIORITY_HIGH then you will be able to write to fifo but the actual write to uart will be delayed as data is written synchronously byte by byte through the ISR.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>