<?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>Using sd_ble_gatts_hvx() in timer1 interrupt service cause the hardfault</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15449/using-sd_ble_gatts_hvx-in-timer1-interrupt-service-cause-the-hardfault</link><description>Condition: nRF52, SDK11,s132, SDS v2.0.
Using the sd_ble_gatts_hvx() in timer1 interrupt service(timer1 interrupt priority is set to level 3) will result in hardfault. While, using the sd_ble_gatts_hvx() in main loop will not cause any error. Why? How</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Aug 2016 10:23:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15449/using-sd_ble_gatts_hvx-in-timer1-interrupt-service-cause-the-hardfault" /><item><title>RE: Using sd_ble_gatts_hvx() in timer1 interrupt service cause the hardfault</title><link>https://devzone.nordicsemi.com/thread/58975?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2016 10:23:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29d77719-7f6e-49b0-bd2b-cddd60aace8f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am accepting this because this has been discussed many times and the answer is very accurate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using sd_ble_gatts_hvx() in timer1 interrupt service cause the hardfault</title><link>https://devzone.nordicsemi.com/thread/58974?ContentTypeID=1</link><pubDate>Sun, 31 Jul 2016 11:49:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e341dc6-a36b-4511-85bb-7baea3de9d76</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;This gets discussed multiple times a week. You can&amp;#39;t call SVC calls from an interrupt level higher than the SVC interrupt and all sd_ functions are implemented with SVC calls. If you do the cortex hardfaults. Interrupt level 3 is higher than the SVC interrupt level so either you make your timer interrupt lower priority or you bounce it to  a lower priority level (eg main thread) and process it there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>