LPC55S69 : USB0 and USB1 sharing USBRAM ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC55S69 : USB0 and USB1 sharing USBRAM ?

1,121 Views
trescurieux
Contributor III

Hi

I've seen some issues when using USB0 as host and USB1 as device at the same time

USB0 (host) is using OHCI driver

USB1 (device) is using kUSB_ControllerIp3516Hs0, it seems to work when used alone (?)

The main issue seems to be that both tries to use the shared ram at the same address

so the setup of USB1 breaks usb0

i.e.

For usb0 : FSL_FEATURE_USBFSH_USB_RAM_BASE_ADDRESS (0x40100000)

For usb1: FSL_FEATURE_USBHSD_USB_RAM_BASE_ADDRESS  0x40100000)

 

It is probably a misconfiguration/mistunderstanding from my part,.

Any pointers would be appreciated

Thank you in advance

Tres

Labels (2)
0 Kudos
2 Replies

1,076 Views
trescurieux
Contributor III

Thank you for the info, i'll definitively check what you did

At the moment i've split the ram in 2,  one part for usb0 , one part for usb1

i dont know if this is correct, seems to sort of work

Patch attached

0 Kudos

1,095 Views
belmontbob59
Contributor IV
I have noticed the exact same problem which leads to memory corruption of the OHCI USB stack. I found a race condition in the device driver when the hardware received a SETUP token while USB_DeviceLpc3511IpSetDefaultState() is in progress. The HW store the setup packet (8 bytes) at 0x40100000. You can find more details here:

https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-SDK-2-4-1-keyboard2mouse-example-always-g...

My solution is to modify the device driver to remove the race condition. it is posted in my first post in a zip file.
This is for LPC54xxx family, but your MCU USB software interface (UM11126's figure 161) is identical to mine, so the solution should work.

 

0 Kudos