<?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>nRF52810 Flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95281/nrf52810-flash</link><description>Hi, 
 I have few doubts regarding the internal flash of nRF52810. I am not using SoftDevice. I am using SDK 17.1.0 
 I would like to write around 20 bytes to internal flash. I would like to use APIs &amp;quot;nrf_nvmc_write_word&amp;quot; and &amp;quot;nrf_nvmc_page_erase&amp;quot; instead</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Jan 2023 13:07:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95281/nrf52810-flash" /><item><title>RE: nRF52810 Flash</title><link>https://devzone.nordicsemi.com/thread/402813?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2023 13:07:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:472d937c-6196-4f8a-b57f-c1b2b722d84e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;From the&amp;nbsp;&lt;a class="" title="Memory" href="https://infocenter.nordicsemi.com/topic/ps_nrf52810/memory.html?cp=4_5_0_3_1"&gt;Memory&lt;/a&gt;&amp;nbsp;chapter of the PS:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;The same physical RAM is mapped to both the Data RAM region and the Code RAM region. It is up to the application to partition the RAM within these regions so that one does not corrupt the other.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In other words, the code RAM and the data RAM are both pointing to the same 24K of RAM in HW. The&amp;nbsp;difference is which memory bus the CPU will use to access it. Data ram is&amp;nbsp;on&amp;nbsp;the System Bus, while code RAM is&amp;nbsp;on DCODE and IDCODE:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1672664238632v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;It is possible to execute code from Data RAM as well, but it will introduce wait states and have a negative impact on the performance (worse than FLASH).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 Flash</title><link>https://devzone.nordicsemi.com/thread/402809?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2023 12:35:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a776461-a4b4-4764-abe7-dff943625239</guid><dc:creator>DanisXZ</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;Thank you for your reply.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/95281/nrf52810-flash/402793"]&lt;p&gt;4.&amp;nbsp; Code RAM can be used to execute code from.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;The datasheet says that nRF52810 has 24 KB RAM,&amp;nbsp;why is it not mentioning 48 KB (data RAM + Code RAM) ?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1672661968706v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Did you mean that there is 48 KB of RAM in total and we can execute the code from &amp;quot;CODE RAM&amp;quot;, if needed ? Sorry for the basic questions, but could you please explain the differences ? Are we utilising this space (CODE RAM) in any of the SDK examples ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52810 Flash</title><link>https://devzone.nordicsemi.com/thread/402793?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2023 11:31:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:339c7bba-70d2-4337-a8cf-526bdaa1e232</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. The only way to really find out is to read back what you have just written to see if it matches what you wrote. You may also consider appending a checksum value to your flash data to allow your application to validate the integrity of it if you plan to exceed 10000 write/erase cycles.&lt;/p&gt;
&lt;p&gt;I believe the most typical failure mode for a worn-out flash page is that &amp;quot;random&amp;quot; bits become stuck in one position after an erase or write cycle.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. In practice you can use any page which is not occupied by your FW.&amp;nbsp; In the &lt;a title="Flash Write Example" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/flashwrite_example.html?cp=8_1_4_6_11"&gt;Flash Write Example&lt;/a&gt;, we use the last flash page.&lt;/p&gt;
&lt;p&gt;3. You will not be prevented from overwriting application code unless you use the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52810/bprot.html?cp=4_5_0_5_2"&gt;BPROT — Block protection&lt;/a&gt;&amp;nbsp;peripheral, but it will lead to undefined behavior depending on what you overwrite.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;4.&amp;nbsp; Code RAM can be used to execute code from.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>