Page 1 of 3

USB VID & PID

Posted: Mon 2019-04-15 13:55
by Arek
Hi,

how can I set USB Vendor ID & Product ID (and, of course, vendor and product)
I've seen somewhere in the forum a code with VLSI as vendor but can not found.
With search function in VS1010 forum I get no results. (OK, one:).

Many thanks
am

Re: USB VID & PID

Posted: Fri 2019-04-19 11:58
by Arek
Hi,

perhaps it is so obvious that it does not require any explanation.

Anyway, I found a little in VS1000 (not in VS1010 or VS1005):
- a pdf, "VS1000 PROGRAMMER’SGUIDE", p.30
http://www.vlsi.fi/fileadmin/app_notes/guide_vs1000.pdf

- and code example for VS1000:
www.vlsi.fi/fileadmin/software/VS1000/t ... r/spiusb.c

Trying with VS1010 I get div. errors:
"undefined identifier 'DT_VENDOR'"
"Macro redefinition of MODEL_NAME_LENGTH"
<stdin> (1) ERROR 0: preprocessing failed

and so on...

Any tips???

Re: USB VID & PID

Posted: Sun 2019-04-21 19:22
by Panu
Hi! It's easter holiday now in FI, let's see later next week.

Anyway, in VS1010 the USB works differently. For setting serial number, there's a function in the ROM , but to set VID, PID, you need to make your own version of the chapter 9 tables (see ROM source codes) and set the *chapter9 pointer to point to your modified vector. Use the ROM source codes, e.g. usbmsc or usbaudio chapter 9 tables as basis for your own vector, depending of what kind of USB device you are declaring. What are you? Mass storage? Audio?

You can see the AndroidAudio project source code as a reference, especially if you are making an audio device.

"chapter 9" refers to chapter 9 of the USB specification, especially chapter 9.3, "USB Device Requests".

-Panu

Re: USB VID & PID

Posted: Tue 2019-04-23 7:50
by Panu
What kind of USB device are you trying to declare? Are you using VS1010C or VS1010D?

-Panu

Re: USB VID & PID

Posted: Wed 2019-04-24 9:23
by Arek
Hi Panu,

I have VS1010D, use as a mass storage only.

am

Re: USB VID & PID

Posted: Wed 2019-04-24 17:15
by arlaor
Panu wrote:
Tue 2019-04-23 7:50
What kind of USB device are you trying to declare? Are you using VS1010C or VS1010D?

-Panu
Hi Panu, excuse me for mi question not compatible with this post.
You know specifications for the resistor (CG0603MLA-5.5M) used in LEFT, RIGHT and GBUF out? http://www.vlsi.fi/fileadmin/evaluation ... yer_07.pdf
What is the value ohm and % tolerance?
Thanks

Re: USB VID & PID

Posted: Wed 2019-04-24 22:34
by Panu
it is a varistor.

https://www.avnet.com/shop/us/products/ ... 634761212/

Var MOV 4VAC/5.5VDC 30A 9.6V 0603 SMD Paper T/R

Re: USB VID & PID

Posted: Tue 2019-04-30 11:48
by Arek
Hi Panu,

thank you for very good explanation arlaors completely off topic question. (@arlaor: Google, first answer)
But my case ist still open.
Trying kind of "reverse engineering" I get compiler warnings "Unknown preprocessor control macro" and, of course, no any change in PID/VID.

am

Re: USB VID & PID

Posted: Tue 2019-04-30 16:38
by Panu
Hi!

Oops :oops: that unrelated question confused me, making me to forget this question!

Anyway, attached you can find a custom mass storage program for the VS1010D. You can run it from the command line by writing "ums d" (d is for d: e.g. SD card). In the source code you can see how the structures are declared, and you can find the USB VID and PID in "myDeviceDescriptor" table:

Code: Select all

const __y u_int16 mydeviceDescriptor[] = { 
  //Device Descriptor	
  0x1201,   // bLength | bDescriptorType
  0x1001,   // bcd USB Version (01.10) Low | high
  0x0000,   // bDeviceClass:    Defined in Interface Descriptor
  0x0040,   // bDeviceProtocol: -''-, Endpoint 0 size 64
  0xfb19,   // idVendorL VLSI 0x19fb
  0x0210,   // idProductL VS1000: 0x00.0x02 (0x02=MassStorage)
  0x0000,   // bcdDeviceL
  0x0102,   // iManufacturerString
  0x0301    // SerialNumber
};
and the Chapter 9 table that points to e.g. myDeviceDescriptor:

Code: Select all

const __y void* const mychapter9MSC[] = { //USB chapter 9 protocol
	1, //IS_CHAPTER_9 // limit reply lenght to that requested by chapter 9 request
// recordLenght, matchWords, {data}*, replyEndpoint, replyLength, SideEffectFn, replyPacketPtr 
	7, 1, 0x0005, 0, 0, DoSetAddress, NULL, //Set address (zero reply, special)
	8, 2, 0x8006, 0x0001,  0, 18, DoNothing, mydeviceDescriptor, //Get device descriptor
	8, 2, 0x8006, 0x0002,  0, 32, DoNothing, myconfigurationDescriptor, //Get configuration descriptor
...
I hope this is helpful!

-Panu

Re: USB VID & PID

Posted: Thu 2019-05-02 16:33
by Arek
Hi Panu,

compiling UsbMscD solution i get following error:
C:\Program Files (x86)\VSIDE\libvs1010/usbmachine.h (65) ERROR 72: symbol 'usp' already declared
C:\Program Files (x86)\VSIDE\libvs1010/vs1010dRom.h (246) ERROR 72: (previous declaration here)
Aby tips?
Working with VSIDE 2.46

am