<?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>RAM Retention Troubleshooting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120962/ram-retention-troubleshooting</link><description>Hello, 
 I was given an existing code with a possible bug in it relating to RAM retention and I&amp;#39;m trying to make sense of what I&amp;#39;m seeing. I am using NRF52832 with SDK 17.0.1 and SoftDevice S112. 
 In the code, before entering system OFF mode, a request</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Apr 2025 15:07:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120962/ram-retention-troubleshooting" /><item><title>RE: RAM Retention Troubleshooting</title><link>https://devzone.nordicsemi.com/thread/533243?ContentTypeID=1</link><pubDate>Mon, 28 Apr 2025 15:07:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80624380-bbf5-43e8-894f-1323f7ac54bf</guid><dc:creator>EyalR</dc:creator><description>&lt;p&gt;I spoke to an embOS representative and they indeed confirmed that&amp;nbsp;&lt;span&gt;OS_InitKern() initializes RAM section that is defined as stack, which just happens to be RAM7 section 1 in my implementation. I&amp;#39;ll mark this as answered, thanks for the help&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM Retention Troubleshooting</title><link>https://devzone.nordicsemi.com/thread/533136?ContentTypeID=1</link><pubDate>Mon, 28 Apr 2025 08:30:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a79c55f3-795b-49bf-8de0-177fdcd37af1</guid><dc:creator>EyalR</dc:creator><description>&lt;p&gt;No I can&amp;#39;t access that function, nor do I see any specific details about it in embOS guide. I can only assume there is some different memory map\linker file for embOS in the project files.&lt;/p&gt;
&lt;p&gt;Do you have any idea why writing to&amp;nbsp;&lt;span&gt;0x2000F000 causes system crash but writing to&amp;nbsp;0x2000F001 is fine?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM Retention Troubleshooting</title><link>https://devzone.nordicsemi.com/thread/533129?ContentTypeID=1</link><pubDate>Mon, 28 Apr 2025 07:40:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28c9b21d-e617-49ab-bc58-905a90c2ec21</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Okay, then it does indeed sound like something is trying to initialize this part of the RAM somewhere, but not being well versed in embOS, it&amp;#39;s difficult to pinpoint where that might be, and I guess it will be for you as well if you didn&amp;#39;t write the code/project in the first place. Are you able to see where the RAM is initialized exactly?&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: RAM Retention Troubleshooting</title><link>https://devzone.nordicsemi.com/thread/533102?ContentTypeID=1</link><pubDate>Sun, 27 Apr 2025 11:26:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2df1004d-b648-4027-9838-626abe7197ce</guid><dc:creator>EyalR</dc:creator><description>&lt;p&gt;I managed to see now that RAM is indeed retained but after the call to&amp;nbsp;OS_InitKern(), which is the very first line of code, the RAM is then initialized to 0xCDCDCDCD. I assume then that this is an embOS related issue. We are using embOS-Safe in our project&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM Retention Troubleshooting</title><link>https://devzone.nordicsemi.com/thread/533098?ContentTypeID=1</link><pubDate>Sun, 27 Apr 2025 07:10:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf603eaf-37e2-45ab-8da2-47ddfe06c407</guid><dc:creator>EyalR</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Currently 48k out of 64k RAM is used when building the project.&lt;br /&gt;I&amp;#39;ve attached the RAM breakdown from the build. I&amp;#39;m looking into RAM7 Section 1 which starts at 0x2000F000&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2025_2D00_04_2D00_27-095636.png" /&gt;&lt;/p&gt;
&lt;p&gt;When is this heap initialization&amp;nbsp;to 0xCDCDCDCD happening? It persists through reset so it&amp;#39;s not just from the initial build.&lt;/p&gt;
&lt;p&gt;About what the device does, it has BLE capabilities&amp;nbsp;but specifically in the section I am testing the BLE task isn&amp;#39;t running and GAP and such aren&amp;#39;t even initialized.&lt;/p&gt;
&lt;p&gt;Before going to sleep the device saves an expected wake up reason to&amp;nbsp;GPREGRET. It then goes to sleep and I wake it up by GPIO by pressing a button. The device wakes up, initializes embOS, and then compares the wake up reason from&amp;nbsp;RESETREAS to the one retained in&amp;nbsp;&lt;span&gt;GPREGRET. If it doesn&amp;#39;t match then it goes back to sleep. Part of the going to sleep routine is also to retain RAM7 section 1. The device does many other things but this is the current functionality that I&amp;#39;m testing.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;About using the example, like I said this is not my code. Someone else wrote it and we&amp;#39;ve discovered a bug and now I&amp;#39;m trying to reverse engineer it - I don&amp;#39;t have the option to start a new project based on an example because this is an existing device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM Retention Troubleshooting</title><link>https://devzone.nordicsemi.com/thread/532994?ContentTypeID=1</link><pubDate>Fri, 25 Apr 2025 11:22:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbe5ffef-d397-43c2-b4ad-fe34e4f45c6e</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;When building your application, how much RAM does the application itself take?&amp;nbsp;I think somewhere in your application you have reserved the area you&amp;#39;re trying to write to. 0xCDCDCDCD is used by C/C++ malloc() to mark uninitialized heap memory, so that could be a point in the right direction. Have you used the RAM retention example project in the SDK for reference or are you implementing the RAM retention &amp;quot;free hand&amp;quot;?&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ram_retention_example.html"&gt;https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ram_retention_example.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;d strongly suggest you refer to the RAM retention sample, and then trying to implement it step by step and see at what point it crashes. What else than RAM retention does your project do? I assume you do some radio operations as well since you are using the SoftDevice.&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></channel></rss>