diff options
Diffstat (limited to 'nuttx/configs/olimex-lpc1766stk')
-rwxr-xr-x | nuttx/configs/olimex-lpc1766stk/src/up_usbstrg.c | 19 | ||||
-rwxr-xr-x | nuttx/configs/olimex-lpc1766stk/usbserial/defconfig | 2 | ||||
-rwxr-xr-x | nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig | 4 |
3 files changed, 19 insertions, 6 deletions
diff --git a/nuttx/configs/olimex-lpc1766stk/src/up_usbstrg.c b/nuttx/configs/olimex-lpc1766stk/src/up_usbstrg.c index c4cacddd3..4d4b1e88e 100755 --- a/nuttx/configs/olimex-lpc1766stk/src/up_usbstrg.c +++ b/nuttx/configs/olimex-lpc1766stk/src/up_usbstrg.c @@ -48,6 +48,9 @@ #include <nuttx/spi.h> #include <nuttx/mmcsd.h> +#include "lpc17_internal.h" +#include "lpc1766stk_internal.h" + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -108,6 +111,10 @@ int usbstrg_archinitialize(void) FAR struct spi_dev_s *spi; int ret; + /* Enable power to the SD/MMC via a GPIO. LOW enables SD/MMC. */ + + lpc17_gpiowrite(LPC1766STK_MMC_PWR, false); + /* Get the SPI port */ message("usbstrg_archinitialize: Initializing SPI port %d\n", @@ -118,7 +125,8 @@ int usbstrg_archinitialize(void) { message("usbstrg_archinitialize: Failed to initialize SPI port %d\n", LPC17XX_MMCSDSPIPORTNO); - return -ENODEV; + ret = -ENODEV; + goto errout; } message("usbstrg_archinitialize: Successfully initialized SPI port %d\n", @@ -134,10 +142,15 @@ int usbstrg_archinitialize(void) { message("usbstrg_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret); - return ret; + goto errout; } message("usbstrg_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); return OK; -} + + /* Disable power to the SD/MMC via a GPIO. HIGH disables SD/MMC. */ + +errout: + lpc17_gpiowrite(LPC1766STK_MMC_PWR, true); + return ret;} diff --git a/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig b/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig index 175da804e..7262247c2 100755 --- a/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig +++ b/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig @@ -106,7 +106,7 @@ CONFIG_LPC17_BUILDROOT=y CONFIG_LPC17_ETHERNET=n CONFIG_LPC17_USBHOST=n CONFIG_LPC17_USBOTG=n -CONFIG_LPC17_USBDEV=n +CONFIG_LPC17_USBDEV=y CONFIG_LPC17_UART0=y CONFIG_LPC17_UART1=n CONFIG_LPC17_UART2=n diff --git a/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig b/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig index d070a247a..0b0e93dda 100755 --- a/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig +++ b/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig @@ -106,7 +106,7 @@ CONFIG_LPC17_BUILDROOT=y CONFIG_LPC17_ETHERNET=n CONFIG_LPC17_USBHOST=n CONFIG_LPC17_USBOTG=n -CONFIG_LPC17_USBDEV=n +CONFIG_LPC17_USBDEV=y CONFIG_LPC17_UART0=y CONFIG_LPC17_UART1=n CONFIG_LPC17_UART2=n @@ -324,7 +324,7 @@ CONFIG_APP_DIR=examples/usbstorage CONFIG_DEBUG=n CONFIG_DEBUG_VERBOSE=n CONFIG_DEBUG_SYMBOLS=n -CONFIG_DDEBUG_USB=n +CONFIG_DEBUG_USB=n CONFIG_MM_REGIONS=2 CONFIG_ARCH_LOWPUTC=y CONFIG_RR_INTERVAL=200 |