<?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>Failure access to internal flash when enabling Soft device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89867/failure-access-to-internal-flash-when-enabling-soft-device</link><description>Good day Nordic people, I am facing a problem when erasing or writing to internal flash memory after enabling softdevice. here the details and tests: Setup: - GCC, arm toolchain, make files under linux OS. Visual studio code for editing. Exact problem</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Jul 2022 09:10:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89867/failure-access-to-internal-flash-when-enabling-soft-device" /><item><title>RE: Failure access to internal flash when enabling Soft device</title><link>https://devzone.nordicsemi.com/thread/378023?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 09:10:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04a44f3f-8065-4f5f-ae8b-3fbe91a7b18a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;No, that&amp;#39;s not possible. SD_... functions are SoftDevice functions that the SoftDevice calls and manages, so disabling the SoftDevice won&amp;#39;t let you use any of these functions. I don&amp;#39;t see how it makes sense to disable the SoftDevice in the middle of your application at all, and I do not recommend doing so.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure access to internal flash when enabling Soft device</title><link>https://devzone.nordicsemi.com/thread/377937?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2022 17:50:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b98bdb50-7fe0-4ed9-9015-7a82f94a3026</guid><dc:creator>Hossam </dc:creator><description>&lt;p&gt;Hi Simon,&amp;nbsp;&lt;br /&gt;Almost solved my issue, i have one question:&lt;br /&gt;is that possible to disable softdevice inside an ISR and then can use SD_FLASH_ERASE function? if possible, how is that with a tested case please.&lt;br /&gt;&lt;br /&gt;my best&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure access to internal flash when enabling Soft device</title><link>https://devzone.nordicsemi.com/thread/377371?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2022 09:10:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06e39fb3-a5a8-4e02-b906-7761e5f1faa5</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What SDK are you using exactly? I think it&amp;#39;s not recommended to do flash operation inside interrupts like this, especially in applications with the SoftDevice, since the SoftDevice has higher priority than most other peripherals/functions and may at any time interrupt operations like this to do something time critical.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure access to internal flash when enabling Soft device</title><link>https://devzone.nordicsemi.com/thread/377134?ContentTypeID=1</link><pubDate>Fri, 15 Jul 2022 09:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f3955b2-170b-45b2-8d2c-9721bec8db3e</guid><dc:creator>Hossam </dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;Partially, I solved this problem and i am planning to post it here, may help some body else.&lt;br /&gt;Now I have &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;internal error event&lt;/strong&gt;&lt;/span&gt; when doing flash operation inside interrupt function like GPIO handler?.&lt;br /&gt;I am using &lt;span style="background-color:#ff0000;"&gt;&lt;strong&gt;interrupt sdh dispatch model &lt;/strong&gt;&lt;span style="background-color:#ffffff;"&gt;, I tried&lt;/span&gt;&lt;strong&gt; appsch_SDH_dispatch &lt;span style="background-color:#ffffff;color:#000000;"&gt;and got the same result.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="background-color:#ffffff;"&gt;BTW, return code is NRF_SUCCESS, so function call is fine&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;strong&gt;I think it is because GPIO handler is calling SVC by calling SD operation, so is there any way to work around without making a lot of changes?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:#ffffff;"&gt;regards&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure access to internal flash when enabling Soft device</title><link>https://devzone.nordicsemi.com/thread/376885?ContentTypeID=1</link><pubDate>Thu, 14 Jul 2022 06:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a027460-13f7-4874-8ef8-f5ee74c8d05e</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Are you able to see any error message from the &amp;quot;thrown&amp;quot; exception? Since the address is in the SoftDevice I would assume there is an &lt;strong&gt;sd_()&lt;/strong&gt; function returning an error in your application that might shed some light on what exactly is happening.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure access to internal flash when enabling Soft device</title><link>https://devzone.nordicsemi.com/thread/376642?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 13:49:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57ab3c3b-4274-4719-b07b-3eb73c133e85</guid><dc:creator>Hossam </dc:creator><description>&lt;p&gt;Hi Simon,&amp;nbsp;&lt;br /&gt;sure, it is a precaution to check the address. I have divided the memory in a custom linker file and i am accessing 0xf4000.&lt;br /&gt;here is memory partitions:&lt;/p&gt;
&lt;p&gt;_TOTAL_MEMORY_SIZE = 1024K;&lt;/p&gt;
&lt;p&gt;_SOFT_DEVICE_MEMORY_START = 0x00000000;&lt;br /&gt;_SOFT_DEVICE_MEMORY_LENGTH = 156K;&lt;br /&gt;_SOFT_DEVICE_END = _SOFT_DEVICE_MEMORY_START + _SOFT_DEVICE_MEMORY_LENGTH;&lt;/p&gt;
&lt;p&gt;_APP_MEMORY_START = _SOFT_DEVICE_END;&lt;br /&gt;_APP_MEMORY_SIZE = 400K;&lt;br /&gt;_APP_MEMORY_END = _APP_MEMORY_START + _APP_MEMORY_SIZE;&lt;br /&gt;&lt;br /&gt;_APP_FDS_START = _APP_MEMORY_END;&lt;br /&gt;_APP_FDS_SIZE = 28K;&lt;br /&gt;_APP_FDS_END = _APP_FDS_START + _APP_FDS_SIZE;&lt;/p&gt;
&lt;p&gt;_FUOTA_IMAGE_START = _APP_FDS_END;&lt;br /&gt;_FUOTA_IMAGE_SIZE = 392k;&lt;br /&gt;_FUOTA_IMAGE_END = _FUOTA_IMAGE_START + _FUOTA_IMAGE_SIZE;&lt;/p&gt;
&lt;p&gt;_APP_DATA_START = _FUOTA_IMAGE_END;&lt;br /&gt;_APP_DATA_SIZE = 20K;&lt;br /&gt;_APP_DATA_END = _APP_DATA_START + _APP_DATA_SIZE;&lt;/p&gt;
&lt;p&gt;_BOOTLOADER_MEMORY_START = _APP_DATA_END;&lt;br /&gt;_BOOTLOADER_LENGTH = 28K;&lt;br /&gt;_BOOT_ONLY_BOOTLOADER_MEMORY_END = _BOOTLOADER_MEMORY_START + _BOOTLOADER_LENGTH;&lt;br /&gt;&lt;br /&gt;_FLASH_MEMORY_END = _SOFT_DEVICE_MEMORY_START + _TOTAL_MEMORY_SIZE;&lt;/p&gt;
&lt;p&gt;MEMORY&lt;br /&gt;{&lt;br /&gt; FLASH (rx) : ORIGIN = _APP_MEMORY_START, LENGTH = _APP_MEMORY_SIZE&lt;br /&gt; RAM (rwx) : ORIGIN = 0x20002A48, LENGTH = 0x3D5B8&lt;br /&gt; CODE_RAM (rwx) : ORIGIN = 0x800000, LENGTH = 0x40000&lt;br /&gt; /*EXTFLASH (rx) : ORIGIN = 0x12000000, LENGTH = 0x8000000*/&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- SDK 17.0.2&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure access to internal flash when enabling Soft device</title><link>https://devzone.nordicsemi.com/thread/376633?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 13:32:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce871459-86c5-4996-92cf-5c6dc6519891</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you checked what address you try to write to? If you try to write to an address occupied by the SoftDevice an error like this is likely to occur.&amp;nbsp;What SDK are you using for development? The SoftDevice takes up flash up until ~0x26000. This varies depending on what SDK version you&amp;#39;re using.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure access to internal flash when enabling Soft device</title><link>https://devzone.nordicsemi.com/thread/376606?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 12:33:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05f2fd47-a7f3-402a-83e7-721a77e0ac21</guid><dc:creator>Hossam </dc:creator><description>&lt;p&gt;add to testing: &lt;br /&gt;I have checked &lt;span style="background-color:#ff0000;"&gt;&lt;strong&gt;ACL registers&lt;/strong&gt;&lt;/span&gt; and all are containing 0&amp;#39;s values which means no memory protection.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>