store and retreive string ids

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
CSK10
Level 3
Level 3
First like received First like given 50 sign-ins

Hello ;

after having followed https://community.infineon.com/t5/Knowledge-Base-Articles/Configuring-the-USB-serial-number-in-EZ-US... for configuring USB serial number.

I want to know if there is anything possible to read the string using EP0 ?
I did try this code in 
BOOL DR_GetDescriptor(void)

{

BYTE length,i;

//pStringDscr = (WORD)&StringDscr;
//pStringDscr3 = (WORD)&StringDscr3;
//pStringDscr3End = (WORD)&StringDscr3End;

switch (SETUPDAT[2])
{
case GD_STRING: //STRING Descriptor
SUDPTRH = MSB(pStringDscr);
SUDPTRL = LSB(pStringDscr);
//return (FALSE);
//case GD_REPORT: //Report Descriptor
length = pStringDscr3End -pStringDscr3;

AUTOPTR1H = MSB(pStringDscr3);
AUTOPTR1L = LSB(pStringDscr3);

for(i=0;i<length;i++)
{
EP0BUF[i]=XAUTODAT1;
}
EP0BCL = length;
return (FALSE);
default:
return(TRUE);
}
}

This code compiles without any error but how do i check the data received ?

0 Likes
1 Solution
Ajeethkumar_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 100 solutions authored

Hi,

String descriptors will provide displayable information describing a descriptor in human-readable form. String descriptors will be obtained from the USB device as part of the device enumeration. USB host gets the set of descriptors including String descriptors from the device during enumeration as per the USB specification. 

Based on the index provided in the descriptors, the USB host gets the String descriptors from the device for all the indexes.

You can see all the Strings(Unicode strings in the string descriptor) in the Device details Tab of the Device Manager.

If you want to know when exactly this data is sent to the host, you can use any Hardware Analyzer(like Lecroy) or Software Analyzer(like WireShark).

Thanks,
Ajeeth

View solution in original post

0 Likes
3 Replies
Ajeethkumar_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 100 solutions authored

Hi,

String descriptors will provide displayable information describing a descriptor in human-readable form. String descriptors will be obtained from the USB device as part of the device enumeration. USB host gets the set of descriptors including String descriptors from the device during enumeration as per the USB specification. 

Based on the index provided in the descriptors, the USB host gets the String descriptors from the device for all the indexes.

You can see all the Strings(Unicode strings in the string descriptor) in the Device details Tab of the Device Manager.

If you want to know when exactly this data is sent to the host, you can use any Hardware Analyzer(like Lecroy) or Software Analyzer(like WireShark).

Thanks,
Ajeeth

0 Likes
lock attach
Attachments are accessible only for community members.

Hi ,

Yes i wanted to check when exactly the data is being sent to the host and hence was checking the wireshark. However i can only see that the strings are being sent.

But I am trying to send that data to the control ep0 via the above method. I dont see anything related to EP0 , which ideally would contain the string data

0 Likes
Ajeethkumar_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 100 solutions authored

Hi,

Can you share the Wireshark trace(till the enumeration is complete)?

Thanks,
Ajeeth

0 Likes