<?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>Custom board got HardFault</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85275/custom-board-got-hardfault</link><description>Hi, 
 
 I have been programming my custom board using SWD on a DK. It worked fine when I tried blinky example, however, when I tried nrf_ble_uart example, it stopped at the log_init(): 
 and when I break it, it showed in HardFault_handle() : 
 
 
 I tried</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Mar 2022 19:51:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85275/custom-board-got-hardfault" /><item><title>RE: Custom board got HardFault</title><link>https://devzone.nordicsemi.com/thread/356715?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 19:51:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b238847b-60c1-4e38-b132-2bc2657bd9a0</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Chris,&lt;/p&gt;
&lt;p&gt;I think it&amp;#39;s rather unlikely that this issue is caused by a bad batch of chips. For that to happen, it would have had to slip through all of our production tests, in addition to the tests performed by the module vendor at their production line. I have not seen this failure mode before either. Hardfault exceptions are almost always caused by SW.&lt;/p&gt;
&lt;p&gt;Maybe you can try with one of the other BLE examples as well?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board got HardFault</title><link>https://devzone.nordicsemi.com/thread/356709?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 17:32:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f789e2ba-ed77-4e03-b8da-b0b2f30de793</guid><dc:creator>Christopher Bilal</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for you information.&lt;/p&gt;
&lt;p&gt;I only changed the RXD, TX pin numbers in the example files, and the code runs ok on DK. Do you think it is possible that I got a bad batch of chips?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I will test the SP later today.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Chris&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board got HardFault</title><link>https://devzone.nordicsemi.com/thread/356630?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 13:47:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a420aa92-3423-4786-98df-ef052ee949c8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Chris,&lt;/p&gt;
&lt;p&gt;The stack pointer (SP) value is suspiciously low in your case - it should never go below 0x2000e000 with the default &amp;#39;pca10040&amp;#39; project configuration. But I&amp;#39;m not sure why this only happens on the custom board. Did you make any changes to the ble_app_uart example?&lt;/p&gt;
&lt;p&gt;You can see from the screenshot below what the default RAM layout is for the ble_app_uart_pca10040_s132 project in sdk 17.1.0. The valid address range for the stack pointer is defined by the .stack region.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/7711.pastedimage1646660122210v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Do you get the same exception if you set the NRF_LOG_ENABLED symbol in sdk_config.h to &amp;#39;0&amp;#39;? Also, what is the SP value when you reach main() on startup before log_init()?&lt;/p&gt;
&lt;p&gt;Here is what the call stack and register view may look like after a hardfault expception has been raised in log_init():&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/5657.pastedimage1646659764043v2.png" alt=" " /&gt;&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><item><title>RE: Custom board got HardFault</title><link>https://devzone.nordicsemi.com/thread/356407?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 19:39:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dba5679-7705-4721-b622-db88214c33b8</guid><dc:creator>Christopher Bilal</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I used the example and tested on DK. It worked fine.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is the screenshot&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1646422588007v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Let me know if you need any other information&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom board got HardFault</title><link>https://devzone.nordicsemi.com/thread/355622?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 15:24:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e386bef1-329d-4720-a85e-3ef39cf73caf</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s strange that you seem to be getting a fault exception from the log_init() call. When the ble_app_uart example does not run on a custom board it&amp;#39;s usually one of two things: Either the wrong 32 KHz clock source is selected, or a floating UART RX input that causes the APP_UART_COMMUNICATION_ERROR event to be raised. But neither of these should trigger a fault exception.&lt;/p&gt;
&lt;p&gt;Does the exact same code run fine on your DK? And can you post a screenshot that includes the CPU registers and call stack&amp;nbsp; as well?&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>