Page 1 of 1
USB Serial issue
Posted: Sat Oct 19, 2013 8:35 pm
by Mantas
Hi,
I get this compilation error when I try to use USB serial COMS on ARM devices. I suppose only PICs are supported?
Code: Select all
In function 'FCD_01_USB_Serial1__Initialise':
warning: implicit declaration of function 'USBDeviceInit'
error: 'USB_BUS_SENSE' undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: for each function it appears in.)
warning: implicit declaration of function 'USBGetDeviceState'
error: 'DETACHED_STATE' undeclared (first use in this function)
warning: implicit declaration of function 'USBDeviceAttach'
error: 'USBDeviceState' undeclared (first use in this function)
error: 'CONFIGURED_STATE' undeclared (first use in this function)
BR,
Mantas
Re: USB Serial issue
Posted: Mon Oct 21, 2013 11:20 am
by Benj
Hi Mantas,
Yes the USB components only support the PIC devices at the moment. Could do with a better error message there.
Would you like to see the USB components on the ARM? Would be a bit of work so probably can't work it in today but should be possible. AVR would also be possible but tricky.
Re: USB Serial issue
Posted: Mon Oct 21, 2013 11:32 am
by Mantas
Hi Benj,
Yes! I would love to see it, I am missing that very much, and it would be nice to see all chips with this. Benj, I think there are source codes for all USB functionality in ATMEL website, you could download it. I am not a USB guru like you so for me it's a bit difficult to implement it, but for you I think it will be much easier
http://www.atmel.com/Images/at91sam7s-ek.zip
Best regards,
Mantas
Re: USB Serial issue
Posted: Mon Oct 21, 2013 4:54 pm
by Benj
HI Mantas,
for you I think it will be much easier
I wouldn't count on it
I'll add it to the list and see what I can do. I've looked at supporting AVR devices with a bit banged USB stack before but the timings get so tight that you have to be a guru just to design your program to run alongside the USB mechanisms. At least with PICs all the USB comms is done with hardware so simplifies things vastly.
Re: USB Serial issue
Posted: Mon Oct 21, 2013 5:29 pm
by Mantas
I always count on you

Well ARM's also support hardware USB and has a designated FIFO registers for that, so I think it's more or less the same as with PIC's. Let me know how it goes for you
Cheers,
Mantas
Re: USB Serial issue
Posted: Wed Apr 16, 2014 7:07 pm
by EtsDriver
Ive been waiting for months for this kind of support for AVR devices...

Now ill raise this topic up again. You Ben should take look at the Arduino Leonardo, which uses AtMega32u4 processor, has usb capability. I have so many projects that now use usb<-->RS232 conventers, but these 232 conventers work somewhat... not so well in industrial enviroment ill say.
All those blown converters and burn expensive pcb's came back to haunt me ._.
Re: USB Serial issue
Posted: Thu Apr 17, 2014 2:51 pm
by Benj
Hello,
You Ben should take look at the Arduino Leonardo, which uses AtMega32u4 processor, has usb capability.
Ok thanks for letting me know, I will get one ordered today and see if I can make some headway on this.
Re: USB Serial issue
Posted: Thu Jan 15, 2015 5:23 pm
by Benj
Hello,
I have been looking into the USB demo code for the ATMEGA32U4 device and though the code looks simple enough it is all based on loops with strict timings.
The PIC USB stuff is all interrupt driven so you can basically just initialise it and then let it get on with what it needs to do.
The AVR USB stuff on the other hand seems to be based on polling and this means it's very hard to craft into a simple component that will play nice with the current USB Serial, HID and Slave components in Flowcode. That's not to say the chips don't support the nice interrupt modes, only that the example code doesn't seem to use them.
To add further problems there are multiple different versions of the USB hardware in the AVR range and the demo code only generally addresses one or two of the versions.
Serie 2 |AT90USB162,AT90USB82, ATmega32U2, ATmega16U2, ATmega8U2
Serie 4 |ATmega32U4, ATmega16U4
Serie 6 |AT90USB1286, AT90USB646, ATmega32U6
Serie 7 |AT90USB1287, AT90USB647
So I'm not admitting defeat but it looks like implementing these is a much bigger job than originally anticipated. I'll continue on with this today and see where I can get to but I'm not holding my breath.
...
Another option is to use LUFA but this seems to rely on the fact that you can change the makefile script to include all the LUFA pre-built libraries. Again not nice. I will keep looking.