<?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>MetaWear custom firmware</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11360/metawear-custom-firmware</link><description>Hello, I am trying to upload my custom firmware to the MetaWear RG (nrf51822) platform but currently without luck. Steps that I have performed: 
 
 Connected to the device using the debug out of the nRF51DK as described here 
 Uploaded Softdevice S130</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Jul 2016 14:54:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11360/metawear-custom-firmware" /><item><title>RE: MetaWear custom firmware</title><link>https://devzone.nordicsemi.com/thread/42789?ContentTypeID=1</link><pubDate>Mon, 11 Jul 2016 14:54:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1e3b764-1cd3-422b-a946-dfd473007a3e</guid><dc:creator>Tanasis!</dc:creator><description>&lt;p&gt;For people that haven&amp;#39;t figured this out yet, in order to port your work to any custom hardware you need to know&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Flash/RAM size of the nRF chip and the SoftDevice version. Based on that, the correct information needs to be passed in the linker&lt;/li&gt;
&lt;li&gt;the use of internal/external clock and the clock-frequency. This information is used to adapt:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;the &lt;code&gt;system.nrf51.c&lt;/code&gt; file&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;in case of external clock also explicitly enable it the beginning of the program in main:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   int main(void)
   {
       // Set the external high frequency clock source to 32 MHz
       NRF_CLOCK-&amp;gt;XTALFREQ = 0xFFFFFF00;

       // Start the external high frequency crystal
       NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
       NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;

       // Wait for the external oscillator to start up
       while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0) {}

       while (true) {
           // run application
       }
   }
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more details on this read the following: &lt;a href="http://turlucode.com/metwear-custom-ble-firmware/"&gt;turlucode.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MetaWear custom firmware</title><link>https://devzone.nordicsemi.com/thread/42786?ContentTypeID=1</link><pubDate>Sun, 17 Jan 2016 16:34:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb48175c-2605-4f1d-906a-84e76cc8a058</guid><dc:creator>Tanasis!</dc:creator><description>&lt;p&gt;Good point on the Softdevice! You are right!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;nRF51DK: nrf51422 QFAC (256KB flash and 32KB RAM)&lt;/li&gt;
&lt;li&gt;MetaWear: nrf51822 (256KB flash and 16KB RAM) - Taiyo Yuden &lt;a href="http://www.digikey.nl/en/product-highlight/t/taiyo-yuden/eysfcnzxx-bluetooth-low-energy-module"&gt;EYSFCNZXX&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So I can see a difference on the RAM. This is the size of the current app:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   text	   data	    bss	    dec	    hex	filename
  66200	    268	   4284	  70752	  11460	build/nrf51422_xxac_s130.elf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You are saying that &amp;quot;your stack is being put in a place there&amp;#39;s no actual memory.&amp;quot;. But why would or is that happening? How can I check this? thx!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MetaWear custom firmware</title><link>https://devzone.nordicsemi.com/thread/42785?ContentTypeID=1</link><pubDate>Sun, 17 Jan 2016 16:00:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdb1f223-57f4-4787-8f49-becc4c1e548c</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;If you haven&amp;#39;t started the softdevice then there&amp;#39;s no issue debugging. In fact just enabling it is fine, only after you start advertising or get in a connection, then you have issues, you&amp;#39;re far from there.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re not even starting then it has nothing to do with the crystal. The chip begins running from the internal RC oscillator until the crystal one is enabled. What exact chip revision do you have on your development board and what exact chip revision is there on the Metaware? Not impossible that you&amp;#39;re building for a chip with a different amount of RAM and so your stack is being put in a place there&amp;#39;s no actual memory.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MetaWear custom firmware</title><link>https://devzone.nordicsemi.com/thread/42788?ContentTypeID=1</link><pubDate>Sun, 17 Jan 2016 15:47:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c71e29cf-c184-4f00-ad7b-4082292eeb2b</guid><dc:creator>Tanasis!</dc:creator><description>&lt;p&gt;atm, as far as I can understand, the application is not even starting. To check that - &lt;strong&gt;first&lt;/strong&gt; - I used &lt;a href="https://devzone.nordicsemi.com/tutorials/6/debugging-with-real-time-terminal/"&gt;Segger&amp;#39;s RTT&lt;/a&gt; to print a &amp;quot;hello&amp;quot; right when the main starts and - &lt;strong&gt;secondly&lt;/strong&gt; - I tried to use gdb. With gdb I get:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(gdb) continue 
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xfffffffe in ?? ()
(gdb) where
#0  0xfffffffe in ?? ()
#1  &amp;lt;signal handler called&amp;gt;
#2  0x00000000 in ?? ()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What&amp;#39;s more, gdb, &lt;a href="https://devzone.nordicsemi.com/question/1489/can-i-debug-ble-program/#reply-1504"&gt;if I understood correctly&lt;/a&gt;, comes with a limitation when using a softdevice (my case). So it is really hard to debug this situation. Maybe any ideas on how to debug this?&lt;/p&gt;
&lt;p&gt;Note that the RTT method works perfectly with the rRF51DK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MetaWear custom firmware</title><link>https://devzone.nordicsemi.com/thread/42787?ContentTypeID=1</link><pubDate>Sun, 17 Jan 2016 12:51:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50366b3f-958b-4056-a948-f1b6009e4ce3</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well how far through that code do you get? If the HFCLK starts then you know that&amp;#39;s not the problem, ie if you get to &lt;code&gt;run application&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>