<?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>Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114817/usage-fault-in-ncs-v2-7-0</link><description>Hi, 
 
 I have updated the device application firmware from nRF Connect SDK v2.6.1 to v2.7.0. 
 The firmware was working fine in v2.6.1 without issue. But the same firmware is running into hard fault for SDK v2.7.0 
 In log, I can see the USAGE FAULT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Nov 2024 12:28:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114817/usage-fault-in-ncs-v2-7-0" /><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/510676?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2024 12:28:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aed2dfab-8ab2-4a10-a2d4-1c4f4ef9f63f</guid><dc:creator>Narendra</dc:creator><description>&lt;p&gt;Updating NCS to v2.8.0 fixed the above issue. Not generating reported error or fault&amp;nbsp;at&amp;nbsp;the same point.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Narendra&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/510415?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2024 08:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac0d7405-7fcc-468c-b227-67d8297695e8</guid><dc:creator>Narendra</dc:creator><description>&lt;p&gt;Increased the stack size up to&amp;nbsp;8192, but&amp;nbsp;didn&amp;#39;t help. (CONFIG_BT_HCI_TX_STACK_SIZE=8192).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;CONFIG_BT_RX_STACK_SIZE=8192 already set.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also when setting&amp;nbsp;CONFIG_BT_HCI_TX_PRIO=7 in pjr.conf file, receiving an error in the build process.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please check below is the application log, which may help to debug the issue. As mentioned above our device is working as an extender, having one peripheral and multiple central roles. Transmitting BLE packets on peripheral and central both side after connection.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:34.580,718] &amp;lt;inf&amp;gt; SL: Initiating connection
[00:00:34.580,780] &amp;lt;inf&amp;gt; PSH: NUS server send. Length 20
[00:00:34.580,810] &amp;lt;inf&amp;gt; PSH: ServerTx
[00:00:34.581,085] &amp;lt;dbg&amp;gt; BCS: on_sent: Data send, conn 0x20004430
[00:00:34.581,085] &amp;lt;inf&amp;gt; PSH: Server Tx Complete
[00:00:34.679,901] &amp;lt;inf&amp;gt; SL: Central connected: 1
[00:00:34.680,114] &amp;lt;inf&amp;gt; SL: Security changed: level 0
[00:00:34.680,175] &amp;lt;inf&amp;gt; SL: MTU exchange pending
[00:00:34.704,040] &amp;lt;inf&amp;gt; SL: MTU exchange successful
[00:00:34.704,071] &amp;lt;inf&amp;gt; SL: Start scanning: interval 181 ms, window 43 ms
[00:00:34.705,230] &amp;lt;inf&amp;gt; CSH: NUS Client module initialized
[00:00:34.705,261] &amp;lt;inf&amp;gt; CSH: Service discovery completed
[00:00:34.705,413] &amp;lt;inf&amp;gt; CSH: NUS client send: connIndx 1, pkt length 20
[00:00:34.705,688] &amp;lt;inf&amp;gt; CSH: Client Tx Complete 1
[00:00:34.705,780] &amp;lt;inf&amp;gt; PSH: NUS server send. Length 20
[00:00:34.705,810] &amp;lt;inf&amp;gt; PSH: ServerTx
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:333
  command opcode 0x0406 timeout with err -11
[00:00:44.706,146] &amp;lt;err&amp;gt; os: r0/a1:  0x00000004  r1/a2:  0x0000014d  r2/a3:  0x00000002
[00:00:44.706,176] &amp;lt;err&amp;gt; os: r3/a4:  0x00000004 r12/ip:  0x00000010 r14/lr:  0x0003b5fb[0m
[00:00:44.706,176] &amp;lt;err&amp;gt; os:  xpsr:  0x01000000
[00:00:44.706,207] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x000642fe
[00:00:44.706,237] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:44.706,268] &amp;lt;err&amp;gt; os: Current thread: 0x200042d0 (BT TX)
[00:00:44.940,032] &amp;lt;err&amp;gt; os: Halting system&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/510291?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2024 12:58:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42ea63d0-c1ce-488a-9f09-825328d20de7</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Now we have the context, There seems to be stack overflow in the BT transmit thread.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;please try below in your prj.conf, try to increase the stack sizes if you already have that size.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT_RX_STACK_SIZE=2048
CONFIG_BT_HCI_TX_STACK_SIZE=1024
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;you can experiment with recalibrating the rx and tx thread prio for the host as below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT_HCI_TX_PRIO=7
CONFIG_BT_RX_PRIO=8
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;pristine build and try again. I hope this might help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/510260?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2024 10:21:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0db03e9-2c21-442c-a10d-0b62511380b2</guid><dc:creator>Narendra</dc:creator><description>&lt;p&gt;Some additional logs, set&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_ASSERT=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:333
  command opcode 0x0406 timeout with err -11
[00:00:23.780,364] &amp;lt;err&amp;gt; os: r0/a1:  0x00000004  r1/a2:  0x0000014d  r2/a3:  0x00000002
[00:00:23.780,395] &amp;lt;err&amp;gt; os: r3/a4:  0x00000004 r12/ip:  0x00000010 r14/lr:  0x0003d0b7
[00:00:23.780,395] &amp;lt;err&amp;gt; os:  xpsr:  0x01000000
[00:00:23.780,426] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x000694be
[00:00:23.780,456] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:23.780,487] &amp;lt;err&amp;gt; os: Current thread: 0x20004320 (BT TX)
[00:00:24.014,434] &amp;lt;err&amp;gt; os: Halting system&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/510252?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2024 09:23:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1ec81f1-3abe-44b3-a410-6789a3ac82f6</guid><dc:creator>Narendra</dc:creator><description>&lt;p&gt;Yes, right. But I was busy with some other task. Just resume this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And yes, I have added the config you suggested in prj.conf file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The above logs were generated with the new configuration.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:01:18.508,911] &amp;lt;err&amp;gt; os: Current thread: 0x20012d58 (MPSL Work)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;is this not a thread name?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/510231?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2024 08:20:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:184cd4b2-ee27-42b6-9434-76a98f30d261</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;That bad that it has been almost 2 months and you still have this issue. I still cannot see the thread name where the fault instruction happens.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you sure you added the configs I suggested to add in prj.conf. Without thread name&amp;nbsp; it is hard for anyone to get the context of this hardfault and hence no one will be able to give you a proper debugging direction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/510073?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2024 11:00:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a76d2794-0f5d-47dd-840d-733085e1b098</guid><dc:creator>Narendra</dc:creator><description>&lt;p&gt;Please find below the updated debug log.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting My Application v1.3.0-beta-41ee9b2d1389 ***
*** Using nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
[00:00:00.008,239] &amp;lt;inf&amp;gt; fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.008,239] &amp;lt;inf&amp;gt; fs_nvs: alloc wra: 0, fd0
[00:00:00.008,270] &amp;lt;inf&amp;gt; fs_nvs: data wra: 0, 1c
[00:00:00.008,422] &amp;lt;inf&amp;gt; bt_sdc_hci_driver: SoftDevice Controller build revision: 
                                            d6 da c7 ae 08 db 72 6f  2a a3 26 49 2a 4d a8 b3 |......ro *.&amp;amp;I*M..
                                            98 0e 07 7f                                      |....             
[00:00:00.010,711] &amp;lt;inf&amp;gt; bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.010,742] &amp;lt;inf&amp;gt; bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.010,772] &amp;lt;inf&amp;gt; bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
[00:00:00.011,230] &amp;lt;inf&amp;gt; bt_hci_core: No ID address. App mus0m
[0m
[00:00:06.044,769] &amp;lt;wrn&amp;gt; bt_hci_core: opcode 0x200a status 0x0d
[00:00:07.264,739] &amp;lt;wrn&amp;gt; bt_hci_core: opcode 0x200a status 0x0d
[00:01:02.571,838] &amp;lt;wrn&amp;gt; bt_conn: conn 0x20004688 failed to establish. RF noise?
[00:01:02.572,296] &amp;lt;wrn&amp;gt; bt_hci_core: opcode 0x2022 status 0x02
[00:01:18.508,789] &amp;lt;err&amp;gt; os: ***** USAGE FAULT *****
[00:01:18.508,819] &amp;lt;err&amp;gt; os:   Unaligned memory accessm
[00:01:18.508,819] &amp;lt;err&amp;gt; os: r0/a1:  0x2000beb5  r1/a2:  0x0000002c  r2/a3:  0x2002d36c
[00:01:18.508,850] &amp;lt;err&amp;gt; os: r3/a4:  0x00000040 r12/ip:  0x00000000 r14/lr:  0x0006a4a5
[00:01:18.508,850] &amp;lt;err&amp;gt; os:  xpsr:  0x21000000
[00:01:18.508,850] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0006a48e
[00:01:18.508,880] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 31: Unknown error on CPU 0
[00:01:18.508,911] &amp;lt;err&amp;gt; os: Current thread: 0x20012d58 (MPSL Work)
[00:01:18.738,616] &amp;lt;err&amp;gt; os: Halting system&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/503494?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2024 05:03:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4861f345-57fe-4198-b9ae-8e97cc55c0ed</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It would still be nice to know the context of the thread that is triggering this Fault exception. Right now it shows&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Current thread: 0x2000bcb8 (unknown)&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Can you add these in your prj.conf, prestine build and run your applicaiton to provide some more detailed fault into here? That was, we can know what is the context of the fault, that will have impact on our debugging direction.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_ASSERT_VERBOSE=y
CONFIG_ASSERT_NO_COND_INFO=n
CONFIG_ASSERT_NO_MSG_INFO=n
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_THREAD_NAME=y
CONFIG_STACK_SENTINEL=y&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/503087?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2024 10:04:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:986fe2e9-824e-473f-bc6d-f6d076191e64</guid><dc:creator>Narendra</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think main stack size should not be the issue. I have run the thread analyzer and checked. The main thread occupies only 42% of the stack. Following is the log of the thread analyzer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:03:16.586,669] &amp;lt;inf&amp;gt; thread_analyzer: Thread analyze:
[00:03:16.587,188] &amp;lt;inf&amp;gt; thread_analyzer:  BT CTLR ECDH        : STACK: unused 792 usage 168 / 960 (17 %); CPU: 0 %
[00:03:16.587,829] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 0
[00:03:16.589,233] &amp;lt;inf&amp;gt; thread_analyzer:  BT RX WQ            : STACK: unused 6088 usage 2104 / 8192 (25 %); CPU: 0 %
[00:03:16.589,874] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 4859
[00:03:16.590,393] &amp;lt;inf&amp;gt; thread_analyzer:  BT TX               : STACK: unused 224 usage 1824 / 2048 (89 %); CPU: 0 %
[00:03:16.591,033] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 2516
[00:03:16.591,522] &amp;lt;inf&amp;gt; thread_analyzer:  thread_analyzer     : STACK: unused 136 usage 888 / 1024 (86 %); CPU: 0 %
[00:03:16.592,163] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 49158
[00:03:16.592,926] &amp;lt;inf&amp;gt; thread_analyzer:  mcumgr smp          : STACK: unused 1888 usage 160 / 2048 (7 %); CPU: 0 %
[00:03:16.593,566] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 0
[00:03:16.599,060] &amp;lt;inf&amp;gt; thread_analyzer:  usbd_workq          : STACK: unused 200 usage 824 / 1024 (80 %); CPU: 0 %
[00:03:16.599,700] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 433
[00:03:16.600,341] &amp;lt;inf&amp;gt; thread_analyzer:  BT LW WQ            : STACK: unused 1184 usage 160 / 1344 (11 %); CPU: 0 %
[00:03:16.605,987] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 1
[00:03:16.607,452] &amp;lt;inf&amp;gt; thread_analyzer:  sysworkq            : STACK: unused 6312 usage 1880 / 8192 (22 %); CPU: 0 %
[00:03:16.608,062] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 1590
[00:03:16.608,581] &amp;lt;inf&amp;gt; thread_analyzer:  MPSL Work           : STACK: unused 184 usage 840 / 1024 (82 %); CPU: 0 %
[00:03:16.609,222] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 6916
[00:03:16.610,107] &amp;lt;inf&amp;gt; thread_analyzer:  usbworkq            : STACK: unused 2620 usage 5572 / 8192 (68 %); CPU: 0 %
[00:03:16.610,748] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 7486
[00:03:16.616,271] &amp;lt;inf&amp;gt; thread_analyzer:  idle                : STACK: unused 272 usage 48 / 320 (15 %); CPU: 98 %
[00:03:16.616,882] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 6319381
[00:03:16.618,103] &amp;lt;inf&amp;gt; thread_analyzer:  main                : STACK: unused 4684 usage 3508 / 8192 (42 %); CPU: 0 %
[00:03:16.618,743] &amp;lt;inf&amp;gt; thread_analyzer:       : Total CPU cycles used: 44629
[00:03:16.624,450] &amp;lt;inf&amp;gt; thread_analyzer:  ISR0                : STACK: unused 1120 usage 928 / 2048 (45 %)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have looked at the migration guide. I have not changed board version (hwv1 to hwv2) and multi-image parent and child to system build. Could it be the issue?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Narendra.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage fault in NCS v2.7.0</title><link>https://devzone.nordicsemi.com/thread/503083?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2024 09:45:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bc1950c-95dc-4fd9-8c83-99886e7fa228</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The first thing you could try is to increase the&amp;nbsp;CONFIG_MAIN_STACK_SIZE for example to twice the size, as that has been the issue in cases like this before. If that doesn&amp;#39;t work out, make sure you followed the migration guide from NCS 2.6.1 to 2.7.0 here as some changes are required when moving from the NCS 2.6.x base to 2.7.x.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_guide_2.7.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_guide_2.7.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>