<?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>sd_app_evt_wait() cause HardFault_Handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6472/sd_app_evt_wait-cause-hardfault_handler</link><description>Hi, 
 I tried to run example: ble_app_multilink_central_s120_pca10028 but application goes to HardFault_Handler when it reaches sd_app_evt_wait() (in power_manage() function).
I also tried to run other example for softdevice s110 (ble_app_hrs_s110_pca10028</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Apr 2015 08:57:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6472/sd_app_evt_wait-cause-hardfault_handler" /><item><title>RE: sd_app_evt_wait() cause HardFault_Handler</title><link>https://devzone.nordicsemi.com/thread/22579?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2015 08:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:105322d1-ef9e-4393-a5d0-d59a47645f0d</guid><dc:creator>Inspectron</dc:creator><description>&lt;p&gt;Aryan This solved my problem wih the HardFault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_app_evt_wait() cause HardFault_Handler</title><link>https://devzone.nordicsemi.com/thread/22580?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2015 06:57:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5cb8fe9-fa4d-44cc-b48c-9d3587813fc1</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;If you are telling me that the hardfaults occurs while stepping after hitting the breakpoint, then this is expected. The real time constraints of the softdevice are broken once you hit the breakpoint, at which time the MPU is stalled not allowing softdevice timer handlers to execute, so next time when you step then there could be unpredictable behaviour. It might allow you to step for some time or could hardfault depending on what the softdevice was doing at the moment.&lt;/p&gt;
&lt;p&gt;I recommend you to go through the following if you want to understand it in more.
&lt;a href="https://devzone.nordicsemi.com/questions/scope:all/sort:relevance-desc/page:1/query:PRIMASK/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_app_evt_wait() cause HardFault_Handler</title><link>https://devzone.nordicsemi.com/thread/22576?ContentTypeID=1</link><pubDate>Mon, 13 Apr 2015 20:15:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aea162d9-6390-4405-9360-a481f8fb8a4f</guid><dc:creator>Meh05</dc:creator><description>&lt;p&gt;Yes, I removed optimizations (level 0).
After deleting power_manage() function from main for loop it goes to hard fault also.
When I set breakpoint to empty for loop and debug step by step it seems ok but when I run it free it goes to hard fault. So it seems that problem is not in this specific function but general.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_app_evt_wait() cause HardFault_Handler</title><link>https://devzone.nordicsemi.com/thread/22578?ContentTypeID=1</link><pubDate>Mon, 13 Apr 2015 11:14:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01ce7647-e920-4ec8-b897-a8772899af17</guid><dc:creator>Inspectron</dc:creator><description>&lt;p&gt;I have the same problem now. My main will be run only once. After it reaches the sd_app_evt_wait() function it will stuck in the HardFault_Handler. My Optimization level is 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_app_evt_wait() cause HardFault_Handler</title><link>https://devzone.nordicsemi.com/thread/22577?ContentTypeID=1</link><pubDate>Mon, 13 Apr 2015 09:24:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df33b4c6-2b30-46c3-b3a5-fa4d639e2551</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sd_app_evt_wait() would translate to simple __WFE instruction, and I am not sure why it would cause a hardfault. If you have come to conclusion that it hardfaults at this place from Keil debugger, have you removed all optimizations in the compiler? It is possible the the instructions before this call might have caused the hardfault and Keil&amp;#39;s call stack is messed up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>