diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index 22c105c33f6..8802ef6387e 100755 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -4307,7 +4307,7 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller) * SLOM Not used in host mode. * SDIS = 1, Stream disable mode. Eliminates overruns/underruns at * the expense of some performance. - * VBPS = 1, off chip power source + * VBPS = 1, off-chip power source */ putreg32(USBHOST_USBMODE_CMHOST | USBHOST_USBMODE_SDIS | USBHOST_USBMODE_VBPS, @@ -4323,6 +4323,14 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller) return NULL; } + /* Re-program the USB host controller. As implemented, lpc31_reset() + * requires the host mode setup in order to work. However, we lose the + * host configuration in the reset. + */ + + putreg32(USBHOST_USBMODE_CMHOST | USBHOST_USBMODE_SDIS | USBHOST_USBMODE_VBPS, + LPC31_USBDEV_USBMODE); + /* "In order to initialize the host controller, software should perform the * following steps: * diff --git a/configs/olimex-lpc-h3131/README.txt b/configs/olimex-lpc-h3131/README.txt index 386fd26f712..4f90d13c0c7 100644 --- a/configs/olimex-lpc-h3131/README.txt +++ b/configs/olimex-lpc-h3131/README.txt @@ -686,3 +686,10 @@ Configurations Application Configuration -> System Add-Ons CONFIG_SYSTEM_USBMONITOR=y CONFIG_SYSTEM_USBMONITOR_INTERVAL=1 + + NOTE: I have found that if you enable USB DEBUG and/or USB tracing, + the resulting image requires to much memory to execute out of + internal SRAM. I was able to get the configurations to run out of + SRAM with debug/tracing enabled by carefully going through the + configuration and reducing stack sizes, disabling unused OS features, + disabling un-necessary NSH commands, etc.