<?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>NCS change BLE device name during runtime</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72797/ncs-change-ble-device-name-during-runtime</link><description>Hello, 
 I&amp;#39;m developing an BLE application with NCS where I want to be able to change the BLE device name during runtime. Therefore I enabled CONFIG_BT_DEVICE_NAME_DYNAMIC in the prj.conf. 
 It works but I always get this warning message when I change</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Mar 2021 12:52:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72797/ncs-change-ble-device-name-during-runtime" /><item><title>RE: NCS change BLE device name during runtime</title><link>https://devzone.nordicsemi.com/thread/299777?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 12:52:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2855efb7-c6ee-4c2e-becd-e65c65569bab</guid><dc:creator>db_lw</dc:creator><description>&lt;p&gt;Thank you that solved the problem with the fatal error!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS change BLE device name during runtime</title><link>https://devzone.nordicsemi.com/thread/299764?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 12:09:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8dd24fd8-b912-42e9-92e8-70183f45ec19</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hmm, try&lt;/p&gt;
&lt;div&gt;CONFIG_MPU_ALLOW_FLASH_WRITE=y&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS change BLE device name during runtime</title><link>https://devzone.nordicsemi.com/thread/299745?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 11:17:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:171ed56c-5ba3-408e-a876-b7a057c88487</guid><dc:creator>db_lw</dc:creator><description>&lt;p&gt;Setting CONFIG_SETTINGS_NONE=n made the warnings disappear.&lt;/p&gt;
&lt;p&gt;But now I am getting the following zephyr fatal error, every time I call the bt_set_name() function.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;err&amp;gt; os: ***** MPU FAULT *****
&amp;lt;err&amp;gt; os:   Data Access Violation
&amp;lt;err&amp;gt; os:   MMFAR Address: 0x20004354
&amp;lt;err&amp;gt; os: r0/a1:  0x20004388  r1/a2:  0x00000001  r2/a3:  0x00ffffff
&amp;lt;err&amp;gt; os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x00001831
&amp;lt;err&amp;gt; os:  xpsr:  0x81000000
&amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00000554
&amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
&amp;lt;err&amp;gt; os: Current thread: 0x20001918 (unknown)
&amp;lt;err&amp;gt; fatal_error: Resetting system&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS change BLE device name during runtime</title><link>https://devzone.nordicsemi.com/thread/299733?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 10:51:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55ded08b-bda7-44db-b91e-211c43559121</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Could you try to remove&amp;nbsp;CONFIG_SETTINGS_NONE=y , and see if that solves the issue ?&lt;/p&gt;
[quote user="bugl_lt"]When I understand you right, I can ignore the warning if I don&amp;#39;t need to store the device name in the NVM?[/quote]
&lt;p&gt;Yes.&lt;/p&gt;
&lt;p&gt;Here is the code-line where you get the warning:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.99-ncs1/subsys/bluetooth/host/hci_core.c#L6724"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.99-ncs1/subsys/bluetooth/host/hci_core.c#L6724&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If removing &lt;span&gt;CONFIG_SETTINGS_NONE does not work, you could try to print the error that is returned&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;change
BT_WARN(&amp;quot;Unable to store name&amp;quot;);

to
BT_WARN(&amp;quot;Unable to store name: error %d&amp;quot;,err);&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: NCS change BLE device name during runtime</title><link>https://devzone.nordicsemi.com/thread/299729?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 10:42:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aad1f1f6-3163-4363-b23a-dcb1951ae337</guid><dc:creator>db_lw</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;thank you for your answer.&lt;/p&gt;
&lt;p&gt;When I understand you right, I can ignore the warning if I don&amp;#39;t need to store the device name in the NVM?&lt;/p&gt;
&lt;p&gt;The strange thing is I actually have the config entries that you mentioned in my proj.conf and still getting this warning.&lt;/p&gt;
&lt;p&gt;My proj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_DEBUG_OPTIMIZATIONS=y
CONFIG_CPLUSPLUS=y

# Enable the UART driver
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE0=y
CONFIG_SERIAL=y

CONFIG_GPIO=y

# Make sure printk is not printing to the UART console
CONFIG_CONSOLE=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n

CONFIG_HEAP_MEM_POOL_SIZE=2048

# Configuration required by Event Manager
CONFIG_EVENT_MANAGER=y
CONFIG_LINKER_ORPHAN_SECTION_PLACE=y
CONFIG_REBOOT=y

# Configuration BT general
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME=&amp;quot;Test&amp;quot;
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_DEVICE_APPEARANCE=0
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1
CONFIG_BT_DEBUG_LOG=n

CONFIG_BT_CTLR_PHY_2M=n
CONFIG_BT_CTLR_PHY_CODED=n

CONFIG_BT_PERIPHERAL_PREF_MIN_INT=12
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=24
CONFIG_BT_PERIPHERAL_PREF_SLAVE_LATENCY=0
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400

CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_L2CAP_RX_MTU=247

# Enable the device information service
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_DIS_FW_REV=y

# Below is setup to let DIS information be read from settings
CONFIG_BT_SETTINGS=y
CONFIG_BT_GATT_CACHING=n
CONFIG_SETTINGS_RUNTIME=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NONE=y

CONFIG_BT_DIS_SETTINGS=y
CONFIG_BT_DIS_STR_MAX=21

# Enable the NUS service
CONFIG_BT_NUS=n

# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

# This example requires more workqueue stack
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Config logger
CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n

CONFIG_ASSERT=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS change BLE device name during runtime</title><link>https://devzone.nordicsemi.com/thread/299711?ContentTypeID=1</link><pubDate>Mon, 15 Mar 2021 10:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1dc4b23-6220-468a-9bd0-b565b861ed9d</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]So I&amp;#39;m curious why this warning says that the name couldn&amp;#39;t be stored but it still changes?[/quote]
&lt;p&gt;Changing the name, and then storing it persistently in flash are 2 different operations.&amp;nbsp;It tries to save the name persistently&amp;nbsp;since you have&amp;nbsp;CONFIG_BT_SETTINGS=y&lt;/p&gt;
&lt;p&gt;If you set these configs, you might be able to store it&amp;nbsp;successfully&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>