<?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>Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108080/zephyr-project-startup-hardfault-using-the-matter-lightbulb-example</link><description>I have been attempting to load a board we manufactured with the Matter Lightbulb example. The code loads and starts to function but I immediately get the following Hard fault. 
 Some background. This board is simply the nrf52840, with the same LEDs and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Feb 2024 19:17:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108080/zephyr-project-startup-hardfault-using-the-matter-lightbulb-example" /><item><title>RE: Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/thread/468132?ContentTypeID=1</link><pubDate>Thu, 08 Feb 2024 19:17:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50712d7c-03f7-4edd-8e19-92e20a25c22f</guid><dc:creator>AMarch</dc:creator><description>&lt;p&gt;I got the application running. I added the following to prj_no_dfu.conf (sanity modification)&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This fixed part of the problem. &lt;br /&gt;The other problem was due to a poorly attached 32Mhz crystal. Seems this causes a fault. Go figure.&lt;br /&gt;I found this out by walking all the way back to the esb_ptx project , just to see if our radio worked at all, and immediately the program locked up waiting for the high frequency clock to start.&lt;br /&gt;&lt;br /&gt;So, if you are having issues like mine, run a small test program to test your high frequency clock AND if you don&amp;#39;t have crystal in your design remember to use an alternate low frequency source of K32SRC_RC.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/thread/467966?ContentTypeID=1</link><pubDate>Wed, 07 Feb 2024 16:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b555e37b-1b23-462a-af38-305acb65b36f</guid><dc:creator>AMarch</dc:creator><description>&lt;p&gt;So I tried the zephyr beacon project. And that failed with the same kind of MPSL error:&lt;/p&gt;
&lt;p&gt;Beacon started, advertising as F8:3D:7C:A6:ED:BE (random) &lt;br /&gt;[00:00:00.007,537] &amp;lt;err&amp;gt; mpsl_init: MPSL ASSERT: 112, 2185 &lt;br /&gt;[00:00:00.007,537] &amp;lt;err&amp;gt; os: ***** HARD FAULT ***** &lt;br /&gt;[00:00:00.007,568] &amp;lt;err&amp;gt; os: Fault escalation (see below) &lt;br /&gt;[00:00:00.007,568] &amp;lt;err&amp;gt; os: ARCH_EXCEPT with reason 3 &lt;br /&gt; &lt;br /&gt;[00:00:00.007,598] &amp;lt;err&amp;gt; os: r0/a1: 0x00000003 r1/a2: 0x00000000 r2/a3: 0x0&lt;br /&gt;000000b &lt;br /&gt;[00:00:00.007,598] &amp;lt;err&amp;gt; os: r3/a4: 0x20001138 r12/ip: 0x20000ae0 r14/lr: 0x0&lt;br /&gt;000ae35 &lt;br /&gt;[00:00:00.007,629] &amp;lt;err&amp;gt; os: xpsr: 0x41000018 &lt;br /&gt;[00:00:00.007,629] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0000fbbc &lt;br /&gt;[00:00:00.007,659] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0 &lt;br /&gt;[00:00:00.007,690] &amp;lt;err&amp;gt; os: Fault during interrupt handling &lt;br /&gt; &lt;br /&gt;[00:00:00.007,720] &amp;lt;err&amp;gt; os: Current thread: 0x20001138 (unknown) &lt;br /&gt;&amp;oslash;00:00:01.506,835] &amp;lt;err&amp;gt; fatal_error: Resetting system&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am guessing the ASSERT doesn&amp;#39;t mean anything useful.&amp;nbsp;&lt;br /&gt;Next I will try a NON zephyr ble example.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/thread/467938?ContentTypeID=1</link><pubDate>Wed, 07 Feb 2024 13:50:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67a65008-8f14-45e5-b872-fa513536c254</guid><dc:creator>AMarch</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;Are you able to successfully run other examples from the SDK on your board, such as the hello_world from Zephyr (to verify that your toolchain and debugger is functioning as it should), or any of the BLE applications (to verify that the rest of your hardware is functioning as expected)?&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;Just to be complete, I did run a zephyr blinky example. The SAME hex file ran properly on both our board AND the nrf52840-DK. It&amp;#39;s&amp;nbsp;a primitive&amp;nbsp;program, so it that isn&amp;#39;t much an example of similarity, other than the base zephyr kernel functioning.&amp;nbsp;Still haven&amp;#39;t tried a different radio program yet (though I would love to play with ESB again, I know it isn&amp;#39;t the same).&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;Have you made your own board files for this board, and used this instead of the nRF52840 DK board files as the build target for the Matter lightbulb application?&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;I did create some board&amp;nbsp;files specific&amp;nbsp;to our board. Checking them again.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/thread/467812?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2024 19:52:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c56611e2-dbcf-4fbe-a627-0989d347b596</guid><dc:creator>AMarch</dc:creator><description>&lt;p&gt;OK , if 112 refers to the numbers in syscall_list.h then the failure is in K_TIMER_START()... i think??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/thread/467809?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2024 19:29:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02146114-bb64-43db-9bf3-4c52d41a16fb</guid><dc:creator>AMarch</dc:creator><description>&lt;p&gt;Ok, this took too much effort, but I connected the serial port and captured:&lt;br /&gt;E: MPSL ASSERT: 112, 2185 &lt;br /&gt;E: ***** HARD FAULT ***** &lt;br /&gt;E: Fault escalation (see below) &lt;br /&gt;E: ARCH_EXCEPT with reason 3 &lt;br /&gt; &lt;br /&gt;E: r0/a1: 0x00000003 r1/a2: 0x2000efe0 r2/a3: 0x2000efe0 &lt;br /&gt;E: r3/a4: 0x20016f88 r12/ip: 0x00000000 r14/lr: 0x0003115f &lt;br /&gt;E: xpsr: 0x61000018 &lt;br /&gt;E: s[ 0]: 0x00000000 s[ 1]: 0x0000e349 s[ 2]: 0x00323131 s[ 3]: 0x00000000 &lt;br /&gt;E: s[ 4]: 0x00000000 s[ 5]: 0x0000be03 s[ 6]: 0x00000000 s[ 7]: 0x40008000 &lt;br /&gt;E: s[ 8]: 0x20000008 s[ 9]: 0xe000e000 s[10]: 0x00000100 s[11]: 0x0000d9ff &lt;br /&gt;E: s[12]: 0x0004e8bd s[13]: 0x00000000 s[14]: 0x00000000 s[15]: 0x00000000 &lt;br /&gt;E: fpscr: 0x00000000 &lt;br /&gt;E: Faulting instruction address (r15/pc): 0x0003116a &lt;br /&gt;E: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0 &lt;br /&gt;E: Fault during interrupt handling &lt;br /&gt; &lt;br /&gt;E: Current thread: 0x2000efe0 (idle) &lt;br /&gt;E: Halting system &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;So MPSL ASSERT makes sense.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Can you help on what file 112, line 2185 equate to??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/thread/467802?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2024 18:32:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a27d25d-d2b2-4bf4-a165-5d8d6e084a54</guid><dc:creator>AMarch</dc:creator><description>&lt;p&gt;&lt;br /&gt;NOPE THIS IS WRONG.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration:line-through;"&gt;I think my issue is coming from this point in the code at ISR_DIRECT_PM() or just before it:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void mpsl_radio_isr_wrapper(const void *args)
{
	ARG_UNUSED(args);

	MPSL_IRQ_RADIO_Handler();

	ISR_DIRECT_PM();
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/thread/467797?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2024 18:03:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e25a65db-9e5f-4bdd-871e-7979e9d0f5b5</guid><dc:creator>AMarch</dc:creator><description>&lt;p&gt;No - I haven&amp;#39;t tried any other BLE programs yet, but perhaps I should at this point.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/thread/467796?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2024 18:02:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e386d61-8763-42c9-beeb-1b03b044220a</guid><dc:creator>AMarch</dc:creator><description>&lt;p&gt;Originally, I was trying to get blinky to function on the board. I was having problems and then I found out I needed to set&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC&lt;/span&gt;&lt;span&gt;=y to get it to function. This is what led my initial question of if it is necessary to have the 32Khz crystal to make these things work at all. This took a minute to figure out until I tested the exact same .hex file on our board and the nrf52840-DK board (which I have because I wasn&amp;#39;t going to think of doing this without an actual demo board in hand). Finally I realized that the difference was the crystal. After making the change to the .conf file, blinky worked find on our board.&lt;br /&gt;&lt;br /&gt;I decided to take a big step and move to the matter-lightbulb example. The code executes and I can single step to a point. The downside, of course, is that this is an OS so I can&amp;#39;t step through everything linearly.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I decided to buckle down and take some more detailed notes. I rebuilt the project and started it in oxygen again.&amp;nbsp;&lt;br /&gt;The fault happens reliably as&amp;nbsp; HardFault exception at 0x0003116A.(yes very different from the fault address in the first post)&lt;br /&gt;If I read this correctly, the Fault is being generated in this location, and looking at the map file it appears that this is m_assert_handle.&amp;nbsp;&lt;br /&gt;So apparently, I am hitting an MPSL assert for some reason. I haven&amp;#39;t figured what causes this yet, but that should be next.&lt;br /&gt;&lt;br /&gt;Currently my prj.conf (prj_no_dfu.conf) is&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Enable CHIP
CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG=&amp;quot;src/chip_project_config.h&amp;quot;
# 32773 == 0x8005 (example lighting-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32773
CONFIG_STD_CPP14=y

# Enable CHIP pairing automatically on application start.
CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
CONFIG_PWM=y

# Bluetooth Low Energy configuration
CONFIG_BT_DEVICE_NAME=&amp;quot;MatterLight&amp;quot;

# Other settings
CONFIG_THREAD_NAME=y
CONFIG_MPU_STACK_GUARD=y
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_CHIP_LIB_SHELL=y

# Disable Matter OTA DFU
CONFIG_CHIP_OTA_REQUESTOR=n

# Disable QSPI NOR
CONFIG_CHIP_QSPI_NOR=n

CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING=n

CONFIG_SCHED_CPU_MASK=y
CONFIG_THREAD_ANALYZER=y&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr Project Startup Hardfault using the Matter LightBulb example.</title><link>https://devzone.nordicsemi.com/thread/467789?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2024 16:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3eaa7c4-d105-464d-aeda-30aa77068dbd</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]I had single stepped through most of the init function for the main class, so I know it is executing code.[/quote]
&lt;p&gt;Does this hardfault trigger at a particular line of code during the initialization? If so, where?&lt;/p&gt;
[quote user=""]This board is simply the nrf52840, with the same LEDs and two of the buttons form the nrf52840-DK board.&amp;nbsp;&lt;br /&gt;We do not have the 32Khz crystal (which was a problem for me initially to get the code to start). Has anyone seen the code simply fail like this?[/quote]
&lt;p&gt;Are you able to successfully run other examples from the SDK on your board, such as the hello_world from Zephyr (to verify that your toolchain and debugger is functioning as it should), or any of the BLE applications (to verify that the rest of your hardware is functioning as expected)?&lt;/p&gt;
[quote user=""]This board is simply the nrf52840, with the same LEDs and two of the buttons form the nrf52840-DK board.&amp;nbsp;[/quote]
&lt;p&gt;Have you made your own board files for this board, and used this instead of the nRF52840 DK board files as the build target for the Matter lightbulb application?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>