Hi,
Of course I checked it, pointers point to correct tables with correct
values. I printed out (via serial) vaules send to host
durning InDataStage but I cut it off  from the previous post. This is
the debug fragment with InDataStage call:
[...]
GetDescriptor
DEVICE_DESCRIPTOR
InDataStage bufferSize=18
0 outPtr=12
1 outPtr=1
2 outPtr=0
3 outPtr=2
4 outPtr=0
5 outPtr=0
6 outPtr=0
7 outPtr=20
8 outPtr=d8
9  outPtr=4
10 outPtr=41
11 outPtr=45
12 outPtr=1
13 outPtr=0
14 outPtr=1
15 outPtr=2
16 outPtr=0
17 outPtr=1
ProcessControlTransfer USTAT =0x04
[...]
The above outPtr values (12,1,0,2,...) are from  dev desc. table:
__code byte deviceDescriptor[] =
{
    0x12, 0x01, // bLength, bDescriptorType
    0x00, 0x02, // bcdUSB (low byte), bcdUSB (high byte)
    0x00, 0x00, // bDeviceClass, bDeviceSubClass
    0x00, E0SZ, // bDeviceProtocl, bMaxPacketSize
    0xD8, 0x04, // idVendor (low byte), idVendor (high byte)
    0x41, 0x45, // idProduct (low byte), idProduct (high byte)
    0x01, 0x00, // bcdDevice (low byte), bcdDevice (high byte)
    0x01, 0x02, // iManufacturer, iProduct
    0x00, 0x01  // iSerialNumber (none), bNumConfigurations
};

so pointers are OK.

regards,
marico


2011/11/9 Kustaa Nyholm <kustaa.nyh...@planmeca.com>:
> On 11/9/11 11:54, "M L" <maricol...@gmail.com> wrote:
>>outPtr = &deviceDescriptor;
>>so I changed it to
>>outPtr = (byte *)&deviceDescriptor;
>
> >From the top of my head and not looking at the code,
> pointers in SDCC/PIC come in three types depending weather
> they refer to RAM, ROM or are generic.
>
> Your cast above may be generating a generic pointer
> where as most likely the original code intended a data
> (__data byte*)  or code pointer (__code byte*)
> depending where 'deviceDescriptor' is.
>
> The USB hardware in the pic only handless transfer
> to/from RAM (data), but most likely the actual device
> descriptor is in ROM (code). So examine the code
> to see what 'deviceDescriptor' is in your code
> and cast as appropriate.
>
> I may be totally wrong of course.
>
> br Kusti
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to