<?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>NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23218/not-another-sd_ble_enable-returning-nrf_error_no_mem-error-question</link><description>Hi, I really hate to ask this question but so far I have only managed to find 2 similar questions with 0 about nrf52840. 
 I&amp;#39;m using nrf52840 S140 5.0 alpha3. 
 When calling 
 err_code = sd_ble_enable(p_ble_enable_params, &amp;amp;USER_APP_RAM_BASE);
 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 Jul 2017 09:18:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23218/not-another-sd_ble_enable-returning-nrf_error_no_mem-error-question" /><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91324?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 09:18:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59b9480d-439f-498c-94df-36426edf482b</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;I would recommend you go with the latest version of the SDK, currently 13.1.0, as it will have the latest updates and bug-fixes. With it comes Softdevice S140 5.0.0-2 alpha.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91323?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 09:13:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fef5abf-46bd-4b14-b002-d18d3f84baed</guid><dc:creator>Mitch996</dc:creator><description>&lt;p&gt;@Jørn  OK, that makes perfect sense :) which version would you reccomend me be using? The SDK13 or SDK13 alpha?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91322?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 09:03:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8d59411-3c32-41d7-930a-a44bef931a6d</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Hello Mitch. You say you&amp;#39;re using S140 5.0 alpha 3, the new release? but the sd_ble_enable function you refer to has 2 arguments, which implies you&amp;#39;re using the SDK13 alpha release. These two versions are not really compatible. One of the changes is that the sd_ble_enable function call for newer versions of the softdevice only has one arguement. There were made some significant changes between SDK 13 alpha and SDK 13. I would recommend you use the softdevice that comes with the version of the SDK you are using to ensure they are compatible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91325?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 09:00:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:042ff9be-1642-47e5-9ba7-a0b1791bb7ca</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;It looks like you are not controlling your tool chain, it is controlling you;) As far as I know LD &amp;quot;script&amp;quot; is used only in GCC (that&amp;#39;s what I use so I cannot advise on Keil, IAR and other overpriced black magic;) and that&amp;#39;s the only place where RAM regions are declared in GCC project. From there &lt;code&gt;__data_start__&lt;/code&gt; variable is filled and than usable within the code. As far as I understand Keil it doesn&amp;#39;t use LD at all but you need to use these crappy project files or GUI and edit it in project settings dialog.&lt;/p&gt;
&lt;p&gt;Your source code looks good (except second warning where you do some subtraction, that looks fishy;) so now let&amp;#39;s find the way how to make UART debug out work. Actually every SDK example should come with that enabled by default (since SDK V12.x I guess, see change logs) so if you can make it work with one then you can make it with your custom project as well...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91326?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 08:44:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4404d2b0-019c-41a0-a8d9-c1a4144fc02d</guid><dc:creator>Mitch996</dc:creator><description>&lt;p&gt;@endnode:&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t try your code, but the code I&amp;#39;m using already have something quite similar, I could be wrong:
&lt;a href="http://i.imgur.com/pEUKAfX.png"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The thing is, I don&amp;#39;t know how to use the nrflog output.&lt;/p&gt;
&lt;p&gt;Worse still, the app_ram_base and ram_start is whatever number I fill inside the magic wands iRAM, as you can also see from the code.&lt;/p&gt;
&lt;p&gt;Could it be the way I program the SD?&lt;/p&gt;
&lt;p&gt;I use nrfgo studio. the interface looks like this, may be problematic?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://i.imgur.com/bP7kFHX.png"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Should it be nrf52 or nrf5x instead of nrf51?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91330?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 06:06:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8bf3223-4852-4d76-b174-71b3300d89af</guid><dc:creator>Mitch996</dc:creator><description>&lt;p&gt;Oh, another thing, about that .ld script, what should I do with it? it has something like this in it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x21000, LENGTH = 0xdf000
  RAM (rwx) :  ORIGIN = 0x20002cc0, LENGTH = 0x3d340
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Some other questions hinted that it may also cause 0x04 error. What does it do???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91329?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 06:03:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19d2b3eb-f6c7-4a6c-a62c-dded76a774af</guid><dc:creator>Mitch996</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;If you don&amp;#39;t like this approach there are other alternatives to Nordic Soft Device (some of them complete open source) which might behave better for your special purpose...&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&amp;#39;ll pass that for now... the official nordic sd API is more than enought for me to handle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91328?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 06:03:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b17afa8-3b80-4ab0-abe8-b37b98cc4eab</guid><dc:creator>Mitch996</dc:creator><description>&lt;p&gt;@endnode&lt;/p&gt;
&lt;p&gt;Hi:)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What is then value at the address of pointer supplied as last parameter to function sd_ble_enable when it returns NRF_ERROR_NO_MEM code?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You mean what I fed into the sd_ble_enable function? I tried many, 0x20007000, 0x20002120... none of them worked.&lt;/p&gt;
&lt;p&gt;Or you mean the value at the address I supplied? It looks like completely random typical RAM stuff:
&lt;a href="http://i.imgur.com/MsuYWVr.png"&gt;http://i.imgur.com/MsuYWVr.png&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I now get what you mean by the function, I guess it has to be done that way...&lt;/p&gt;
&lt;p&gt;Anyway, I don&amp;#39;t get a changed result, what I feed into the funciton will be what I get after executing it, and since it&amp;#39;s returning a proper error code I believe the SD is properly downloaded and run.&lt;/p&gt;
&lt;p&gt;But I&amp;#39;ll see what I can do with your script, I never thought keil&amp;#39;s debug mode can be this untrustworthy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91327?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 03:17:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04478d4e-9eb1-4072-ad85-b16cd2d299b1</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;This cycle should be repeated each time you change any significant Soft Device settings (number of GAP connections or their bandwidth, GATT Server parameters such as number of custom 128-bit base UUIDs etc.)&lt;/p&gt;
&lt;p&gt;Might look cumbersome but in reality you change this setting few times a year. If you want to do some super-dynamic magic around this then you need to know what is your maximum (= most RAM demanding) configuration and use that value in your project setting at compile time (but it&amp;#39;s obvious that Nordic Soft Device is not designed for such architectures).&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t like this approach there are other alternatives to Nordic Soft Device (some of them complete open source) which might behave better for your special purpose...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91331?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 03:13:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a81eebb3-f781-447f-b183-b4faf5930461</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;What is then value at the address of pointer supplied as last parameter to function &lt;code&gt;sd_ble_enable&lt;/code&gt; when it returns &lt;code&gt;NRF_ERROR_NO_MEM&lt;/code&gt; code? I&amp;#39;m afraid you misunderstood why this procedure is needed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finding right RAM memory allocation for SD is 2-step approach.&lt;/li&gt;
&lt;li&gt;First you supply whatever value, compile the project and run it with desired Soft Device on the nRF5x chip.&lt;/li&gt;
&lt;li&gt;It fails with &lt;code&gt;NRF_ERROR_NO_MEM&lt;/code&gt; or not but in every case you want to know what is the RAM allocation which SD computed internally based on the configuration at the moment when &lt;code&gt;sd_ble_enable&lt;/code&gt; was called in your code.&lt;/li&gt;
&lt;li&gt;UART or SEGGER RTT is the best, maybe it will work in debug watch as well but I don&amp;#39;t use that. This is shown in code snippet provided above.&lt;/li&gt;
&lt;li&gt;Finally you get the RAM value, put to LD script (or elsewhere), recompile the project and you are DONE!&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91332?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2017 02:37:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1da45cb0-bccc-4134-9cd4-2d66bc87d5da</guid><dc:creator>Mitch996</dc:creator><description>&lt;p&gt;@endnode Hi Jan, thank you as always for your reply. I tried your method but sadly it&amp;#39;s the same. I think the whole debug displaying weird values issue has been solved by disabling compilation optimization.&lt;/p&gt;
&lt;p&gt;Anyway, I&amp;#39;m baffled that I still don&amp;#39;t quite get the sd_ble_enable function itself, I mean on one hand, I have to feed the right value of ram base to it for it to work, on the other hand it will tell me the right value, and both are done using the same parameter variable? That&amp;#39;s just sound all very wacky.&lt;/p&gt;
&lt;p&gt;Also, I&amp;#39;m looking for a general direction, so far all I know is the Irom and iRAM value and nothing more, and I&amp;#39;ve tried some really far out values, and it didn&amp;#39;t work. Where should I be going? Should I keep trying all those values?&lt;/p&gt;
&lt;p&gt;Also I don&amp;#39;t mind getting things done on whats app etc. ;P&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NOT ANOTHER sd_ble_enable returning NRF_ERROR_NO_MEM error Question?</title><link>https://devzone.nordicsemi.com/thread/91321?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2017 13:42:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef34dd03-4140-4ca1-abbd-0af5ff19f946</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi Mitch,&lt;/p&gt;
&lt;p&gt;If you create your local &lt;code&gt;uint32_t&lt;/code&gt; variable which is initiated to &lt;code&gt;USER_APP_RAM_BASE&lt;/code&gt; value and pass pointer to that in &lt;code&gt;sd_ble_enable&lt;/code&gt; call are you sure that it doesn&amp;#39;t contain new value after return? I don&amp;#39;t see this construct in your code so I&amp;#39;m wondering if you are still relying on the debugger instead of &lt;code&gt;printf&lt;/code&gt; code? I guess you&amp;#39;ve seen &lt;a href="https://devzone.nordicsemi.com/question/112184/trouble-updating-vendor-specific-uuid-count-on-ble-stack-init/?answer=112189#post-id-112189"&gt;recommended code sample&lt;/a&gt; how to do this (it&amp;#39;s for GCC but except variable name it should work in Keil as well)...&lt;/p&gt;
&lt;p&gt;Otherwise if you really wants Nordic guys to find the right value for you you will need to pass here all the SD parameters (and hope that someone works even during summer holidays;)&lt;/p&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>