<?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>SOFTDEVICE: INVALID MEMORY ACCESS. error coming up while doing erase operation in NRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45479/softdevice-invalid-memory-access-error-coming-up-while-doing-erase-operation-in-nrf52832</link><description>Hi, 
 I am using a custom NRF52832 board. I am using Nordic SDK + BLE code, and whenever I am trying to do an erase of flash memory with start address as 0x70000 and end address as 0x70100, I am getting &amp;quot;SOFTDEVICE: INVALID MEMORY ACCESS&amp;quot; error. I checked</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Mar 2019 07:07:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45479/softdevice-invalid-memory-access-error-coming-up-while-doing-erase-operation-in-nrf52832" /><item><title>RE: SOFTDEVICE: INVALID MEMORY ACCESS. error coming up while doing erase operation in NRF52832</title><link>https://devzone.nordicsemi.com/thread/179116?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 07:07:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d748a1ad-f698-4efe-b88f-462bc875bbe7</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;This function takes page number, so you have give page number as input and not start address.&lt;/p&gt;
&lt;p&gt;Each page is 4kB, and your start address is 0x70000 which in kB is 458 752 in decimal which is 448 kB.&lt;/p&gt;
&lt;p&gt;448 kB / 4 = 112.&lt;/p&gt;
&lt;p&gt;Try to use sd_flash_page_erase(112);&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SOFTDEVICE: INVALID MEMORY ACCESS. error coming up while doing erase operation in NRF52832</title><link>https://devzone.nordicsemi.com/thread/178944?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 13:27:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d913bdc3-bd97-4937-a0f6-f3aacca64ede</guid><dc:creator>Srivisakh</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;I tried using sd_flash_page_erase() function and was getting the error as &amp;quot;NRF_ERROR_INVALID_ADDR&amp;quot;. I checked and provided the start address as&amp;nbsp;&lt;span&gt;0x70000 in the&amp;nbsp;nrf_fstorage_t&amp;#39;s start_addr element, but still I was getting the invalid address error.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kindly give your insights on this issue.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SOFTDEVICE: INVALID MEMORY ACCESS. error coming up while doing erase operation in NRF52832</title><link>https://devzone.nordicsemi.com/thread/178932?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 12:47:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e948741-91b6-4763-a9c9-36c684e51a13</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;You cannot use &lt;strong&gt;nrf_nvmc_page_erase()&lt;/strong&gt; when you use the SoftDevice.&lt;/p&gt;
&lt;p&gt;You have to use &lt;strong&gt;sd_flash_page_erase():&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**@brief Flash Erase page
*
* Commands to erase a flash page
* If the SoftDevice is enabled:
*  This call initiates the flash access command, and its completion will be communicated to the
*  application with exactly one of the following events:
*      - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed.
*      - @ref NRF_EVT_FLASH_OPERATION_ERROR   - The command could not be started.
*
* If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the
* erase has been completed
*
* @note
*      - This call takes control over the radio and the CPU during flash erase and write to make sure that
*        they will not interfere with the flash access. This means that all interrupts will be blocked
*        for a predictable time (depending on the NVMC specification in the device&amp;#39;s Product Specification
*        and the command parameters).
*      - This call will make the SoftDevice trigger a hardfault when the page is erased, if it is
*        protected.
*
*
* @param[in]  page_number           Page number of the page to erase
*
* @retval ::NRF_ERROR_INTERNAL      If a new session could not be opened due to an internal error.
* @retval ::NRF_ERROR_INVALID_ADDR  Tried to erase to a non existing flash page.
* @retval ::NRF_ERROR_BUSY          The previous command has not yet completed.
* @retval ::NRF_ERROR_FORBIDDEN     Tried to erase a page outside the application flash area.
* @retval ::NRF_SUCCESS             The command was accepted.
*/
SVCALL(SD_FLASH_PAGE_ERASE, uint32_t, sd_flash_page_erase(uint32_t page_number));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>