<?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>how to set USB serialnumber as the ble mac address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82688/how-to-set-usb-serialnumber-as-the-ble-mac-address</link><description>Hi, 
 my product now is base on the nrf5340, I want to set the USB&amp;#39;s serialnumber same as the ble mac address. 
 when I use the nrf52840, I can set it as follows simply. 
 
 I found the DEVCIEADDR in the network core, but it is not accessible from the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Dec 2021 00:31:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82688/how-to-set-usb-serialnumber-as-the-ble-mac-address" /><item><title>RE: how to set USB serialnumber as the ble mac address</title><link>https://devzone.nordicsemi.com/thread/344699?ContentTypeID=1</link><pubDate>Wed, 22 Dec 2021 00:31:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e5e6013-d6eb-4e8c-a125-5ac3377c68df</guid><dc:creator>Liangshaun</dc:creator><description>&lt;p&gt;ok, thanks very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to set USB serialnumber as the ble mac address</title><link>https://devzone.nordicsemi.com/thread/344556?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 10:44:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:492275d1-be51-4765-8d52-5f82d6497886</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;That sounds like a perfectly viable way to handle it. I asked a colleague as well, and neither of us can immediately see any issue with your approach.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to set USB serialnumber as the ble mac address</title><link>https://devzone.nordicsemi.com/thread/344475?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 03:55:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2598c9d3-bded-44f8-913c-10a0895733bc</guid><dc:creator>Liangshaun</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thanks for your reply. I have try it, but the&amp;nbsp;bt_hci_cmd_send_sync() command can&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;I guess&amp;nbsp;that&amp;nbsp;because the&amp;nbsp;z_impl_hwinfo_get_device_id() function is called in the&amp;nbsp;usb_device_init()&amp;nbsp; which running in the&amp;nbsp;system init&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SYS_INIT(usb_device_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and the&amp;nbsp;bt_hci_cmd_send_sync() maybe work after&amp;nbsp;bt_enable().&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve&amp;nbsp;used a not good way to solve this problem,&lt;/p&gt;
&lt;p&gt;that is using&amp;nbsp; flash to store the special information after &lt;span&gt;bt_enable()&amp;nbsp;&lt;/span&gt;&amp;nbsp;and reset the MCU. then&amp;nbsp;&amp;nbsp;z_impl_hwinfo_get_device_id() can read the&amp;nbsp;&lt;span&gt;information from the&amp;nbsp;special flash page.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;maybe, is there a better way?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to set USB serialnumber as the ble mac address</title><link>https://devzone.nordicsemi.com/thread/344415?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 15:26:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0598b1df-6843-4006-9a31-c70ef06c6b40</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I apologize for the late response.&lt;/p&gt;
&lt;p&gt;You can get the DEVICEADDR on the application core by including hci_vs.h:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;bluetooth/hci_vs.h&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then use a hci command to read the static addresses:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;struct net_buf * rsp;
err = bt_hci_cmd_send_sync(BT_HCI_OP_VS_READ_STATIC_ADDRS, NULL, &amp;amp;rsp);
if (err) {
	printk(&amp;quot;Failed to read DEVICEADDR Err: %d\n&amp;quot;, err);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Let me know if you have any issues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>