<?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>Cann&amp;#39;t run the BLE code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10472/cann-t-run-the-ble-code</link><description>Hi 
 I met a problem when I use my new board,I found that the example in the peripheral folder in SDK can run correctlly,but the the example in the ble_peripheral folder cann&amp;#39;t work.Afterwards，I found that it is because the ble_stack_init() function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Nov 2015 09:43:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10472/cann-t-run-the-ble-code" /><item><title>RE: Cann't run the BLE code</title><link>https://devzone.nordicsemi.com/thread/38914?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2015 09:43:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bc0dba2-715d-4ca8-a8e9-559e765c74c7</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You can step into ble_stack_init(), it&amp;#39;s a function. How far through there do you get before it goes to the hardfault handler? It sounds like your previous reply, &amp;quot;yes it calls an error handler&amp;quot; wasn&amp;#39;t what you meant, it goes straight to the Hardfault handler.&lt;/p&gt;
&lt;p&gt;Hardfault is not a hardware fault. It&amp;#39;s what you get for accessing memory which doesn&amp;#39;t exist, doing unaligned reads and writes and a variety of other things. You can pick apart the stack and figure out where you were when you went there, but it&amp;#39;s tricky (but good practice).&lt;/p&gt;
&lt;p&gt;If you really have the same chip type (nrf51422 vs nrf51822 doesn&amp;#39;t matter, just as long as you have the correct amount of flash and ram), and you put the softdevice, the same one, onto the board, there&amp;#39;s no instant reason why it would hardfault, so you need to dig some more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cann't run the BLE code</title><link>https://devzone.nordicsemi.com/thread/38913?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2015 09:35:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69e18845-c7bd-4947-adde-4bf70a5b11aa</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;I do not know that  error handler does it call,I stop the debug and I can see it stop at HardFault_Handler in the arm_startup_nrf51.s.Could 51822 know which hardware fault is?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cann't run the BLE code</title><link>https://devzone.nordicsemi.com/thread/38912?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2015 09:14:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa198eca-fafe-4775-ae0d-1526e66451bd</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;so what error handler does it call and why does it call it? What instruction does it execute when it goes to the hardfault handler?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cann't run the BLE code</title><link>https://devzone.nordicsemi.com/thread/38911?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2015 09:12:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e26cb1fc-9afc-45e7-910a-b729c4b160a1</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;Yes,it will call an error handler and end up in a HardFault(HardFault_Handler).And it can not run to the while(1). I use the same code and the same setting for the keil MDK to test on the PCA10028 V1.1.0,it can run correctlly.But the chip on the PCA10028 is nRF51422 QFACA1.
Alice (just now)edit&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cann't run the BLE code</title><link>https://devzone.nordicsemi.com/thread/38910?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2015 08:56:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c38bac26-f2ff-46fa-a1a6-765466c361a7</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;ok so what are you actually seeing? You enter ble_stack_init() and never return? If you step into the function what happens, where does it go? Does it call an error handler and loop forever, or end up in a HardFault? Have you ensured that you&amp;#39;ve used the correct memory map for the chip you&amp;#39;re actually using, which may be different from the dev board you used to test it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cann't run the BLE code</title><link>https://devzone.nordicsemi.com/thread/38909?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2015 08:54:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9283844c-46d3-472e-91b4-36011e7c455d</guid><dc:creator>Alice</dc:creator><description>&lt;p&gt;Yes,I have a 32kHz crystal on the board.I also try to use NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION,but the problem still cann&amp;#39;t be solved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cann't run the BLE code</title><link>https://devzone.nordicsemi.com/thread/38908?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2015 08:50:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e41fd2c-7c5b-4659-9039-6328f277bcf7</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Do you have a 32kHz crystal on the board? If not, are you changing the ble init to use a synthesized 32kHz source?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>