Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USB libraries broken for P8 and P32?
21-08-2012, 01:29 PM,
#1
USB libraries broken for P8 and P32?
Hi.

It seems to be impossible to compile any of the USB example code (except for CDC) for P8 and P32.

For P8, the compiler throws some errors like this one:
Code:
p8/include/pinguino/libraries/usb.c:46: error 65: function 'epapin_init' already has body

For P32, there are not even USB libs, which results in:
Code:
source/user.c:29:3: error: 'USB' undeclared (first use in this function)

See also: http://forum.pinguino.cc/showthread.php?tid=3582

Did I miss any option for using raw USB or HID on P32?
If not, are there any plans regarding USB support?
Reply
31-10-2012, 11:34 AM,
#2
RE: USB libraries broken for P8 and P32?
(21-08-2012, 01:29 PM)raphman Wrote: Hi.

It seems to be impossible to compile any of the USB example code (except for CDC) for P8 and P32.

For P8, the compiler throws some errors like this one:
Code:
p8/include/pinguino/libraries/usb.c:46: error 65: function 'epapin_init' already has body

For P32, there are not even USB libs, which results in:
Code:
source/user.c:29:3: error: 'USB' undeclared (first use in this function)

See also: http://forum.pinguino.cc/showthread.php?tid=3582

Did I miss any option for using raw USB or HID on P32?
If not, are there any plans regarding USB support?

hi,

I have the same problem !

have you found a solution to this problem?

tnx
Reply
31-10-2012, 05:18 PM,
#3
RE: USB libraries broken for P8 and P32?
Sorry, I have not yet investigated further and settled on using USB-serial for the time.
Reply
31-10-2012, 07:06 PM,
#4
RE: USB libraries broken for P8 and P32?
(31-10-2012, 05:18 PM)raphman Wrote: Sorry, I have not yet investigated further and settled on using USB-serial for the time.

thanks for the reply !

Is very important for me to solve because I do communicate Pinguino with a usb printer.

Do you know another method to communicate with USB; to receive and send DATA.

What do you think of CDC ? but it is poorly documented, especially to receive data.

thank you very much
Reply
30-12-2012, 01:05 AM, (This post was last modified: 30-12-2012, 01:15 AM by dmgongora.)
#5
Wink  RE: USB libraries broken for P8 and P32?
(31-10-2012, 07:06 PM)blast1 Wrote:
(31-10-2012, 05:18 PM)raphman Wrote: Sorry, I have not yet investigated further and settled on using USB-serial for the time.

thanks for the reply !

Is very important for me to solve because I do communicate Pinguino with a usb printer.

Do you know another method to communicate with USB; to receive and send DATA.

What do you think of CDC ? but it is poorly documented, especially to receive data.

thank you very much

Hi everyone,
while trying to compile the USB example found here http://wiki.pinguino.cc/index.php/Interf...ith_Python, I got similar error messages. Concretely, I got this:

.../x.3/p8/include/pinguino/libraries/usb.c:46: error 65: function 'epapin_init' already has body
.../x.3/p8/include/pinguino/libraries/usb.c:98: error 65: function 'epap_in' already has body
.../x.3/p8/include/pinguino/libraries/usb.c:147: error 65: function 'epap_out' already has body
.../x.3/p8/include/pinguino/libraries/usb.c:157: error 65: function 'epapout_init' already has body

After trying to solve this, I finally arrived somewhere Smile
Somehow***(see the end of this message for the reasons why I did what I did), I decided to modify the file located at .../x.3/source/main.c. Concretely, I commented the lines below:
Code:
// only for compatibility with application_iface.o
#ifdef boot2                                                                                                                        
        #ifndef __USB__
                void epap_in() { return; }
                void epap_out() { return; }
                void epapin_init() { return; }
                void epapout_init() { return; }
        #endif                                                                                                                        
        #endif
After that, I get:
compilation done
code size: 2104 / 24575 bytes (8% used)
0.146471977234 seconds process time

I really don't know what application_iface.o stands for or if I'm causing major problems, the only thing I know is that my USB project is working now.

Hope this helps.

Daniel.

*** the usb.c file implements all the four functions causing the compiler to complain. The main.c file also implements these functions, and that's precisely the error nature. I'm sure there is another (more elegant) way to solve this problem.
Reply
30-12-2012, 01:20 AM,
#6
RE: USB libraries broken for P8 and P32?
(30-12-2012, 01:05 AM)dmgongora Wrote: Concretely, I commented the lines below:
Code:
// only for compatibility with application_iface.o
#ifdef boot2                                                                                                                        
        #ifndef __USB__
                void epap_in() { return; }
                void epap_out() { return; }
                void epapin_init() { return; }
                void epapout_init() { return; }
        #endif                                                                                                                        
        #endif

After that, I get:
compilation done

Thanks. Have to try it out some time.
I guess that __USB__ should actually be #define'd when using USB functions (which would avoid inclusion of these empty functions) but is not for some reason.
Reply
30-12-2012, 02:36 AM, (This post was last modified: 31-12-2012, 06:20 AM by dmgongora.)
#7
RE: USB libraries broken for P8 and P32?
You're right! After making some progress to my USB project I decided to take a -closer- look at the code of the main.c file. Just before the lines I commented, there is this:
Code:
/*                                                                                                                                    
#ifdef __USB__                                                                                                                        
        #include <usb.h>                                                                                                              
        #include <usb.c>                                                                                                              
#endif                                                                                                                                
*/

Perhaps, this should be
Code:
#ifndef __USB__                                                                                                                        
        #include <usb.h>                                                                                                              
        #include <usb.c>                                                                                                              
#endif
In fact, by doing this -and "undoing" the previous changes- it works!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)