<?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>Flash Read Issue in NRF52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12448/flash-read-issue-in-nrf52</link><description>Hi All, 
 In Flash read am facing one issue . 
 Am writing some data to Flash and trying to read back, But when I read back I get some corrupted data or am not able to read in Flash .Am using this code to test flash read timings in Heart rate Sensor</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Mar 2016 09:43:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12448/flash-read-issue-in-nrf52" /><item><title>RE: Flash Read Issue in NRF52</title><link>https://devzone.nordicsemi.com/thread/47140?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 09:43:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e7bfd2f-868d-44ca-a8f7-e57fdf4e3ac5</guid><dc:creator>Thangaraj</dc:creator><description>&lt;p&gt;Thanks a lot Aryan,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash Read Issue in NRF52</title><link>https://devzone.nordicsemi.com/thread/47139?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 09:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c7b88e4-868b-43fe-bfec-657efacbc43a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;OK, the problem was not the flash but the UART buffer. The size of the buffers is dependent on how fast you are writing and reading to/fromt he driver. It is OK to select 256 bytes of TX and RX if you have space for it. You can print as much as you want , the size of this buffer is not restricting you on how much you can log but it is restricting you how fast you can read and write to the UART driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash Read Issue in NRF52</title><link>https://devzone.nordicsemi.com/thread/47138?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 08:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:173d898a-3fbb-4654-a16e-263421155497</guid><dc:creator>Thangaraj</dc:creator><description>&lt;p&gt;Hi Aryan,&lt;/p&gt;
&lt;p&gt;I saw below comments in one of your post that helped me fix the issue,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Try to increase the value for UART_RX_BUF_SIZE and UART_TX_BUF_SIZE to a greater value so that fifo library has more space to buffer. I am not sure if this will solve the problem, but it will at least rule out insufficient buffer problem.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But still I have one question  , actually I am trying to print character by character but how this is affected by UART_TX_BUF_SIZE ...... If I need to have more logs do I need to increase the buffer still ?  DOes this buffer will also consume my RAM?&lt;/p&gt;
&lt;p&gt;Thanks for your support !!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash Read Issue in NRF52</title><link>https://devzone.nordicsemi.com/thread/47137?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 04:58:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:642d7563-5762-4bbb-b0dc-8381015d6dc3</guid><dc:creator>Thangaraj</dc:creator><description>&lt;p&gt;Yes Soft Device is enabled , am using s132 soft device . Am writing the Data before ble_stack_init() and reading after initialising services and connection parameters , and then reading .(When am reading device is neither advertising nor connected to any central, Only Initialisation is done)&lt;/p&gt;
&lt;p&gt;Hi, and I saw in documet that addres to read need to be word aligned, How can I ensure my address is word aligned ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash Read Issue in NRF52</title><link>https://devzone.nordicsemi.com/thread/47136?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 19:56:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15895cbb-5ace-41e0-aa2e-d7deb7ab9d95</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I see absolutely nothing wrong in your code except that in the last for loop where you are printing addr, you should increment addr after the printf.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for(i=0;i&amp;lt;4096;){
     printf(&amp;quot;flash data:%d %c \r\n&amp;quot;,i,*addr);
    addr++;
     i=i+4;
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is softdevice enabled while you are doing this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash Read Issue in NRF52</title><link>https://devzone.nordicsemi.com/thread/47135?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 17:31:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b533778-b0b1-424a-bc56-4c15444c9771</guid><dc:creator>Thangaraj</dc:creator><description>&lt;p&gt;Thanks for your quick response ................... !!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void flash_word_write(uint32_t * address, uint32_t value)
{
    // Turn on flash write enable and wait until the NVMC is ready:
    NRF_NVMC-&amp;gt;CONFIG = (NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos);

    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
    {
        // Do nothing.
    }

    *address = value;

    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
    {
        // Do nothing.
    }

    // Turn off flash write enable and wait until the NVMC is ready:
    NRF_NVMC-&amp;gt;CONFIG = (NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos);

    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
    {
        // Do nothing.
    }
}

static void flash_page_erase(uint32_t * page_address)
{
    // Turn on flash erase enable and wait until the NVMC is ready:
    NRF_NVMC-&amp;gt;CONFIG = (NVMC_CONFIG_WEN_Een &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos);

    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
    {
        // Do nothing.
    }

    // Erase page:
    NRF_NVMC-&amp;gt;ERASEPAGE = (uint32_t)page_address;

    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
    {
        // Do nothing.
    }

    // Turn off flash erase enable and wait until the NVMC is ready:
    NRF_NVMC-&amp;gt;CONFIG = (NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos);

    while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy)
    {
        // Do nothing.
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash Read Issue in NRF52</title><link>https://devzone.nordicsemi.com/thread/47134?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 17:12:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e376e46-eb92-4449-91db-ca9e829a5686</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Can you post the code for functions flash_page_erase and flash_word_write&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>