<?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>nRF5340 - custom USB SerialNumber</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90348/nrf5340---custom-usb-serialnumber</link><description>Hi, running the USB hid sample project and sending from host terminal $ journalctl -k -n 10 I get [ 2231.751311] usb 1-1.3: SerialNumber: D0766E074450A9F0 
 I want to change the exposed SerialNumber to &amp;quot;2022070001&amp;quot; How to do that ? Looking around somewhere</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Jul 2022 16:04:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90348/nrf5340---custom-usb-serialnumber" /><item><title>RE: nRF5340 - custom USB SerialNumber</title><link>https://devzone.nordicsemi.com/thread/378974?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 16:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52ad0463-4cd5-457f-99f6-1dfe53fc7d4a</guid><dc:creator>Gabriele</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;br /&gt;I&amp;#39;ve succeeded right now. You can close tis ticket.&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - custom USB SerialNumber</title><link>https://devzone.nordicsemi.com/thread/378971?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 15:47:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb4cbe22-c27b-40f1-a062-2a1a3661c7ee</guid><dc:creator>Gabriele</dc:creator><description>&lt;p&gt;Ok. How to force usb_descriptor.c to use my override function without modifying usb_descriptor.c ? What&amp;#39;s the trick ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - custom USB SerialNumber</title><link>https://devzone.nordicsemi.com/thread/378960?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 14:48:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48e0d68c-bf5d-43d9-b6dd-e0055652144e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Don&amp;#39;t&amp;nbsp;use&amp;nbsp;&lt;span&gt;usb_update_sn_string_descriptor() as-is, it was just as en example on how you can write your own&amp;nbsp;usb_update_sn_string_descriptor()&amp;nbsp;to set the&amp;nbsp;usb_serial_str you want to use. Please remove code related to &amp;quot;FICR&amp;quot; from the usb_update_sn_string_descriptor(), it is not used in your case.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - custom USB SerialNumber</title><link>https://devzone.nordicsemi.com/thread/378912?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 12:37:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0392a1c-a675-4c64-9c3b-d57847423dc6</guid><dc:creator>Gabriele</dc:creator><description>&lt;p&gt;The compiler complains NRF_FICR_Type has no member named DEVICEADDR.&lt;br /&gt;My target device is nRF5340.&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - custom USB SerialNumber</title><link>https://devzone.nordicsemi.com/thread/378890?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2022 11:48:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4d54385-a7c3-4ff2-8028-8db979909a49</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Looks like this only allocate a placeholder for the serial number string yes.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see a way around this without modifying usb_descriptor.c in some way, you can either manipulate directly&amp;nbsp;usb_fix_ascii_sn_string_descriptor(), but it may also look like the implementation of&amp;nbsp;usb_update_sn_string_descriptor() is weak, which should mean that if you write a new&amp;nbsp;usb_update_sn_string_descriptor() somewhere in your project that is included by include files at top of usb_descriptor.c/h, then it will fetch the serial number from there (instead of the default weak implementation you can find of&amp;nbsp;usb_update_sn_string_descriptor() in usb_descriptor.c)&lt;/p&gt;
&lt;p&gt;I can find that for instance the \connectivity_bridge\src\main.c does this by:&lt;/p&gt;
&lt;p&gt;/* Overriding weak function to set iSerialNumber at runtime. */&lt;br /&gt;uint8_t *usb_update_sn_string_descriptor(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; snprintk(usb_serial_str, sizeof(usb_serial_str), USB_SERIALNUMBER_TEMPLATE,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (uint32_t)(NRF_FICR-&amp;gt;DEVICEADDR[1] &amp;amp; 0x0000FFFF)|0x0000C000,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (uint32_t)NRF_FICR-&amp;gt;DEVICEADDR[0]);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; return usb_serial_str;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - custom USB SerialNumber</title><link>https://devzone.nordicsemi.com/thread/378718?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2022 12:51:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c56406cd-8598-4f33-a112-06a6ab1a9e22</guid><dc:creator>Gabriele</dc:creator><description>&lt;p&gt;Yes I did.&lt;/p&gt;
&lt;p&gt;If I do not use CONFIG_USB_DEVICE_SN then I get&lt;br /&gt;[ 2231.751311] usb 1-1.3: SerialNumber: D0766E074450A9F0&lt;/p&gt;
&lt;p&gt;If I use&amp;nbsp;CONFIG_USB_DEVICE_SN=&amp;quot;2022070001&amp;quot; then I get&lt;br /&gt;[ 2231.751311] usb 1-1.3: SerialNumber: 074450A9F0&lt;/p&gt;
&lt;p&gt;The displayed string is the same, only it is truncated to the lenght of CONFIG_USB_DEVICE_SN&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 - custom USB SerialNumber</title><link>https://devzone.nordicsemi.com/thread/378715?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2022 12:41:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a0ebe4c-510e-4705-b803-fa2d616c711e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Have you tried to use CONFIG_USB_DEVICE_SN:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/kconfig/CONFIG_USB_DEVICE_SN.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/kconfig/CONFIG_USB_DEVICE_SN.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>