<?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>Custom device name for nrf52840 USB dongle in pyserial</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120474/custom-device-name-for-nrf52840-usb-dongle-in-pyserial</link><description>I am making an application using nrf52840 USB dongle. 
 I am using a python program with pyserial. This works great. My only problem is that I want to have a very reliable way to identify the correct USB device. I am using this code in python to identify</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Apr 2025 19:37:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120474/custom-device-name-for-nrf52840-usb-dongle-in-pyserial" /><item><title>RE: Custom device name for nrf52840 USB dongle in pyserial</title><link>https://devzone.nordicsemi.com/thread/531435?ContentTypeID=1</link><pubDate>Thu, 10 Apr 2025 19:37:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ce1c3cc-7516-4164-9229-61db8871d49a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi bjornolsen,&lt;/p&gt;
&lt;p&gt;What you found gave me a great clue to recall something. The root cause is that Windows cache the device name since the first time you connected to it. When you change VID and PID, it recognizes the device as something new, so the configured name goes through.&lt;/p&gt;
&lt;p&gt;Thus, this is a limitation on the host OS, Windows. There is not much that can be done from the device application, unfortunately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom device name for nrf52840 USB dongle in pyserial</title><link>https://devzone.nordicsemi.com/thread/531402?ContentTypeID=1</link><pubDate>Thu, 10 Apr 2025 15:04:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:575ccbb6-7713-4a25-abd1-59bfe958cfa7</guid><dc:creator>bjornolsen</dc:creator><description>&lt;p&gt;I am having some&amp;nbsp;small success here.&lt;br /&gt;&lt;br /&gt;In order for it to show up as a SDFU device AFTER flashing I need to add&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_USB_DEVICE_VID=0x1915  
CONFIG_USB_DEVICE_PID=0x521F  &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If I use any other VID/PID it seems to show up as a generic device (unless I register my company with windows I would guess).&lt;br /&gt;&lt;br /&gt;It seems that my best bet is to go with this. At least then it shows up a a nordic USB rather than windows generic usb.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;It seems I am unable to set the custom name, but that is not so important as long as I have a clearly distinguishable name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom device name for nrf52840 USB dongle in pyserial</title><link>https://devzone.nordicsemi.com/thread/531242?ContentTypeID=1</link><pubDate>Wed, 09 Apr 2025 18:31:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22479126-4c3c-4d6b-9f3d-9953dee2c8a2</guid><dc:creator>bjornolsen</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;I cloned the library and built the application with no problems using SDK 2.9.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I still see&lt;br /&gt;&lt;br /&gt;&amp;quot;COM20 USB Serial Device (COM20)&amp;quot;.&lt;br /&gt;&lt;br /&gt;in windows device manager I see exactly the same.&lt;br /&gt;Manufacturer: &amp;quot;Microsoft&amp;quot;.&lt;br /&gt;&lt;br /&gt;I think Microsoft simply do not reconize this USB stick.&lt;br /&gt;&amp;quot;Device USB\VID_2FE3&amp;amp;PID_0004&amp;amp;MI_02\6&amp;amp;b296da&amp;amp;0&amp;amp;0002 requires further installation.&amp;quot;&lt;br /&gt;&lt;br /&gt;It almost seems that it needs some kind of driver in order to reconize it.&lt;br /&gt;&lt;br /&gt;I have not tried the nrf52840dongle on linux. All I really want it to&amp;nbsp;reliably detect it there are many USB devices connected (and that is often the case). But it shows up in windows as a &amp;quot;generic USB&amp;quot; device. that is the isssue.&lt;br /&gt;&lt;br /&gt;Maybe I am simply missing a driver.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note! I tried this in SDK 2.9 and 2.7, same result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom device name for nrf52840 USB dongle in pyserial</title><link>https://devzone.nordicsemi.com/thread/531082?ContentTypeID=1</link><pubDate>Tue, 08 Apr 2025 19:17:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d99f969d-932c-469c-91df-44624a875a25</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;What would be shown if you flash this sample onto the dongle? I don&amp;#39;t have a dongle with me right now to test.&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/v3.7.99-ncs2-rc1/samples/subsys/usb/console"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/v3.7.99-ncs2-rc1/samples/subsys/usb/console&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I wonder if the bootloader on the dongle gets registered with the PC first and causes issue. Do you also have a nRF52840 DK to cross check application behavior?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom device name for nrf52840 USB dongle in pyserial</title><link>https://devzone.nordicsemi.com/thread/530827?ContentTypeID=1</link><pubDate>Mon, 07 Apr 2025 13:00:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db84942f-35a9-4d1b-bd7a-5bd1e98a8bd1</guid><dc:creator>bjornolsen</dc:creator><description>&lt;p&gt;Hello.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Well I don&amp;#39;t know what I am expected to see really.&lt;br /&gt;&lt;br /&gt;on windows the device shows up like this&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;Get-WmiObject Win32_SerialPort | Where-Object { $_.PNPDeviceID -like &amp;#39;USB*&amp;#39; } | Format-Table Name, DeviceID, PNPDeviceID, Description

Name                      DeviceID PNPDeviceID                                   Description
----                      -------- -----------                                   -----------
USB Serial Device (COM22) COM22    USB\VID_2FE3&amp;amp;PID_0100&amp;amp;MI_00\7&amp;amp;227FB56F&amp;amp;0&amp;amp;0000 USB Serial Device&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t want to mount the USB device to windows (I am not using it as a USB storage device).&amp;nbsp;&lt;br /&gt;I would expect that I would see the correct name in device manager. The name in the device manager is the same as what I see over python&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;Device: COM22
 Name: COM22
 Description: USB Serial Device (COM22)
 HWID: USB VID:PID=2FE3:0100 SER=3702 LOCATION=1-2.2:x.0
 VID: 12259
 PID: 256
 Serial number: 3702
 Manufacturer: Microsoft
 Product: None&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom device name for nrf52840 USB dongle in pyserial</title><link>https://devzone.nordicsemi.com/thread/530801?ContentTypeID=1</link><pubDate>Mon, 07 Apr 2025 11:45:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53e096ba-dbbd-4209-be0d-e6442176d2f7</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello bjornolsen,&lt;/p&gt;
&lt;p&gt;I believe this is more a pyserial&amp;nbsp;issue than a nRF device issue, so perhaps a more general software engineering or Python forum might be able to help you better.&lt;/p&gt;
&lt;p&gt;On the nRF Device, you only need to set CONFIG_USB_DEVICE_PRODUCT&amp;nbsp;like you already did.&amp;nbsp;If you use some library to interact with USB device rather than serial port, you should be able to see the configured name.&lt;/p&gt;
&lt;p&gt;I found this thread on Stack Overflow which seems to address a similar issue:&amp;nbsp;&lt;a href="https://stackoverflow.com/questions/35724405/pyserial-get-the-name-of-the-device-behind-a-com-port"&gt;python - Pyserial get the name of the device behind a COM Port - Stack Overflow&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>