<?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>Can&amp;#39;t run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29049/can-t-run-modified-nrf51-dk-example-on-custom-board</link><description>Hi.
I took the ble_central/experimental/ble_app_blinky_c example and modified it for my needs. It works on the nrf51-DK.
Now I want to use it on a custom board with nrf51822qfab.
I modified the Makefile in the following way: 
 changed LINKER_SCRIPT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Jan 2018 14:37:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29049/can-t-run-modified-nrf51-dk-example-on-custom-board" /><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115093?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2018 14:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:016c264e-8df9-46d8-9263-762d381d0294</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I think you should add a new question and link to this one if relevant.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115092?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2018 17:13:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffee924f-90c4-4f41-b2b7-47d8195610fc</guid><dc:creator>nordic_fan</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am trying to run experimental_ble_blinky from SDK 12.3 on my custom board having nRF51822QFAA. My starting example .ld file is from PCA10028 (armgcc folder) but i am not able to get it working. I am expecting nRF connect app on my phone to be able scan and discover. However i am not finding it. When i use Eclipsce-Jlink-GDB i am seeing it is not returning from ble_stack_init particularly stuck at softdevice_enable(&amp;amp;ble_enable_params);&lt;/p&gt;
&lt;p&gt;Based on various forum inputs tried the following- tried a example without soft device. Just blinky and it worked&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Checked basic clock input 16Mhz using code below and found 16M clock source is good NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&lt;/p&gt;
&lt;p&gt;while (!NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED);&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Custom board doesnt have external 32Khz crystal Tried changing nrf_clk_lf_cfg as below and didnt help&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;// example default nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC; nrf_clock_lf_cfg_t clock_lf_cfg = { .source = NRF_CLOCK_LF_SRC_RC,&lt;/p&gt;
&lt;p&gt;.rc_ctiv = 4, // Check temperature every 4 * 250ms&lt;/p&gt;
&lt;p&gt;.rc_temp_ctiv = 1, // Only calibrate if temperature has changed. };&lt;/p&gt;
&lt;p&gt;// Initialize the SoftDevice handler module.&lt;/p&gt;
&lt;p&gt;SOFTDEVICE_HANDLER_INIT(&amp;amp;clock_lf_cfg, NULL);&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Called sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE); as first funcion inside main() and didnt help either.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I am using s130_nrf51_2.0.1_softdevice.hex and .ld script looks this way&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;MEMORY&lt;/p&gt;
&lt;p&gt;{ FLASH (rx) : ORIGIN = 0x0001B000, LENGTH = 0x25000&lt;/p&gt;
&lt;p&gt;RAM (rwx) : ORIGIN = 0x20001870, LENGTH = 0x2790 }&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I have a micro:bit hardware as well. The behaviour is very similar there as well though i am using Kiel&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Would be grateful for any solution/pointers. Stuck here for past few days.&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115090?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 11:08:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b0fd734-3970-4764-8bbb-3f70fafa0fe0</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Then you should be able to get RTT logging from that. Or you could just put a breakpoint in softdevice_enable(), after sd_ble_enable(), and check the value of app_ram_base. That should be your RAM starting point. You could also run the code on the nRF51 DK first.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115091?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 17:15:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:878ea05d-c6a5-4287-84f2-292ea74d6ccd</guid><dc:creator>M</dc:creator><description>&lt;p&gt;I program my board using the external interface (connector P20) on the nrf51-DK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115089?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 09:20:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f00f34e-2b64-4047-82dd-26038738a7bc</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;I guess you program your board using a programmer/debugger? RTT uses the debug pins for logging. All you need is to connect a jlink debugger like the one on the nRF5x DK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115088?ContentTypeID=1</link><pubDate>Sat, 18 Feb 2017 16:46:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a02f08ea-8c1a-4aa2-b112-0550607edd3b</guid><dc:creator>M</dc:creator><description>&lt;p&gt;This means that I have to run my code on the nrf51-DK first, because my board has no outputs...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115086?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2017 09:42:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e175b62b-eb03-47ac-992a-d4f5f7349d1d</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You should use the RAM settings from the example to start with. The code will log (on UART or RTT) if you have allocated too much RAM or too little RAM (in the latter you will also go to the error handler). So if you later change things such that you need a different amount of RAM you will be noticed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115087?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2017 19:41:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1329af57-6d2c-496f-8804-7045d8cff8e8</guid><dc:creator>M</dc:creator><description>&lt;p&gt;So as a general rule, every example that I use on my board, I need to copy the RAM settings (adjusted to 128K device) from the example&amp;#39;s script?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115084?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 14:10:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5c07eb0-a535-4d94-b435-e1fbd49a26ce</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The newer SoftDevices has a flexible RAM scheme, so the SoftDevice RAM consumption will vary from application to application depending on how large the ATTribute table is (how many and how large services), how many connection it can have, the banbwidth configuration and so on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115085?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 13:35:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2359c95d-73ed-4c74-9a41-d7b7039e630f</guid><dc:creator>M</dc:creator><description>&lt;p&gt;I changed the .rc values to 16.
Why there is a difference in RAM origin between this script and the one from your previous answer? Isn&amp;#39;t there a &amp;quot;one script that works with every code&amp;quot; on a given device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115083?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 13:17:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ca48544-d051-41e6-9ebb-c8f4b7242455</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Did you also changed the size of the FLASH and RAM? The RAM should be 0x4000 (16K) less and the FLASH should be 0x20000 (128K) less (compared to &lt;a href="https://github.com/NordicSemiconductor/nrf51-ble-tutorial-service/blob/master/SDK%2011.0.0/nrf5-ble-tutorial-service/pca10028/s130/armgcc/nrf5-ble-tutorial-service.ld"&gt;this&lt;/a&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x5000
  RAM (rwx) :  ORIGIN = 0x20002080, LENGTH = 0x1f80
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Did you also set the &lt;code&gt;.rc_ctiv&lt;/code&gt; and &lt;code&gt;.rc_temp_ctiv&lt;/code&gt; in addition to &lt;code&gt;NRF_CLOCK_LF_SRC_RC&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115082?ContentTypeID=1</link><pubDate>Sat, 04 Feb 2017 23:39:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30412364-937c-4489-b35b-43dcf6fc6531</guid><dc:creator>M</dc:creator><description>&lt;p&gt;Hi. Didn&amp;#39;t want to open a new thread, because I have the same issue with a different example. This time it&amp;#39;s the &amp;quot;BLE Services, a beginner&amp;#39;s tutorial&amp;quot;. The code runs on the nrf51-DK but gets stuck (reset?) on the same SOFTDEVICE_HANDLER_INIT line. I use the same linker script as was suggested here and the clock is set to NRF_CLOCK_LF_SRC_RC. What is the problem this time? Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115081?ContentTypeID=1</link><pubDate>Fri, 13 Jan 2017 11:37:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5398a1a5-ce72-4197-b1be-4c2cfde3aa30</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;No problem. Can you mark the answer as correct (grey checkmark under the arrows) so that others can find the correct solution?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115080?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2017 18:30:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e5af9df-8672-4ad1-bb23-e2f136151124</guid><dc:creator>M</dc:creator><description>&lt;p&gt;I&amp;#39;m happy to say that your suggestion regarding the linker script helped. It works now. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115079?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2017 15:08:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ff79428-fc5d-490b-bd98-b00ffafa8026</guid><dc:creator>M</dc:creator><description>&lt;p&gt;Ok.
If I pass the same parameters to SOFTDEVICE_HANDLER_INIT as described in the thread I mentioned, should this function at least return with/without an error and continue running?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115078?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2017 14:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ffbee92-050b-45ba-957b-ce94283c0646</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The clock settings passed in the SOFTDEVICE_HANDLER_INIT(..) function is for the low frequency clock (LFCLK/32Khz clock). Here you can choose between using a crystal (if one is on the custom board) and the internal RC oscillator.&lt;/p&gt;
&lt;p&gt;When it comes to the high frequency clock (HFCLK/16MHz), it is required to use the crystal for the radio and hence required for bluetooth. If you use the internal oscillator for the LFCLK it will use the HFCLK crystal to calibrate itself. If the crystal does not work correctly, for example the load capacitors are wrong value, then the code may stop in the SOFTDEVICE_HANDLER_INIT(..) function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115077?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2017 13:35:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07115b03-71e7-472a-a54d-7ba2fbf83c02</guid><dc:creator>M</dc:creator><description>&lt;p&gt;Hi Ole.
I will check this later today.
How about the thread I referred to? If I understood it correctly, the guy had some issues with his crystal, so he used the chip&amp;#39;s internal(?) oscillator to make it work temporary. That&amp;#39;s what I was trying to do myself as a last resort, without success.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't run modified nrf51-DK example on custom board</title><link>https://devzone.nordicsemi.com/thread/115076?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2017 13:24:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:651ac9c5-d01f-45ee-a2d4-bd877b40006e</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You are sure the 16MHz crystal is working correctly? You can test this with this code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;    
while (!NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the code continuous after the while loop, then it is working.&lt;/p&gt;
&lt;p&gt;The qfab chip has 128 KB of flash and 16 KB of RAM, is the FLASH and RAM LENGTH in the linker script changed to this?:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x5000
  RAM (rwx) :  ORIGIN = 0x20001eb0, LENGTH = 0x2150
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>