-
Notifications
You must be signed in to change notification settings - Fork 24
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
Wish the OpenCM9.04 had a more complete USB descriptor #21
Comments
You are right that some information of usb could be updated so we are considering the wrong information to fix it. |
Thanks, not sure how doable the Serial number stuff is? My Quick look at the code, looks like there may be some unique numbers stored in hardware?
Which the function: Get_SerialNum uses:
Which could be optionally called in the function:
Which I think should be callable (I think). I believe it is similar to what the Teensy does.... There is then also code on Teensy that then converts to string, and optionally returns that if an app asks for the String Resource of the ID, which is stored in the device descriptor. |
The reason why Get_SerialNum() was commented is to fix the problem on the macOS. P.S.
after
I think, it's because of different code between bootloader and arduino firmware. Thank you for the comment. |
Again not sure how much of a help I am here, very little experience with these processors. More experience with Teensy boards by PJRC including doing some work to help support host USB on the T3.6. My guess is the Bootloader vs User code, should not mater? I would think the USB negotiation is done early on... Although maybe differences especially if for example the PID/VID is different when in a programming mode... Somethings I notice different between Teensy serial number stuff (https://github.com/PaulStoffregen/cores/blob/master/teensy3/usb_desc.c#L1444) and here a) He is using just extracting a 32 bit number as the serial number... You are using larger number of characters. That is he is outputting up to 10 digits and only enough characters for the actual number. b) There is a check/fix for MAC bug
c) I don't fully understand how your descriptor stuff works. On the Teensy there is a top level descriptor list, which is used to build the data. This includes the string descriptors for VID/PID/Serial... (About line 1485 in file I showed). With your code, I think this is ctonrolled in the _Device_cb structure.
Note the last item is for String descriptors, and is under #9 Which looks like it is not set
But again I don't fully understand all of this code |
Thanks @KurtE The usb codes of OpenCM is based on stm32cubF1 middleware provided by ST. When downloading in Arduino IDE, the OpenCM goes to reset and the usb is disconnected and the usb is reconnected by the bootloader. At this time, the different serial port number could appear if bootloader and firmware have different code. I'll check what you said. I think it could take some time. Thanks again. |
Yes - looks like it might be difficult. I did hack up my system to allow me to run the code from the development branch and did as you mention of change the iSerial from 0->3 and yes the board is now getting two different comm port numbers on windows. I verified looking on unix and with this configuration, it gets shows that iSerial is still 0 if I plug the board in holding the user button... Also shows different product and vendor names as well and a few other differences in the linux verbose output. What what it is worth, what they did with the Teensy is when you reboot into program mode, it gives it a different device ID, it also does not configure as CDC ACM mode but instead a RAW HID mode (so no serial port assigned...) But that does not help you here. Good luck, hopefully there is some way to make it work and I may play around some more, but unfortunately don't have any new ideas yet. Also I am not sure if the bootloader sources are in here? And how hard it is to update? Can I use ST-LINK to update? Kurt |
A few more thoughts. Again wondering about is the sources for the bootloader available? If so, maybe we could update the bootloader to also return the Serial number? If so, maybe could setup a sketch or like to update the firmware on existing 904 boards. I believe this is possible as, it looks like someone already built a sketch to update the bootloader to one that is compatible with maple: https://github.com/Gregwar/maple-bootloader-robotis/blob/master/sketch/opencm904_maple_loader/opencm904_maple_loader.ino |
I don't know if you have been following the issue #20 (#20) But turned out my old 904B had a real old bootloader on it which was only compatible with the Open_CM ide... I found this out by writing a sketch that dumped the bootloaders of a newer board and my old board and verified that they were very different. Files up on other issue. I found a sketch that someone had written to update the bootloader to be compatible with Maple development... So today I hacked up that sketch to instead use the data I dumped from the newer 904A board and built and downloaded it using the Open_CM IDE and now the old board works with Arduino IDE as well as with R+Manager... Other thread has zip file with this program So If we can build a new firmware that has the iSerial number and same method of generating the serial number from the 96 bit unique ID, it should not be hard for users to upgrade their boards to this functionality. |
Thanks for the information. Thanks again for trying to improve. |
Thanks for looking into this. I am guessing that this is going to be a no fix... I can totally understand, not wanting to risk it. But do think there could maybe be a two pronged approach. That is ship all new ones with the updated bootloader and offer ways for people to upgrade older ones. I am assuming that the R+ Manager only reports the current bootloader version and does not have the ability to update it. Note: the Maple program I mentioned in the other issue, also had secondary way to update the firmware, which looks like a pain. That is, I believe the underlying STM32 has the ability to download a bootloader using Serial1 (how to get one on there when they are new), and the Readme of the maple project shows steps needed to enter into bootloader download mode.... But again probably requires additional hardware (like a USB to UART converter)... Obviously we can get by without fixing this. But might be nice, especially if someone wishes to use multiple of these units on their Robot or other processor... Currently I am assuming that the bootloader is NOT open source? |
I understand what you said. I am also engineer who want to give a lot of options to the user. As I said, it's not official version. It's my personal modified version so it could be different from official version. Thanks again. |
Thanks, will take a look. Not sure what toolchain was used to build... Probably can setup something that uses tools that are part of the Arduino install. |
I just modifed Makefile to build for gcc5. The build was successfull but I didn't test it's working. |
This issue will be closed since there were no actions for a while. You can reopen this issue to show this issue to the users whenever. Thanks. |
As the title mentions, I wish the descriptor was more complete, some of it may simply be cosmetic, like maybe having string objects to give the company name and product name... But part of it is also functional information. For example does each OpenCM9.04 have a Serial number?
My guess is currently not or at least not accessible as part of the USB information. Why is this maybe important. Unlike other Arduino devices, that I plug into my computer, all of the OpenCM boards all try to use the same COM port number on Windows. I Have not checked on a MAC, but guessing probably the same.
Example comparing the information that Linux knows about the device:
Now if you instead compare the information for a PJRC Teensy 3.2 board
You can see some of the differences, in particular, the difference in:
There are many times when this information may not be important to most people, but could be if they for example wish to use multiple of these devices and be able control different sets of servos.
My guess is that some of this could be updated in the file: ...\OpenCM9.04\arduino\opencm_arduino\opencm9.04\variants\OpenCM904\hw\usb_cdc
Again not sure if the boards have a unique serial number or not.
Hope this makes sense.
The text was updated successfully, but these errors were encountered: