<?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>Calling sd_ble_gatts_hvx() from within Timer ISR causes HardFault</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93229/calling-sd_ble_gatts_hvx-from-within-timer-isr-causes-hardfault</link><description>I am using S132 in the Segger IDE on an nrf52832. 
 I am using SDK version 17.0.0_9d13099. 
 When I call sd_ble_gatts_hvx() from within a GPIOE ISR (externally pin triggered), at 100Hz, I can successfully send a packet. 
 But calling this ftn with the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Oct 2022 04:03:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93229/calling-sd_ble_gatts_hvx-from-within-timer-isr-causes-hardfault" /><item><title>RE: Calling sd_ble_gatts_hvx() from within Timer ISR causes HardFault</title><link>https://devzone.nordicsemi.com/thread/392504?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 04:03:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df88d3e7-afc3-4418-9d0e-5bce0b7abd29</guid><dc:creator>anealca</dc:creator><description>&lt;p&gt;Vidar Berg&lt;/p&gt;
&lt;p&gt;Excellent...&lt;/p&gt;
&lt;p&gt;Lowering the timer IRQ level to 5 solved the Hard Fault and now the code functions exactly as written...&lt;/p&gt;
&lt;p&gt;thanks...&lt;/p&gt;
&lt;p&gt;Problem Resolved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling sd_ble_gatts_hvx() from within Timer ISR causes HardFault</title><link>https://devzone.nordicsemi.com/thread/392503?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 03:51:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c11892c9-d8ed-45b6-9589-cd3825502bbe</guid><dc:creator>anealca</dc:creator><description>&lt;p&gt;Vicar...&lt;/p&gt;
&lt;p&gt;Thanks for this thought...&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using HIGH (2) for my SAADC so I can get a 1k Ain data collection rate...&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve set the timer level to HIGH (2) as well but at 250Hz I shouldn&amp;#39;t need it that high...&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll lower it and see if that solves the issue.&lt;/p&gt;
&lt;p&gt;Adrian&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling sd_ble_gatts_hvx() from within Timer ISR causes HardFault</title><link>https://devzone.nordicsemi.com/thread/392460?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 16:21:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:841847b4-6a38-40ae-a8f5-c84bb0dac80a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;What is the interrupt priority of the timer interrupt? The CPU will raise a hardfault exception if the program makes a SD API call from an interrupt priority that is higher than the SVC interrupt itself (i.e. interrupt with pri. below 4 - lower numerical value equals higher priority).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;Edit: here is some general information about how the SD APIs work if you are new to the softdevice architecture: &lt;a id="" href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/overview/api_overview.html"&gt;https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/overview/api_overview.html&lt;/a&gt; and some about interrupt priorities: &lt;a id="" href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html"&gt;https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling sd_ble_gatts_hvx() from within Timer ISR causes HardFault</title><link>https://devzone.nordicsemi.com/thread/392458?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 16:12:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6972869-bda7-487b-90cb-87669e6e2899</guid><dc:creator>anealca</dc:creator><description>&lt;p&gt;Somehow I cut off the &amp;quot;ret_code_t&amp;quot; return code from the included&amp;nbsp;code segment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>