You were right, Other pointer point to usbram memory: inPtr =(byte *) &controlTransferBuffer;
were controlTransferBuffer is: #pragma udata usbram5 controlTransferBuffer volatile byte controlTransferBuffer[E0SZ]; changing code to: inPtr =(__data byte *) &controlTransferBuffer; fixed my problems. For me this is an unusual sdcc behavior, I often use pointers to char arrays, like: char buf[32], *p; p=&buf and "p" points correctly to buf, which is located in ram. So why it won't work with usbram ? regards, 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