-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assigning new PID with Espressif VID to TinyUSB stack with Arduino ESP32 Core #8299
Comments
If you are using menuconfig, then it's likely you are generating a new sdkconfig.h file. At the Arduino level the sdkconfig options are pre-set, as they are pre-compiled into the binary files. It's likely you'll need to convert your project to IDF (possibly with Arduino as IDF component) to set the PID. @SuGlider Can you confirm PID is an sdkconfig option? |
The USB class itself has getters and setters for VID/PID: https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/USB.h#L50-L54 |
Any idea if there are any guides on how to do this type of thing? We are only using the Arduino core, not using menuconfig in the IDF at all. Really needing to find some guidance here.
Does this relate to what we already tried, here:
|
As mentioned in that issue, post some code and output from setting USB.PID. Note that you must set the VID/PID before you call USB.begin(). |
Sorry after a bit more playing, it worked simply using this: However, as expected, in Device Manager now the Native USB shows up as a device without a driver. I just used the next available one in the Espressif PID list as a test (will change once we know the process works and will reserve one for us) What is the solution to this now, to get it to load the same driver as before (usbser.sys) but with a different set of VID/PID values, for Windows 10/11 ? Is there any information available to show how this is done? I found this repo (https://github.com/kutukvpavel/Esp32-Win7-VCP-drivers), which looks to do the right type of thing, but this is more for Windows 7. Is it the driver signing in windows 10/11 which stops this method working, and we would have to get this new INF file signed in order to make this work? Is this the type of thing required? Does anyone know how this process works? Thanks |
Does anyone have any information as to how to practically go about doing this? |
How much do you understand about USB? This is not the correct place to ask for tutorials, and google know a lot about this. https://en.wikipedia.org/wiki/USB_human_interface_device_class |
I am specifically asking for support for ESP32-S3 for changing VID/PID based on the Espressif VID/PID register, and the ESP32-Arduino core. Every time I contact Espressif, they point me back here. |
Please excuse if I misunderstood, but in #8299 (comment) you wrote that you have already figured this part out: calling PID and VID methods of USB class was necessary to set the VID and the PID.
This, I'm afraid, is a bit out of scope of Arduino-esp32 project. I'll give you a few pointers to get started:
|
Hi @igrr Yes we have the VID and PID changed with the methods, which seems to only be for the current project loaded, but I think by making a board variant and setting it in the arduino_pins.h this gets around having to do that. So that is fine. However when we change the VID / PID, Windows device manager does not know how to use it. How do you change it to 02 like your link in 1 suggests? Using the methods for: Did nothing to change what we have in the image We did method 3, took an INF and added in our VID/PID detail, and digitally signed the driver, and installed it, but it still is not accepted, most likely as the Class and Subclass is still 00, which we dont know how you change... It would seem in the ardino_pins.h for the variant, there is no obvious way to change it either...? Hardware ID's changed to what we set in the sketch code though. If you have any other suggestions, I would love to hear. Much appreciated |
Can you please provide full USB init code that you are using. Device and all. |
We have made our own device, but you can replicate it with the ESP32S3 DEV module in the Arduino IDE. The code is literally: `#include "USB.h" void setup() void loop() delay(5000); My colleague is playing around with the USB.cpp file, and added the following: and into the version of the 2.0.9 core, that is the only change. But the USB methods in the sketch code I put above, does not change the Class and Subclass. Is there a reason the USB methods in the sketch do not work though? Is the USB.h / .cpp files preventing that from happening? Hopefully this is the information you were after. |
You did not create any device actually. This is an empty USB device. Why not start CDC at least? It is very much possible that Windows sees an empty device and is not assigning anything to it. |
Sorry @me-no-dev, got that fixed now, and working, but it makes it clear there are two issues (1 and 2 below) with the ESP Arduino core
This is also reported in a very long Issue thread here: #6762 Whilst I think the first issue should be an easy fix, for someone with the required knowledge, the second, I’m not sure about, it might be part of the ESP32’s OTP flash. The second issue becomes a show stopper for us, as our products dont have a reset button on them as it has been deemed not required (and shouldnt be). In USB CDC mode, this issue is not present as after programming the modules it resets and runs the application immediately - as you would expect. However in CDC mode we are left with the defult VID/PID arrangement, which we were trying to customise to give our product a different customer 'face', if you will. At this stage we can see no option other than to use the defaults, as this reset issue is overwhelming and becomes more of a negative than any positive of customising VID/PID can overcome. Please advise. |
|
USB is started before setup only if you select CDC_ON_BOOT. You can start that yourself later and change VID/PID that way |
Hi @James-4DSystems, Im in the same fight than you. I was able to change de pid and vid using USB API (USB.cpp/USB.h) but was unable to set de class, subclass and protocol thefore my windows do not recognize the device. I read the you comment #8299 (comment) but did not understant what change you did on arduino_pins.h. Can you give more details? Thanks in advance. |
Hi @rafaelgerges But if you look above at this post, #8299 (comment) In the arduino_pins.h, we started off by just tweaking the ones in the: I really wish this was better explained, as unless you already know how this works or are an IT guru, its a right pain to get working. Seems to be a lot of assumed knowledge, which is quite frustrating. I hope that is somewhat helpful. I hope I have the details right, as I backtracked everything we did. |
is this still valid @James-4DSystems? |
I havent checked, but I dont recall seeing anything written about things being changed, so can only assume its still valid. |
I am going to close this because:
I think this about exhausts all possible ways to do it :) As for the Windows driver, this is out of scope here. |
Board
ESP32-S3R8 SoC
Device Description
Custom products we are building, using the ESP32-S3R8 SoC
Hardware Configuration
Many things are connected, including display, IO Expander, RTC, RTP/CTP touch.
D+/D- are going to a USB-C connector.
Hardware is working nicely and we can program it from the Arduino IDE (both 1.x and 2.x) without any problems, using the USB-C as well as the UART in conjunction with RESET and GPIO0 etc.
Version
v2.0.9
IDE Name
Arduino IDE
Operating System
Windows 10 / 11
Flash frequency
80Mhz
PSRAM enabled
yes
Upload speed
921600
Description
Not a problem as such, looking for directions as to how to set the Espressif allocated PID (ref: https://github.com/espressif/usb-pids) alongside the Espressif VID, to the TinyUSB Stack, so our products are identified as our own, rather than using the standard 0x1001 PID, and our board showing up as random other products which also use the ESP32.
I have already made contact with Espressif Support, and they suggested I raise the issue with you on this Github directly.
Their email response:
Is it possible to set the PID of the TinyUSB via the Arduino ESP32 core, or do we have to go about figuring out how to use the IDF and do it that way?
We are looking for a solution to be able to do this in production of our products. We have not used the IDF directly before, we are only using the Arduino ESP32 core, currently v2.0.9
It has been suggested to trying things such as USB.PID(0x8999) to set it, however this does not work.
(ref: espressif/usb-pids#101)
Please can you detail if its possible to set the PID using the Arduino ESP32 core, as we just cannot find the information required to do this. If we need to do it via the IDF directly, please indicate this, so we can focus our efforts there instead.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: