Skip Menu |

This queue is for tickets about the USB-Descriptor CPAN distribution.

Report information
The Basics
Id: 131126
Status: open
Priority: 0/
Queue: USB-Descriptor

People
Owner: Nobody in particular
Requestors: Chris.Williams2 [...] exsel-group.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug in max_current value
Date: Mon, 2 Dec 2019 13:55:22 +0000
To: "bug-USB-Descriptor [...] rt.cpan.org" <bug-USB-Descriptor [...] rt.cpan.org>
From: Chris Williams <Chris.Williams2 [...] exsel-group.com>
Hi, I have started using the usb descriptor software, and it looks really useful. Checking some of the values suggests that the max_current setting wraps at 128. If I set 500mA, it returns a value of 0x7A. This is revision 4 running on a Linux system. Regards, Chris. Chris Williams Electronics Engineer Exsel Electronics Limited | 4 Ravenscroft Court | Buttington Cross | Welshpool | Powys | SY21 8SL T: +44 1684 579 000 Ext. *411 | E: Chris.Williams@exsel-group.com | W: http://www.exsel-group.com This e-mail is UNCLASSIFIED and only for the use of its intended recipient. Its contents are confidential and may be privileged. Exsel Electronics Limited does not guarantee that this e-mail has not been intercepted and amended or that it is virus-free. This e-mail is for the intended addressee only. If you have received it in error, then you must not use, retain, disseminate or otherwise deal with it and you should notify the sender by return e-mail. This email is from Exsel Electronics Limited. Registered in Wales at 4 Ravenscroft Court, Buttington Cross, Welshpool, Powys, SY21 8SL Reg No: 11085251
Subject: Re: [rt.cpan.org #131126] Bug in max_current value
Date: Sat, 7 Dec 2019 19:13:36 -0800
To: bug-USB-Descriptor [...] rt.cpan.org
From: Brandon Fosdick <bfoz [...] bfoz.net>
Hi Chris, I haven’t looked at this project in a very long time, so my memory may be fuzzy. Are you setting max_current to 500 and then seeing that attribute equals 0x7A, or are you seeing the 0x7A in the bytes() output? I’m pretty sure the relevant field in the USB descriptors is only a single byte, and is in units of 2mA. So setting max_current to 500 should yield a value of 0xFA in bytes(). If you’re really getting 0x7A, then that is a problem and I’ll have to look into it. Thanks for the bug report. -Brandon Show quoted text
> On Dec 2, 2019, at 05:55 , Chris Williams via RT <bug-USB-Descriptor@rt.cpan.org> wrote: > > Mon Dec 02 08:55:31 2019: Request 131126 was acted upon. > Transaction: Ticket created by Chris.Williams2@exsel-group.com > Queue: USB-Descriptor > Subject: Bug in max_current value > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: Chris.Williams2@exsel-group.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131126 > > > > Hi, > > I have started using the usb descriptor software, and it looks really useful. > > Checking some of the values suggests that the max_current setting wraps at 128. If I set 500mA, it returns a value of 0x7A. > > This is revision 4 running on a Linux system. > > Regards, > > Chris. > > > > Chris Williams > Electronics Engineer > Exsel Electronics Limited | 4 Ravenscroft Court | Buttington Cross | Welshpool | Powys | SY21 8SL > T: +44 1684 579 000 Ext. *411 | E: Chris.Williams@exsel-group.com | W: http://www.exsel-group.com This e-mail is UNCLASSIFIED and only for the use of its intended recipient. Its contents are confidential and may be privileged. Exsel Electronics Limited does not guarantee that this e-mail has not been intercepted and amended or that it is virus-free. This e-mail is for the intended addressee only. If you have received it in error, then you must not use, retain, disseminate or otherwise deal with it and you should notify the sender by return e-mail. This email is from Exsel Electronics Limited. Registered in Wales at 4 Ravenscroft Court, Buttington Cross, Welshpool, Powys, SY21 8SL Reg No: 11085251 > >
Subject: RE: [rt.cpan.org #131126] Bug in max_current value
Date: Mon, 9 Dec 2019 09:24:42 +0000
To: "bug-USB-Descriptor [...] rt.cpan.org" <bug-USB-Descriptor [...] rt.cpan.org>
From: Chris Williams <Chris.Williams2 [...] exsel-group.com>
Hi Brandon, Thanks for the reply. Very nice bit of software that I would like to use as the basis for my USB design. I tried a few examples and found what I think is the bug described. I actually pasted the result into an online checker, and that’s when I saw the problem. I am expecting a 500mA current draw so I changed the entry and that's when the trouble started! As you say, the result is a single byte and should give the result 0xFA not 0x7A. Looking at the code I can see the calculation looks correct, but I am not a perl programmer and I could not see how to correct the problem? It could be something I am doing wrong, but any help would be gratefully received. Regards, Chris. Chris Williams Electronics Engineer Exsel Electronics Limited | 4 Ravenscroft Court | Buttington Cross | Welshpool | Powys | SY21 8SL T: +44 1684 579 000 Ext. *411 | E: Chris.Williams@exsel-group.com | W: http://www.exsel-group.com This e-mail is UNCLASSIFIED and only for the use of its intended recipient. Its contents are confidential and may be privileged. Exsel Electronics Limited does not guarantee that this e-mail has not been intercepted and amended or that it is virus-free. This e-mail is for the intended addressee only. If you have received it in error, then you must not use, retain, disseminate or otherwise deal with it and you should notify the sender by return e-mail. This email is from Exsel Electronics Limited. Registered in Wales at 4 Ravenscroft Court, Buttington Cross, Welshpool, Powys, SY21 8SL Reg No: 11085251 Show quoted text
-----Original Message----- From: bfoz@bfoz.net via RT <bug-USB-Descriptor@rt.cpan.org> Sent: 08 December 2019 03:15 To: Chris Williams <Chris.Williams2@exsel-group.com> Subject: Re: [rt.cpan.org #131126] Bug in max_current value <URL: https://rt.cpan.org/Ticket/Display.html?id=131126 > Hi Chris, I haven’t looked at this project in a very long time, so my memory may be fuzzy. Are you setting max_current to 500 and then seeing that attribute equals 0x7A, or are you seeing the 0x7A in the bytes() output? I’m pretty sure the relevant field in the USB descriptors is only a single byte, and is in units of 2mA. So setting max_current to 500 should yield a value of 0xFA in bytes(). If you’re really getting 0x7A, then that is a problem and I’ll have to look into it. Thanks for the bug report. -Brandon
> On Dec 2, 2019, at 05:55 , Chris Williams via RT <bug-USB-Descriptor@rt.cpan.org> wrote: > > Mon Dec 02 08:55:31 2019: Request 131126 was acted upon. > Transaction: Ticket created by Chris.Williams2@exsel-group.com > Queue: USB-Descriptor > Subject: Bug in max_current value > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: Chris.Williams2@exsel-group.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=131126 > > > > Hi, > > I have started using the usb descriptor software, and it looks really useful. > > Checking some of the values suggests that the max_current setting wraps at 128. If I set 500mA, it returns a value of 0x7A. > > This is revision 4 running on a Linux system. > > Regards, > > Chris. > > > > Chris Williams > Electronics Engineer > Exsel Electronics Limited | 4 Ravenscroft Court | Buttington Cross | Welshpool | Powys | SY21 8SL > T: +44 1684 579 000 Ext. *411 | E: Chris.Williams@exsel-group.com | W: http://www.exsel-group.com This e-mail is UNCLASSIFIED and only for the use of its intended recipient. Its contents are confidential and may be privileged. Exsel Electronics Limited does not guarantee that this e-mail has not been intercepted and amended or that it is virus-free. This e-mail is for the intended addressee only. If you have received it in error, then you must not use, retain, disseminate or otherwise deal with it and you should notify the sender by return e-mail. This email is from Exsel Electronics Limited. Registered in Wales at 4 Ravenscroft Court, Buttington Cross, Welshpool, Powys, SY21 8SL Reg No: 11085251 > >