<?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>Bluetooth Mesh MPU fault with Logging V2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88755/bluetooth-mesh-mpu-fault-with-logging-v2</link><description>Hi, 
 Currently, I am building an application with Bluetooth mesh and I tried to use Zephyr&amp;#39;s logging v2 modules. However, when I build it I get MPU-fault errors at boot. For verification, I tried it also with a BT mesh sample project. For the test, I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Jun 2022 08:52:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88755/bluetooth-mesh-mpu-fault-with-logging-v2" /><item><title>RE: Bluetooth Mesh MPU fault with Logging V2</title><link>https://devzone.nordicsemi.com/thread/374694?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 08:52:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33e7f25c-3eaa-454b-b92f-7abd7a3bd752</guid><dc:creator>tim-remoticom</dc:creator><description>&lt;p&gt;Hi Joakim,&lt;br /&gt;&lt;br /&gt;This solved the issue! Thanks for your support.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To summarize the issue:&lt;/p&gt;
&lt;p&gt;You have to increase &amp;quot;&lt;span&gt;BT_MESH_ADV_STACK_SIZE&amp;quot; and &amp;quot;&lt;/span&gt;BT_RX_STACK_SIZE&amp;quot; and &amp;quot;MAIN_STACK_SIZE&amp;quot;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With kind regards&lt;br /&gt;Tim&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div id="gtx-trans" style="left:315px;position:absolute;top:126.6px;"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth Mesh MPU fault with Logging V2</title><link>https://devzone.nordicsemi.com/thread/374626?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2022 20:50:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba62f16d-93e7-4890-ab48-9032f55e57ea</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Seems it failed for BT Mesh adv thread as well. Could you try increasing BT_MESH_ADV_STACK_SIZE?&lt;/p&gt;
&lt;p&gt;Br, &lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth Mesh MPU fault with Logging V2</title><link>https://devzone.nordicsemi.com/thread/373371?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 08:58:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69dea1a9-281d-4ce6-8f8a-b0bb923d2fa3</guid><dc:creator>tim-remoticom</dc:creator><description>&lt;p&gt;&lt;span style="font-size:inherit;"&gt;Hi Joakim,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;Thank you for your response.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;No, this issue is still not solved. Everything works with deferred logging module v2 until I provision the device. Then it creates an MPU fault.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:inherit;"&gt;Using&amp;nbsp;arm-none-eabi-addr2line I also found the following things:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;Fault instruction address (r15/pc): &amp;quot;fixed_data_alloc&amp;quot; &amp;quot;.../ncs/v1.9.1/zephyr/subsys/net/buf.c:146&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;r14/lr: usually returns where the function is called from. But now it returned nothing (??:0)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;Thread is rx_thread (from &amp;quot;.../ncs/v1.9.1/zephyr/subsys/bluetooth/host/hci_core.c:65&amp;quot;)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;Because the error is generated in the Bluetooth Rx thread (and it is a stack overflow in the net buffer), I tried to increase Bluetooth Rx stack size, but this would create an assertion fail loop for z_spin_lock_valid(l)).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Added settings:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_MAIN_STACK_SIZE=4096
CONFIG_BT_RX_STACK_SIZE=4096
CONFIG_LOG_MODE_MINIMAL=n
CONFIG_LOG2_MODE_DEFERRED=y
CONFIG_LOG_BACKEND_UART=y&lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Logs:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.7.99-ncs1-1 ***
Initializing...
[Bluetooth initialized
ASSERTION FAIL [z_spin_lock_valid(l)] @ WEST_TOPDIR/zephyr/include/spinlock.h:129
Recursive spinlock 0x20004cf8
0[00:00:00.011,779] &amp;lt;inf&amp;gt; fs_nvs: alloc wra: 0, f58
ASSERTION FAIL [z_spin_lock_valid(l)] @ WEST_TOPDIR/zephyr/include/spinlock.h:129&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you&amp;nbsp;know what goes wrong here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth Mesh MPU fault with Logging V2</title><link>https://devzone.nordicsemi.com/thread/373346?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 06:20:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4ad146c-ae56-4a59-9410-627ee92769b2</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Sorry about the delayed response.&lt;/p&gt;
&lt;p&gt;Did you manage to solve this, or do you still need assistance with this issue?&lt;/p&gt;
&lt;p&gt;Br, &lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth Mesh MPU fault with Logging V2</title><link>https://devzone.nordicsemi.com/thread/371581?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2022 08:25:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ac831f6-8573-41be-8453-17cedcb9bb8c</guid><dc:creator>tim-remoticom</dc:creator><description>&lt;p&gt;It seems I made a mistake. Everything seemed to work, but when the device gets provisioned it still causes an MPU fault. I use the nRF mesh app (iOS version) to provision the device with the BT mesh light fixture example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;▒*** Booting Zephyr OS build v2.7.99-ncs1-1  ***
Initializing...
[Bluetooth initialized
Mesh initialized
Successfully enabled LC server
00:00:00.012,176] &amp;lt;inf&amp;gt; fs_nvs: 6 Sectors of 4096 bytes
[00:00:00.012,176] &amp;lt;inf&amp;gt; fs_nvs: alloc wra: 0, f90
[00:00:00.012,207] &amp;lt;inf&amp;gt; fs_nvs: data wra: 0, 44
[00:00:00.012,390] &amp;lt;inf&amp;gt; sdc_hci_driver: SoftDevice Controller build revision:
                                         0e e7 c5 66 67 18 3c ac  b3 d2 cc 81 a3 dc f1 c0 |...fg.&amp;lt;. ........
                                         c0 36 02 22                                      |.6.&amp;quot;
[00:00:00.017,517] &amp;lt;inf&amp;gt; bt_hci_core: No ID address. App must call settings_load()
[00:03:07.352,600] &amp;lt;wrn&amp;gt; bt_l2cap: Ignoring data for unknown channel ID 0x003a
[00:03:09.456,726] &amp;lt;err&amp;gt; os: ***** MPU FAULT *****
[00:03:09.456,756] &amp;lt;err&amp;gt; os:   Stacking error (context area might be not valid)
[00:03:09.456,756] &amp;lt;err&amp;gt; os:   Data Access Violation
[00:03:09.456,756] &amp;lt;err&amp;gt; os:   MMFAR Address: 0x20005518
[00:03:09.456,787] &amp;lt;err&amp;gt; os: r0/a1:  0xd8043b82  r1/a2:  0x5caeff8e  r2/a3:  0xef0cac29
[00:03:09.456,787] &amp;lt;err&amp;gt; os: r3/a4:  0xe4e1b764 r12/ip:  0xad304278 r14/lr:  0x9bb478d9
[00:03:09.456,787] &amp;lt;err&amp;gt; os:  xpsr:  0x21000000
[00:03:09.456,817] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0004d6fe
[00:03:09.456,848] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
[00:03:09.456,878] &amp;lt;err&amp;gt; os: Current thread: 0x200029c0 (BT RX)
▒*** Booting Zephyr OS build v2.7.99-ncs1-1  ***system
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth Mesh MPU fault with Logging V2</title><link>https://devzone.nordicsemi.com/thread/371569?ContentTypeID=1</link><pubDate>Thu, 09 Jun 2022 08:07:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bca596e3-17c6-4ff1-989e-32f644902118</guid><dc:creator>tim-remoticom</dc:creator><description>&lt;p&gt;Hi, small update. I found &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/68783/mpu-fault-in-bluetooth-hci-power-control"&gt;this Q&amp;amp;A&lt;/a&gt; on Nordic devzone which had a similar issue. I increased the main stack size `CONFIG_MAIN_STACK_SIZE` and flashed it to the DK. In the Bluetooth mesh light fixture example, this solved it for both log modes. For my own application, this method solved the issue for deferred logging mode. But for log mode immediate, I got a slightly different error. I increased the main stack size up to 8192.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
*** Booting Zephyr OS build v2.7.99-ncs1-1  ***
[00:00:00.010,681] &amp;lt;inf&amp;gt; App: Initializing...
[00:00:00.022,430] &amp;lt;inf&amp;gt; fs_nvs: 6 Sectors of 4096 bytes
[00:00:00.028,503] &amp;lt;inf&amp;gt; fs_nvs: alloc wra: 2, c40
[00:00:00.034,027] &amp;lt;inf&amp;gt; fs_nvs: data wra: 2, 1d4
[00:00:00.104,309] &amp;lt;inf&amp;gt; sdc_hci_driver: SoftDevice Controller build revision:
                                         0e e7 c5 66 67 18 3c ac  b3 d2 cc 81 a3 dc f1 c0 |...fg.&amp;lt;. ........
                                         c0 36 02 22                                      |.6.&amp;quot;
[00:00:00.137,664] &amp;lt;inf&amp;gt; bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.160,888] &amp;lt;inf&amp;gt; bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.182,739] &amp;lt;inf&amp;gt; bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 14.50663 Build 1008
[00:00:00.209,838] &amp;lt;inf&amp;gt; bt_hci_core: No ID address. App must call settings_load()
[00:00:00.233,184] &amp;lt;inf&amp;gt; App: Bluetooth initialized
[00:00:00.274,322] &amp;lt;inf&amp;gt; bt_hci_core: Identity: C9:C6:04:AF:B8:52 (random)
[00:00:00.296,997] &amp;lt;inf&amp;gt; bt_hci_core: HCI: version 5.2 (0x0b) revision 0x12fe, manufacturer 0x0059
[00:00:00.321,838] &amp;lt;inf&amp;gt; bt_hci_core: LMP: version 5.2 (0x0b) subver 0x12fe
[00:00:00.344,848] &amp;lt;inf&amp;gt; bt_mesh_prov_device: Device UUID: 00000000-0000-0080-f744-ea62d0b23649
[00:00:00.370,727] &amp;lt;inf&amp;gt; App: Mesh initialized
[00:00:00.391,113] &amp;lt;inf&amp;gt; App: Boot count: 786
[00:00:00.455,902] &amp;lt;err&amp;gt; os: ***** MPU FAULT *****
[00:00:00.476,623] &amp;lt;err&amp;gt; os:   Stacking error (context area might be not valid)
[00:00:00.499,938] &amp;lt;err&amp;gt; os:   Data Access Violation
[00:00:00.520,874] &amp;lt;err&amp;gt; os:   MMFAR Address: 0x20005ad8
[00:00:00.542,175] &amp;lt;err&amp;gt; os: r0/a1:  0x3a579300  r1/a2:  0xbc1a9c0b  r2/a3:  0xe8bc7378
[00:00:00.566,345] &amp;lt;err&amp;gt; os: r3/a4:  0x8565b192 r12/ip:  0x58d21214 r14/lr:  0x5fdb17e0
[00:00:00.590,515] &amp;lt;err&amp;gt; os:  xpsr:  0x21000000
[00:00:00.611,022] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0004086c
[00:00:00.634,307] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
[00:00:00.657,623] &amp;lt;err&amp;gt; os: Current thread: 0x20002cf0 (BT Mesh adv)
[00:00:00.700,103] &amp;lt;err&amp;gt; fatal_error: Resetting system
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For me, deferred logging v2 is enough. But I&amp;#39;m curious as to why it still doesn&amp;#39;t work with log mode immediate v2 in my own application?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>