<?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>GATT Service Discovery - Hard Fault</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113066/gatt-service-discovery---hard-fault</link><description>Support, 
 Due to the limitations described in the referenced previous ticket, I am unable to successfully discover a service and its characteristics because of a hard fault occurrence. This fault does not occur when compiling and executing under debug</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jul 2024 11:13:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113066/gatt-service-discovery---hard-fault" /><item><title>RE: GATT Service Discovery - Hard Fault</title><link>https://devzone.nordicsemi.com/thread/494106?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2024 11:13:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56652fe0-8e0d-40ec-8b36-db4919a65100</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is it the the app error handler or the&amp;nbsp;HardFault handler that gets invoked in your application? Enabling the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_hardfault.html"&gt;HardFault handling library&lt;/a&gt; by setting HARDFAULT_HANDLER_ENABLED to 1 in sdk_config.h and including the fault handler from /components/libraries/hardfault/nrf52/handler in your project may help us better understand the nature of the fault if it is the latter&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;From the code snippets you posted, it appears that you have forgotten to allocate memory for your m_ble_device_srv pointer(s). Since you know the number of services you will discover beforehand, I recommend allocating the service struct statically.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>