--- In l..., "t_chinzei" wrote: >
> Olimex offers two different schematics for LPC-2378STK on its web page,
> http://www.olimex.com/dev/lpc-2378stk.html
>
> Under DOCUMENTS,
> http://www.olimex.com/dev/pdf/LPC2378-STK.pdf
> - Just USB device connection, no host
>
> Under HARDWARE,
> http://www.olimex.com/dev/images/LPC2378-STK-sch.gif
> - Host and device, you pointed this one at your first post
>
> As I said in my post, the schematic under HARDWARE seems a wrong one for USB
port connection. On the board pictures of the web page, no USB host connector
appears.
>
> Olimex may have updated the board in secret...
> Which schematic does your board matches to?
>
> Tsuneo
>
> --- In l..., "t_chinzei" wrote:
> >
> >
> >
> >
> > The Olimex board configures USB ports as one for host, another for
device.
> > It seems to follow to this figure on the manual,
> >
> >
http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/user.manual.lpc24xx.pdf
> > Fig 56. USB OTG port configuration: port U1 host, port U2 device (p400)
> >
> > But some pin connections swap in Port U1 and U2
> >
> > On the Manual
> > Host
> > USB_UP_LED1 P1.18
> > USB_D+1 P0.29
> > USB_D-1 P0.30
> > USB_PWRD1 P1.22
> > USB_OVRCR1 P1.27
> > USB_PPWR1 P1.19
> >
> > Device
> > USB_UP_LED2 P0.13
> > USB_CONNECT2 P0.14
> > USB_D+2 P0.31
> > USB_D-2 USB_D-2
> > VBUS P1.30
> >
> > On the Olimex schematic
> > Host
> > USB_UP_LED1 P1.18
> > U1D+ P0.29
> > U1D- P0.30
> > USB_PWRD2 P1.30 <---
> > #USB_OVRCR2 P1.31 <---
> > #USB_PPWR2 P0.12 <---
> >
> > Device
> > USB_UP_LED2 P1.13
> > USB1_CONNECT P1.19 <---
> > U2D+ P0.31
> > U2D- USB_D-2
> > VBUS P0.14 <---
> >
> > I recommend you to contact to Olimex, and confirm the schematic is correct
one.
> >
> > Tsuneo
> >
> > --- In l..., Todorovic Dragan wrote:
> > >
> > > Hello,
> > >
> > > i am trying to initialize USB device block on the Olimex lpc2478 board. i
was looking into NXP lpc24xx documentation as well as lpcusb and keil usb code
examples but still have no luck. board is booted through u-boot originaly
prepared by Olimex (USB host block activated).
> > >
> > > having look into the NXP docs i am trying to initialize USB port 2 to
behave as USB device. also,
http://www.olimex.com/dev/images/ARM/LPC/LPC2478-STK-sch.gif is the schematics
where i can see pins role:
> > >
> > > U2D+ : p0.31/USB_D+2
> > > U2D- : USB_D-2
> > > soft connect (USB1_CONNECT) : p1.19/.../cap1[1]
> > > up led (USB_UP_LED1) : p1.18/USB_UP_LED1/...
> > > Vbus (VBUS) : p0.14/...
> > >
> > > because the input Vbus signal isn't connected to lpc2478 VBUS pin
(p1.30) i am choosing GPIO function as to make lpc internally put HIGH on USB
device VBUS:
> > >
> > > PINSEL3 &= ~(3 << 28); // activate p1.30
> > >
> > > next, output up led and soft connect signals. i've checked C/SC
jumper: it is properly set on SC position. here is the configuration:
> > >
> > > // p1.18 usb up led 1
> > > PINSEL3 &= ~(3 << 4);
> > > IODIR1 |= (1L << 18);
> > > IOSET1 = (1L << 18);
> > >
> > > and for soft connect signal,
> > >
> > > PINSEL3 &= ~(0x03 << 6); // P1.19
> > > PINMODE3 = (PINMODE3 & ~(0x03 << 6)) | (0x02 << 6); // is this OK??
> > > IODIR1 |= (1L << 19); // output
> > > IOSET1 = (1L << 19); // 'not connected state' (look into C/SC
jumper)
> > >
> > > i plan to activate connect signal at the end of initialization code so
that because pin is set HIGH. i am not sure if PINMODE3 is to be set or not:
i've tried all combinations but non of them works. finally, D+ line:
> > >
> > > // p0.31 usb D+ 2
> > > PINSEL1 = (PINSEL1 & ~(3 << 30)) | (1 << 30);
> > >
> > > rest of the code is enabling usb block, device controler clocs, USB port
configuration (0x03: port 1 host, port 2 device), endpoint realization and slave
mode config, interrupt registers cleanup, mode initialization and device
interrupt enabling (EP_SLOW and DEV_STAT). device address has been set to 0 and
is enabled. i then install interrupt handler and activate soft connect
signal:
> > >
> > > IOCLR1 = (1L << 19);
> > >
> > > what i expect is that an enumeration OUT packet should trigger USB
interrupt but that never happens. my ISR code is never called..
> > >
> > > to test if interrupt is propagated, some time after the soft connect pin
is made LOW i initiate EP_SLOW event directly from code: interrupt is generated
and my ISR code executed...
> > >
> > > do i properly configure lpc pins regarding to Olimex schematix and lpc2478
docs? all the code examples that i found doesn't include OTG: is there
anything special i should initialize for OTG controller? does USB host block
which is previously configured by u-boot makes a problem?
> > >
> > > i am willing to provide complete initialization code i use if
necessary...
> > >
> > >
> > > regards,
> > > dragan
> > >
>
As I said in my post, the schematic under HARDWARE seems a wrong one for USB
port connection. On the board pictures of the web page, no USB host connector
appears.
Olimex may have updated the board in secret...
Which schematic does your board matches to?
Tsuneo
--- In l..., "t_chinzei" wrote: > The Olimex board configures USB ports as one for
host, another for device.
> It seems to follow to this figure on the manual,
>
>
http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/user.manual.lpc24xx.pdf
> Fig 56. USB OTG port configuration: port U1 host, port U2 device (p400)
>
> But some pin connections swap in Port U1 and U2
>
> On the Manual
> Host
> USB_UP_LED1 P1.18
> USB_D+1 P0.29
> USB_D-1 P0.30
> USB_PWRD1 P1.22
> USB_OVRCR1 P1.27
> USB_PPWR1 P1.19
>
> Device
> USB_UP_LED2 P0.13
> USB_CONNECT2 P0.14
> USB_D+2 P0.31
> USB_D-2 USB_D-2
> VBUS P1.30
>
> On the Olimex schematic
> Host
> USB_UP_LED1 P1.18
> U1D+ P0.29
> U1D- P0.30
> USB_PWRD2 P1.30 <---
> #USB_OVRCR2 P1.31 <---
> #USB_PPWR2 P0.12 <---
>
> Device
> USB_UP_LED2 P1.13
> USB1_CONNECT P1.19 <---
> U2D+ P0.31
> U2D- USB_D-2
> VBUS P0.14 <---
>
> I recommend you to contact to Olimex, and confirm the schematic is correct
one.
>
> Tsuneo
>
> --- In l..., Todorovic Dragan wrote:
> >
> > Hello,
> >
> > i am trying to initialize USB device block on the Olimex lpc2478 board. i
was looking into NXP lpc24xx documentation as well as lpcusb and keil usb code
examples but still have no luck. board is booted through u-boot originaly
prepared by Olimex (USB host block activated).
> >
> > having look into the NXP docs i am trying to initialize USB port 2 to behave
as USB device. also,
http://www.olimex.com/dev/images/ARM/LPC/LPC2478-STK-sch.gif is the schematics
where i can see pins role:
> >
> > U2D+ : p0.31/USB_D+2
> > U2D- : USB_D-2
> > soft connect (USB1_CONNECT) : p1.19/.../cap1[1]
> > up led (USB_UP_LED1) : p1.18/USB_UP_LED1/...
> > Vbus (VBUS) : p0.14/...
> >
> > because the input Vbus signal isn't connected to lpc2478 VBUS pin
(p1.30) i am choosing GPIO function as to make lpc internally put HIGH on USB
device VBUS:
> >
> > PINSEL3 &= ~(3 << 28); // activate p1.30
> >
> > next, output up led and soft connect signals. i've checked C/SC jumper:
it is properly set on SC position. here is the configuration:
> >
> > // p1.18 usb up led 1
> > PINSEL3 &= ~(3 << 4);
> > IODIR1 |= (1L << 18);
> > IOSET1 = (1L << 18);
> >
> > and for soft connect signal,
> >
> > PINSEL3 &= ~(0x03 << 6); // P1.19
> > PINMODE3 = (PINMODE3 & ~(0x03 << 6)) | (0x02 << 6); // is this OK??
> > IODIR1 |= (1L << 19); // output
> > IOSET1 = (1L << 19); // 'not connected state' (look into C/SC
jumper)
> >
> > i plan to activate connect signal at the end of initialization code so that
because pin is set HIGH. i am not sure if PINMODE3 is to be set or not:
i've tried all combinations but non of them works. finally, D+ line:
> >
> > // p0.31 usb D+ 2
> > PINSEL1 = (PINSEL1 & ~(3 << 30)) | (1 << 30);
> >
> > rest of the code is enabling usb block, device controler clocs, USB port
configuration (0x03: port 1 host, port 2 device), endpoint realization and slave
mode config, interrupt registers cleanup, mode initialization and device
interrupt enabling (EP_SLOW and DEV_STAT). device address has been set to 0 and
is enabled. i then install interrupt handler and activate soft connect
signal:
> >
> > IOCLR1 = (1L << 19);
> >
> > what i expect is that an enumeration OUT packet should trigger USB interrupt
but that never happens. my ISR code is never called..
> >
> > to test if interrupt is propagated, some time after the soft connect pin is
made LOW i initiate EP_SLOW event directly from code: interrupt is generated and
my ISR code executed...
> >
> > do i properly configure lpc pins regarding to Olimex schematix and lpc2478
docs? all the code examples that i found doesn't include OTG: is there
anything special i should initialize for OTG controller? does USB host block
which is previously configured by u-boot makes a problem?
> >
> > i am willing to provide complete initialization code i use if
necessary...
> >
> >
> > regards,
> > dragan
>
Reply by luska_bg●October 21, 20092009-10-21
Hi Tom,
--- In l..., "Dezheng" wrote: >
> P1.30 has to be configured as VBUS in order to have
> USB device working. You can't configure it as a GPIO pin
> and pull it up hoping the USB block will recognize it
> as VBUS.
>
> regards,
> Tom
i configured p1.30 as you told. i've also configured U13::#ENA input
(#USB_PPWR2) as GPIO output:
just a few notes more.. . after the initialization code finishes i can see on my
linux box message logs that it sees new device but is unable to set its address.
also, i've added code that switches soft connect output (p1.19) LOW/HIGH on
every x seconds: this also works as linux starts address sequence every time
p1.19 goes LOW. also, i was disconnecting cable from the pc too: Vbus sense
reads HIGH/LOW depending on cable 'state'.. everything seems to be
good... on read, D+2 gives me LOW..
then, during the 'switch soft connect' endless loop i tried to connect
USB flash stick into Olimex's USB port 1 (host): i get DEV_STAT interrupt
where device status is CON, SUS and SUS_CH HIGH. also, D+2 goes HIGH...
i of course suspect now on the rest of mt initialization code, ep realization,
etc. but, that code is taken from existing code examples... will contact Olimex
too as Tsuneo suggested...
any ideas?
regards,
dragan
>
> --- In l..., Todorovic Dragan wrote:
> >
> > Hello,
> >
> > i am trying to initialize USB device block on the Olimex lpc2478 board. i
was looking into NXP lpc24xx documentation as well as lpcusb and keil usb code
examples but still have no luck. board is booted through u-boot originaly
prepared by Olimex (USB host block activated).
> >
> > having look into the NXP docs i am trying to initialize USB port 2 to behave
as USB device. also,
http://www.olimex.com/dev/images/ARM/LPC/LPC2478-STK-sch.gif is the schematics
where i can see pins role:
> >
> > U2D+ : p0.31/USB_D+2
> > U2D- : USB_D-2
> > soft connect (USB1_CONNECT) : p1.19/.../cap1[1]
> > up led (USB_UP_LED1) : p1.18/USB_UP_LED1/...
> > Vbus (VBUS) : p0.14/...
> >
> > because the input Vbus signal isn't connected to lpc2478 VBUS pin
(p1.30) i am choosing GPIO function as to make lpc internally put HIGH on USB
device VBUS:
> >
> > PINSEL3 &= ~(3 << 28); // activate p1.30
> >
> > next, output up led and soft connect signals. i've checked C/SC jumper:
it is properly set on SC position. here is the configuration:
> >
> > // p1.18 usb up led 1
> > PINSEL3 &= ~(3 << 4);
> > IODIR1 |= (1L << 18);
> > IOSET1 = (1L << 18);
> >
> > and for soft connect signal,
> >
> > PINSEL3 &= ~(0x03 << 6); // P1.19
> > PINMODE3 = (PINMODE3 & ~(0x03 << 6)) | (0x02 << 6); // is this OK??
> > IODIR1 |= (1L << 19); // output
> > IOSET1 = (1L << 19); // 'not connected state' (look into C/SC
jumper)
> >
> > i plan to activate connect signal at the end of initialization code so that
because pin is set HIGH. i am not sure if PINMODE3 is to be set or not:
i've tried all combinations but non of them works. finally, D+ line:
> >
> > // p0.31 usb D+ 2
> > PINSEL1 = (PINSEL1 & ~(3 << 30)) | (1 << 30);
> >
> > rest of the code is enabling usb block, device controler clocs, USB port
configuration (0x03: port 1 host, port 2 device), endpoint realization and slave
mode config, interrupt registers cleanup, mode initialization and device
interrupt enabling (EP_SLOW and DEV_STAT). device address has been set to 0 and
is enabled. i then install interrupt handler and activate soft connect
signal:
> >
> > IOCLR1 = (1L << 19);
> >
> > what i expect is that an enumeration OUT packet should trigger USB interrupt
but that never happens. my ISR code is never called..
> >
> > to test if interrupt is propagated, some time after the soft connect pin is
made LOW i initiate EP_SLOW event directly from code: interrupt is generated and
my ISR code executed...
> >
> > do i properly configure lpc pins regarding to Olimex schematix and lpc2478
docs? all the code examples that i found doesn't include OTG: is there
anything special i should initialize for OTG controller? does USB host block
which is previously configured by u-boot makes a problem?
> >
> > i am willing to provide complete initialization code i use if
necessary...
> >
> >
> > regards,
> > dragan
>
Reply by t_chinzei●October 20, 20092009-10-20
The Olimex board configures USB ports as one for host, another for device.
It seems to follow to this figure on the manual,
I recommend you to contact to Olimex, and confirm the schematic is correct
one.
Tsuneo
--- In l..., Todorovic Dragan wrote: >
> Hello,
>
> i am trying to initialize USB device block on the Olimex lpc2478 board. i was
looking into NXP lpc24xx documentation as well as lpcusb and keil usb code
examples but still have no luck. board is booted through u-boot originaly
prepared by Olimex (USB host block activated).
>
> having look into the NXP docs i am trying to initialize USB port 2 to behave
as USB device. also,
http://www.olimex.com/dev/images/ARM/LPC/LPC2478-STK-sch.gif is the schematics
where i can see pins role:
>
> U2D+ : p0.31/USB_D+2
> U2D- : USB_D-2
> soft connect (USB1_CONNECT) : p1.19/.../cap1[1]
> up led (USB_UP_LED1) : p1.18/USB_UP_LED1/...
> Vbus (VBUS) : p0.14/...
>
> because the input Vbus signal isn't connected to lpc2478 VBUS pin (p1.30)
i am choosing GPIO function as to make lpc internally put HIGH on USB device
VBUS:
>
> PINSEL3 &= ~(3 << 28); // activate p1.30
>
> next, output up led and soft connect signals. i've checked C/SC jumper:
it is properly set on SC position. here is the configuration:
>
> // p1.18 usb up led 1
> PINSEL3 &= ~(3 << 4);
> IODIR1 |= (1L << 18);
> IOSET1 = (1L << 18);
>
> and for soft connect signal,
>
> PINSEL3 &= ~(0x03 << 6); // P1.19
> PINMODE3 = (PINMODE3 & ~(0x03 << 6)) | (0x02 << 6); // is this OK??
> IODIR1 |= (1L << 19); // output
> IOSET1 = (1L << 19); // 'not connected state' (look into C/SC
jumper)
>
> i plan to activate connect signal at the end of initialization code so that
because pin is set HIGH. i am not sure if PINMODE3 is to be set or not:
i've tried all combinations but non of them works. finally, D+ line:
>
> // p0.31 usb D+ 2
> PINSEL1 = (PINSEL1 & ~(3 << 30)) | (1 << 30);
>
> rest of the code is enabling usb block, device controler clocs, USB port
configuration (0x03: port 1 host, port 2 device), endpoint realization and slave
mode config, interrupt registers cleanup, mode initialization and device
interrupt enabling (EP_SLOW and DEV_STAT). device address has been set to 0 and
is enabled. i then install interrupt handler and activate soft connect
signal:
>
> IOCLR1 = (1L << 19);
>
> what i expect is that an enumeration OUT packet should trigger USB interrupt
but that never happens. my ISR code is never called..
>
> to test if interrupt is propagated, some time after the soft connect pin is
made LOW i initiate EP_SLOW event directly from code: interrupt is generated and
my ISR code executed...
>
> do i properly configure lpc pins regarding to Olimex schematix and lpc2478
docs? all the code examples that i found doesn't include OTG: is there
anything special i should initialize for OTG controller? does USB host block
which is previously configured by u-boot makes a problem?
>
> i am willing to provide complete initialization code i use if necessary...
> regards,
> dragan
>
Reply by Dezheng●October 20, 20092009-10-20
P1.30 has to be configured as VBUS in order to have
USB device working. You can't configure it as a GPIO pin
and pull it up hoping the USB block will recognize it
as VBUS.
regards,
Tom
--- In l..., Todorovic Dragan wrote: >
> Hello,
>
> i am trying to initialize USB device block on the Olimex lpc2478 board. i was
looking into NXP lpc24xx documentation as well as lpcusb and keil usb code
examples but still have no luck. board is booted through u-boot originaly
prepared by Olimex (USB host block activated).
>
> having look into the NXP docs i am trying to initialize USB port 2 to behave
as USB device. also,
http://www.olimex.com/dev/images/ARM/LPC/LPC2478-STK-sch.gif is the schematics
where i can see pins role:
>
> U2D+ : p0.31/USB_D+2
> U2D- : USB_D-2
> soft connect (USB1_CONNECT) : p1.19/.../cap1[1]
> up led (USB_UP_LED1) : p1.18/USB_UP_LED1/...
> Vbus (VBUS) : p0.14/...
>
> because the input Vbus signal isn't connected to lpc2478 VBUS pin (p1.30)
i am choosing GPIO function as to make lpc internally put HIGH on USB device
VBUS:
>
> PINSEL3 &= ~(3 << 28); // activate p1.30
>
> next, output up led and soft connect signals. i've checked C/SC jumper:
it is properly set on SC position. here is the configuration:
>
> // p1.18 usb up led 1
> PINSEL3 &= ~(3 << 4);
> IODIR1 |= (1L << 18);
> IOSET1 = (1L << 18);
>
> and for soft connect signal,
>
> PINSEL3 &= ~(0x03 << 6); // P1.19
> PINMODE3 = (PINMODE3 & ~(0x03 << 6)) | (0x02 << 6); // is this OK??
> IODIR1 |= (1L << 19); // output
> IOSET1 = (1L << 19); // 'not connected state' (look into C/SC
jumper)
>
> i plan to activate connect signal at the end of initialization code so that
because pin is set HIGH. i am not sure if PINMODE3 is to be set or not:
i've tried all combinations but non of them works. finally, D+ line:
>
> // p0.31 usb D+ 2
> PINSEL1 = (PINSEL1 & ~(3 << 30)) | (1 << 30);
>
> rest of the code is enabling usb block, device controler clocs, USB port
configuration (0x03: port 1 host, port 2 device), endpoint realization and slave
mode config, interrupt registers cleanup, mode initialization and device
interrupt enabling (EP_SLOW and DEV_STAT). device address has been set to 0 and
is enabled. i then install interrupt handler and activate soft connect
signal:
>
> IOCLR1 = (1L << 19);
>
> what i expect is that an enumeration OUT packet should trigger USB interrupt
but that never happens. my ISR code is never called..
>
> to test if interrupt is propagated, some time after the soft connect pin is
made LOW i initiate EP_SLOW event directly from code: interrupt is generated and
my ISR code executed...
>
> do i properly configure lpc pins regarding to Olimex schematix and lpc2478
docs? all the code examples that i found doesn't include OTG: is there
anything special i should initialize for OTG controller? does USB host block
which is previously configured by u-boot makes a problem?
>
> i am willing to provide complete initialization code i use if necessary...
> regards,
> dragan
>
Reply by Todorovic Dragan●October 20, 20092009-10-20
Hello,
i am trying to initialize USB device block on the Olimex lpc2478 board. i was
looking into NXP lpc24xx documentation as well as lpcusb and keil usb code
examples but still have no luck. board is booted through u-boot originaly
prepared by Olimex (USB host block activated).
U2D+ : p0.31/USB_D+2
U2D- : USB_D-2
soft connect (USB1_CONNECT) : p1.19/.../cap1[1]
up led (USB_UP_LED1) : p1.18/USB_UP_LED1/...
Vbus (VBUS) : p0.14/...
because the input Vbus signal isn't connected to lpc2478 VBUS pin (p1.30) i
am choosing GPIO function as to make lpc internally put HIGH on USB device
VBUS:
PINSEL3 &= ~(3 << 28); // activate p1.30
next, output up led and soft connect signals. i've checked C/SC jumper: it
is properly set on SC position. here is the configuration:
// p1.18 usb up led 1
PINSEL3 &= ~(3 << 4);
IODIR1 |= (1L << 18);
IOSET1 = (1L << 18);
i plan to activate connect signal at the end of initialization code so that
because pin is set HIGH. i am not sure if PINMODE3 is to be set or not:
i've tried all combinations but non of them works. finally, D+ line:
rest of the code is enabling usb block, device controler clocs, USB port
configuration (0x03: port 1 host, port 2 device), endpoint realization and slave
mode config, interrupt registers cleanup, mode initialization and device
interrupt enabling (EP_SLOW and DEV_STAT). device address has been set to 0 and
is enabled. i then install interrupt handler and activate soft connect
signal:
IOCLR1 = (1L << 19);
what i expect is that an enumeration OUT packet should trigger USB interrupt but
that never happens. my ISR code is never called..
to test if interrupt is propagated, some time after the soft connect pin is made
LOW i initiate EP_SLOW event directly from code: interrupt is generated and my
ISR code executed...
do i properly configure lpc pins regarding to Olimex schematix and lpc2478 docs?
all the code examples that i found doesn't include OTG: is there anything
special i should initialize for OTG controller? does USB host block which is
previously configured by u-boot makes a problem?
i am willing to provide complete initialization code i use if necessary...
regards,
dragan