Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Keil USBmem example doesn't work when GCC compiler is used

Keil USBmem example doesn't work when GCC compiler is used

2006-01-02 by pberna2003

Dear all

I'm trying to recompile the USBmem example created by Keil for the 
LPC2148 using the GCC GNU compiler version 3.3.1

I introduced the __attribute__ ((__packed__)) in all structs and I 
replaced the Keil __packed attribute related to 2 WORD pointers with 
the related instructions, but again the code doesn't work. 

Does anybody realize the porting of the USBmem example using the GCC 
compiler ?

Thank you 
Paolo

RE: [lpc2000] Keil USBmem example doesn't work when GCC compiler is used

2006-01-02 by Joel Winarske

> I'm trying to recompile the USBmem example created by Keil for the
> LPC2148 using the GCC GNU compiler version 3.3.1
> 
> I introduced the __attribute__ ((__packed__)) in all structs and I
> replaced the Keil __packed attribute related to 2 WORD pointers with
> the related instructions, but again the code doesn't work.
> 
> Does anybody realize the porting of the USBmem example using the GCC
> compiler ?


Be sure USB_EndPoint0() is being called correctly or nothing will work.

Joel

RE: Keil USBmem example doesn't work when GCC compiler is used

2006-01-03 by Steve Franks

> Be sure USB_EndPoint0() is being called correctly or nothing
> will work.

I'm doing the same thing with the VCOM example, and I think the biggest
stumbler is that the interrupts are wildly different between Keil and GCC.
Personally, I've got interrupts hooked back up correctly, but still no go.
Not that I've spent too many hours what with the holidays...

Keep me posted if anyone out there has pointers; this is an interesting
thread (for me at least).

Steve

Steve Franks
Staff Engineer
Franks Development, LLC
http://www.franks-development.com
(520) 312-0089


[Non-text portions of this message have been removed]

RE: [lpc2000] RE: Keil USBmem example doesn't work when GCC compiler is used

2006-01-03 by Joel Winarske

> I'm doing the same thing with the VCOM example, and I think the biggest
> stumbler is that the interrupts are wildly different between Keil and GCC.
> Personally, I've got interrupts hooked back up correctly, but still no go.
> Not that I've spent too many hours what with the holidays...
> 
> Keep me posted if anyone out there has pointers; this is an interesting
> thread (for me at least).

Try setting breakpoint in error handling code of USB interrupt.  If all is
setup correctly you shouldn't see errors, and USB_EndPoint0() should be
called.  If not confirm PLL1 and peripheral setup.


Joel

RE: [lpc2000] RE: Keil USBmem example doesn't work when GCC compiler is used

2006-01-04 by Joel Winarske

> > Be sure USB_EndPoint0() is being called correctly or nothing
> > will work.
> 
> I'm doing the same thing with the VCOM example, and I think the biggest
> stumbler is that the interrupts are wildly different between Keil and GCC.
> Personally, I've got interrupts hooked back up correctly, but still no go.
> Not that I've spent too many hours what with the holidays...
> 
> Keep me posted if anyone out there has pointers; this is an interesting
> thread (for me at least).


Also depending on what you have USB_MAX_PACKET defined as this call may
truncate the outgoing data, resulting in incorrect dialog:

void USB_DataInStage (void)


Joel

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.