diff --git a/ChangeLog b/ChangeLog index 7e210c8d7a3..31ba29aa510 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1834,7 +1834,7 @@ * drivers/mtd/ramtron.c, net/net_checksd.c, fs/fs_fdopen.c, and include/nuttx/mii.h: Several structural changes made to get a clean compile under the ez80 ZDS-II toolchain (no design changes). - * drivers/usbhost/usbhost_storage.c: Incorpated bugfixes reported by Sheref H. + * drivers/usbhost/usbhost_storage.c: Incorpated bugfixes reported by Sheref H. Younan: (1) Read capacity logic read largest block, not the number of blocks and was, therefore, off by one, and (2) Some devices stall of get Max LUN request if they support only a single LUN. Logic now assumes a single LUN if the get @@ -1843,9 +1843,12 @@ a new configuration option to support extracting strings from FLASH or EEPROM or other memories where the string data cannot be accessed by simply de-referencing a string pointer. - * arch/sim/src/up_romgetc.c: Used to test the basic logic to access strings + * arch/sim/src/up_romgetc.c: Used to test the basic logic to access strings without directly de-referencing a string pointer. - * arch/avr/src/avr/up_romget.c: Used to access strings that lie in the first - 64Kb of FLASH. - - + * arch/avr/src/avr/up_romget.c: Used to access strings that lie in the first + 64Kb of FLASH (But I still haven't figured out how to get strings to reside in + FLASH without using the PROGMEM attribute). + * configs/teensy/src/up_spi.c: Correct reading of SD CD and WP pins (was reading + the wrong register. AVR SPI now appears to be functional. + * arch/avr/src/at90usb/at90usb_usbdev.c: Correct USB initialization. Interrupts + were being enabled BEFORE the interrupt handler was attached. diff --git a/arch/avr/src/at90usb/at90usb_usbdev.c b/arch/avr/src/at90usb/at90usb_usbdev.c index deac78beb62..30223529486 100644 --- a/arch/avr/src/at90usb/at90usb_usbdev.c +++ b/arch/avr/src/at90usb/at90usb_usbdev.c @@ -2745,14 +2745,6 @@ void up_usbinitialize(void) { usbtrace(TRACE_DEVINIT, 0); - /* Shutdown the USB interface to put it in a known initial state */ - - avr_usbshutdown(); - - /* Select USB device mode */ - - UHWCON |= (1 << UIMOD); - /* Initialize the device state structure */ memset(&g_usbdev, 0, sizeof(struct avr_usbdev_s)); @@ -2760,10 +2752,6 @@ void up_usbinitialize(void) g_usbdev.usbdev.ep0 = &g_usbdev.eplist[AVR_EP0].ep; g_usbdev.epavail = AVR_ALL_EPS & ~(1 << AVR_EP0); - /* Reset the interface to force re-enumeration */ - - avr_usbreset(); - /* Attach USB controller general interrupt handler */ if (irq_attach(AT90USB_IRQ_USBGEN, avr_geninterrupt) != 0) @@ -2780,6 +2768,20 @@ void up_usbinitialize(void) goto errout; } + /* Shutdown the USB interface to put it in a known initial state */ + + avr_usbshutdown(); + + /* Select USB device mode */ + + UHWCON |= (1 << UIMOD); + + /* Reset the interface to force re-enumeration (the reset operation + * enables interrupts. + */ + + avr_usbreset(); + /* Set the VBUS pad */ USBCON |= (1 << OTGPADE); diff --git a/configs/teensy/README.txt b/configs/teensy/README.txt index 9a5fa3eed97..5b32e21b352 100644 --- a/configs/teensy/README.txt +++ b/configs/teensy/README.txt @@ -183,7 +183,7 @@ Teensy SPI Connection -- ---- -- ------------------------- ------- J2 NAME PIN NAME PAD -- ---- -- ------------------------- ------- - 1 VIN -- Connected to USB +RV + 1 VIN -- Connected to USB +5V 2 GND -- Connected to USB GND 3 3V3 -- Not used --- 4 NC -- Not used diff --git a/configs/teensy/src/up_spi.c b/configs/teensy/src/up_spi.c index 8baacc05fc5..2ef0908f2a7 100755 --- a/configs/teensy/src/up_spi.c +++ b/configs/teensy/src/up_spi.c @@ -179,7 +179,7 @@ void avr_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select uint8_t avr_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { uint8_t ret = 0; - uint8_t regval = PORTB; + uint8_t regval = PINB; /* Both the CD and WP pins are pull high by the AT90USB and will be * grounded it a card is inserted or write protected. diff --git a/configs/teensy/usbstorage/defconfig b/configs/teensy/usbstorage/defconfig index 7034c662204..591eaf19138 100755 --- a/configs/teensy/usbstorage/defconfig +++ b/configs/teensy/usbstorage/defconfig @@ -268,9 +268,9 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_RR_INTERVAL=200 CONFIG_SCHED_INSTRUMENTATION=n CONFIG_TASK_NAME_SIZE=0 -CONFIG_START_YEAR=2010 -CONFIG_START_MONTH=6 -CONFIG_START_DAY=17 +CONFIG_START_YEAR=2011 +CONFIG_START_MONTH=7 +CONFIG_START_DAY=2 CONFIG_GREGORIAN_TIME=n CONFIG_JULIAN_TIME=n CONFIG_DEV_CONSOLE=y