Page 1 of 1

USB Slave examples

Posted: Sat May 13, 2017 8:21 pm
by TSMroz
Hi. Keep in mind, I'm a complete newbie to all of this.. I'm trying to do my first code example with the IDE using the USB Slave Component. I've tried using both examples from this page:

https://www.matrixtsl.com/wikiv7/index. ... 425b14462f

Neither example on the page will compile without numerous errors. I haven't altered the examples other than changing the target chip. Am I doing something wrong?

Employing 18F2550 errata work-arounds:
* Corrupted fast interrupt shadow registers
USB_Slave.c:
368: DATA_PACKET INPacket;
^ (374) missing basic type; int assumed (warning)
^ (372) "," expected
369: DATA_PACKET OUTPacket;
^ (374) missing basic type; int assumed (warning)
^ (372) "," expected
USB_Slave.c: IsTxBusy()
440: return (bd1in.stat & (1 << UOWN));
^ (192) undefined identifier "bd1in"
^ (196) struct/union required
^ (192) undefined identifier "UOWN"
USB_Slave.c: FCD_07281_USB_Slave__SendString()
944: INPacket._byte[FCL_IDX] = FCL_DATA[FCL_IDX];
^ (196) struct/union required
(981) pointer required ^
(981) pointer required ^
962: USBGenericInHandle = USBTransferOnePacket(1,1,(BYTE*)&INPacket,FCL_LENGTH);
(192) undefined identifier "BYTE" ^
(195) expression syntax ^
(187) too few function arguments ^
(194) ")" expected ^
(195) expression syntax ^
USB_Slave.c: FCD_07281_USB_Slave__GetString()
993: FCR_RETVAL[FCL_IDX] = OUTPacket._byte[FCL_IDX];
(196) struct/union required ^
(981) pointer required ^
(981) pointer required ^
USB_Slave.c: FCD_07281_USB_Slave__RunSlaveService()
1040: FCM_slave_service(OUTPacket._byte[0]);
(196) struct/union required ^
(981) pointer required ^
(981) pointer required ^
1140: USBGenericInHandle = USBTransferOnePacket(1,1,(BYTE*)&OUTPacket,1);
(192) undefined identifier "BYTE" ^
USB_Slave.c: 1140: too many errors (21)



Thanks!

Re: USB Slave examples

Posted: Wed May 17, 2017 2:24 pm
by TSMroz
Anyone? Perhaps not supported on 8 bit pics?

Re: USB Slave examples

Posted: Wed May 17, 2017 3:32 pm
by Benj
Hmm,

This used to work in v6 but seems to have a problem with v7 currently, the other two USB components Serial and HID are ok with 8-bit PIC so hopefully we can solve this one for you too.

I'll investigate and see if I can find you a resolution or work around.

Re: USB Slave examples

Posted: Thu May 18, 2017 1:28 pm
by TSMroz
Thank you, Ben.

Re: USB Slave examples

Posted: Fri May 26, 2017 1:13 pm
by TSMroz
Just checking in. I can bribe with beer if needed :D

Re: USB Slave examples

Posted: Fri May 26, 2017 1:48 pm
by LeighM
We currently have a plan to overhaul the USB support over the coming weeks.

Re: USB Slave examples

Posted: Tue Nov 21, 2017 7:40 am
by Roy Johnston
has this problem been resolved?
i still cannot compile with usb slave

Re: USB Slave examples

Posted: Tue Nov 21, 2017 9:21 am
by LeighM
Updated component attached.
Please drop this into your Flowcode7 components directory

Re: USB Slave examples

Posted: Tue Nov 21, 2017 10:02 am
by Roy Johnston
Thank you,
its working.