<?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>NRF51 Uart Overrun</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33871/nrf51-uart-overrun</link><description>Hi, 
 I use a GPS Modul to send data via uart to the NRF 51 and then I send the string via SPI and fatfs to the SD CArd. 
 I see the LED4 blinking and during the debugging I can see the Uart has an overrun event. The Uart has no flow control and a baud</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 May 2018 09:24:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33871/nrf51-uart-overrun" /><item><title>RE: NRF51 Uart Overrun</title><link>https://devzone.nordicsemi.com/thread/130489?ContentTypeID=1</link><pubDate>Wed, 02 May 2018 09:24:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0d96836-1bef-4706-8d1b-ad1c9e443531</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You should consider moving to nRF52 series. nRF52 series have &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/easydma.html?cp=2_1_0_9#easydma"&gt;EasyDMA&lt;/a&gt; on &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/spim.html?cp=2_1_0_30_1#concept_svj_wt2_wr"&gt;SPI&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uarte.html?cp=2_1_0_34_1#concept_l5y_hcm_wr"&gt;UART&lt;/a&gt; peripherals, allowing&amp;nbsp;the&amp;nbsp;peripherals to transmitt/receive data while CPU is busy handling other events/tasks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51 Uart Overrun</title><link>https://devzone.nordicsemi.com/thread/130195?ContentTypeID=1</link><pubDate>Sun, 29 Apr 2018 11:32:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7730e99d-3584-474c-a279-7ab8eeb93a80</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;That would require something like an RTOS, and might be too much for the limited RAM on NRF51, but YMMV.&lt;/p&gt;
&lt;p&gt;The FATFS code is rather complex and will likely only work properly when called from main(). It also expects disk read and write calls to be blocking.&lt;/p&gt;
&lt;p&gt;The only other way is to use a rather large UART buffer for the GPS data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51 Uart Overrun</title><link>https://devzone.nordicsemi.com/thread/130141?ContentTypeID=1</link><pubDate>Fri, 27 Apr 2018 14:29:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b79bed8-1636-4ec7-bfae-7bd494657360</guid><dc:creator>Epimeth</dc:creator><description>&lt;p&gt;You can see this behaviour in the example fafts sdk12.3, too.&lt;/p&gt;
&lt;p&gt;The Blinking LED 4 comes from this pieces of code, app_sdcard.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;__STATIC_INLINE void sdc_spi_transfer(uint8_t const * const p_txb,
                                      uint8_t tx_len,
                                      uint8_t * const p_rxb,
                                      uint8_t rx_len)
{
    SDC_CS_ASSERT();
    ret_code_t err_code = nrf_drv_spi_transfer(&amp;amp;m_spi, p_txb, tx_len, p_rxb, rx_len);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;with SDC_CS_ASSERT() you call from nrf_gpio.h&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_gpio_port_out_clear(reg, 1UL &amp;lt;&amp;lt; pin_number);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It is possible after calling nrf_drv_spi_transfer to return&amp;nbsp; back to main.c, without waiting? Maybe with a spi eventhandler?&lt;/p&gt;
&lt;p&gt;Because i think it is running in blocking mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51 Uart Overrun</title><link>https://devzone.nordicsemi.com/thread/130139?ContentTypeID=1</link><pubDate>Fri, 27 Apr 2018 14:21:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4653486c-5dd3-4dfa-b738-19038a32e081</guid><dc:creator>Epimeth</dc:creator><description>&lt;p&gt;You can see the behaviour in the example fatfs sdk 12.3, too.&lt;/p&gt;
&lt;p&gt;The blinking LED 4 comes from this piece of code app_sdcard.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;__STATIC_INLINE void sdc_spi_transfer(uint8_t const * const p_txb,
                                      uint8_t tx_len,
                                      uint8_t * const p_rxb,
                                      uint8_t rx_len)
{
    SDC_CS_ASSERT();
    ret_code_t err_code = nrf_drv_spi_transfer(&amp;amp;m_spi, p_txb, tx_len, p_rxb, rx_len);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;with SD_CS_ASSERT() you call&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_gpio_port_out_clear(reg, 1UL &amp;lt;&amp;lt; pin_number);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;from nrf_gpio.h&lt;/p&gt;
&lt;p&gt;It is possible to call nrf_drv_spi_tansfer and return back to the main.c without waiting? maybe with a spi event handler? Because i think it is running in blocking mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51 Uart Overrun</title><link>https://devzone.nordicsemi.com/thread/130103?ContentTypeID=1</link><pubDate>Fri, 27 Apr 2018 12:03:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:414a274e-7784-4af4-8f14-8aeae4e08883</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;It may be hard to spot with the naked eye, but you should get at least a failed checksum.&lt;/p&gt;
&lt;p&gt;In case your code silently drops NMEA sentences with a wrong check sum, the result will look and also likely work quite acceptable.&lt;/p&gt;
&lt;p&gt;Note: The reason you get UART overruns is that the SD card can take quite some time to write a sector. Expected worst case timing is in the 300ms to 1second range, and *much* longer if the card was badly fragmented.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>