Forum Rule: Always post complete source code & details to reproduce any issue!
Page 25 of 25 FirstFirst ... 15 23 24 25
Results 601 to 614 of 614

Thread: USBHost_t36 USB Mass Storage Driver Experiments

  1. #601
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    601
    Quote Originally Posted by wwatson View Post
    And again it continues but does not seem to get past the inquiry phase.
    The inquiry phase is seeing the thumb drive.
    Is this a powered hub by any chance?

  2. #602
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    601
    @wwaton It was a bug that crept in. Fixed and working.

  3. #603
    Senior Member wwatson's Avatar
    Join Date
    Aug 2017
    Posts
    776
    Quote Originally Posted by xxxajk View Post
    Is this a powered hub by any chance?
    No, it is a Belkin four port HUB that I have been using for quite some time now and works with MSC. Have never had an issue with it. It has a power LED that lets me know when VUSB has been turned on.

  4. #604
    Senior Member wwatson's Avatar
    Join Date
    Aug 2017
    Posts
    776
    Quote Originally Posted by xxxajk View Post
    @wwaton It was a bug that crept in. Fixed and working.
    Did a pull on the library and results were this:

    With HUB:
    Code:
    Start.
    
    SWI_IRQ_NUM 30
    
    
    USB HOST READY.
    No media. Waiting to mount /
    
    
    
    Configuring: parent = 0, port = 1, speed = 2
    $$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
    $$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
    USBHub: checking numep 1, klass 09, interface.klass 09, protocol 00/01-00?01
    USBHub: checking numep 1, klass 09, interface.klass 09, protocol 00/01-01?01
    USBHub Accepting address assignment 01
    dispatchPkt status code 08
    dispatchPkt OTHER
    USBHub configure 01 04 02
    
    
    
    Configuring: parent = 1, port = 4, speed = 2
    $$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 2: 0 retries.
    $$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 2: 0 retries.
    BulkOnly: checking numep 2, klass 00, subklass 00
    BulkOnly: checking protocol 00, interface.klass 08, interface.subklass 06
    BulkOnly: checking interface.protocol 50
    BulkOnly: checking numep 2, klass 00, subklass 00
    BulkOnly: checking protocol 00, interface.klass 08, interface.subklass 06
    BulkOnly: checking interface.protocol 50
    
    BS SetInterface
    ep: 0x00 bmAttributes: 0x02 index: 1
    
    ep: 0x01 bmAttributes: 0x02 index: 2
    
    BS Start, speed: 2
    BS Start
    GetMaxLUN 0x00
    MaxLUN 0
    Inquiry 0x24 0x00
    LUN 0 `KingstonDataTraveler 3.0'
    Qualifier 0 Device type 00 RMB 1 SSCS 0 SCSI version 06
    Device conforms to T10/1731-D (SPC-4) standards.
    CheckLUN...
    9
    >>>>>>>>>>>>>>>>CAPACITY OK ON LUN 0
    039a33f300000200
    
    9
    Checked LUN...
    Onstart begin
    BS configured
    
    Configuring returned 00
    Without HUB:

    Code:
    Start.
    
    SWI_IRQ_NUM 30
    
    
    USB HOST READY.
    No media. Waiting to mount /
    
    
    
    Configuring: parent = 0, port = 1, speed = 2
    $$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
    $$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
    USBHub: checking numep 2, klass 00, interface.klass 08, protocol 50/00-00?01
    BulkOnly: checking numep 2, klass 00, subklass 00
    BulkOnly: checking protocol 00, interface.klass 08, interface.subklass 06
    BulkOnly: checking interface.protocol 50
    USBHub: checking numep 2, klass 00, interface.klass 08, protocol 50/00-01?01
    BulkOnly: checking numep 2, klass 00, subklass 00
    BulkOnly: checking protocol 00, interface.klass 08, interface.subklass 06
    BulkOnly: checking interface.protocol 50
    BS SetInterface
    ep: 0x00 bmAttributes: 0x02 index: 1
    
    ep: 0x01 bmAttributes: 0x02 index: 2
    
    BS Start, speed: 2
    BS Start
    GetMaxLUN 0x00
    MaxLUN 0
    Inquiry 0x24 0x00
    LUN 0 `KingstonDataTraveler 3.0'
    Qualifier 0 Device type 00 RMB 1 SSCS 0 SCSI version 06
    Device conforms to T10/1731-D (SPC-4) standards.
    CheckLUN...
    7
    >>>>>>>>>>>>>>>>CAPACITY OK ON LUN 0
    039a33f300000200
    
    7
    Checked LUN...
    Onstart begin
    BS configured
    I also tried compiling "UHS_FS_NEW_DEMO.ino" in "UHS_KINETIS_FS_HOST" and got this error:

    Code:
    Generating function prototypes...
    /home/wwatson/arduino-1.8.15/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK66FX1M0__ -DTEENSYDUINO=154 -DARDUINO=10815 -DARDUINO_TEENSY36 -DF_CPU=180000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.15/hardware/teensy/avr/cores/teensy3 -I/home/wwatson/Arduino/libraries/RTClib -I/home/wwatson/Arduino/libraries/UHS_host -I/home/wwatson/Arduino/libraries/ISR_safe_memory -I/home/wwatson/arduino-1.8.15/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.15/hardware/teensy/avr/libraries/SPI -I/home/wwatson/Arduino/libraries/UHS_ByteBuffer -I/home/wwatson/Arduino/libraries/UHS_FS /tmp/arduino_build_159496/sketch/UHS_FS_NEW_DEMO.ino.cpp -o /tmp/arduino_build_159496/preproc/ctags_target_for_gcc_minus_e.cpp
    /home/wwatson/arduino-1.8.15/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_159496/preproc/ctags_target_for_gcc_minus_e.cpp
    Compiling sketch...
    /home/wwatson/arduino-1.8.15/hardware/teensy/../tools/precompile_helper /home/wwatson/arduino-1.8.15/hardware/teensy/avr/cores/teensy3 /tmp/arduino_build_159496 /home/wwatson/arduino-1.8.15/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK66FX1M0__ -DTEENSYDUINO=154 -DARDUINO=10815 -DARDUINO_TEENSY36 -DF_CPU=180000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/home/wwatson/arduino-1.8.15/hardware/teensy/avr/cores/teensy3 /tmp/arduino_build_159496/pch/Arduino.h -o /tmp/arduino_build_159496/pch/Arduino.h.gch
    /home/wwatson/arduino-1.8.15/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++ -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -mno-unaligned-access -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK66FX1M0__ -DTEENSYDUINO=154 -DARDUINO=10815 -DARDUINO_TEENSY36 -DF_CPU=180000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/tmp/arduino_build_159496/pch -I/home/wwatson/arduino-1.8.15/hardware/teensy/avr/cores/teensy3 -I/home/wwatson/Arduino/libraries/RTClib -I/home/wwatson/Arduino/libraries/UHS_host -I/home/wwatson/Arduino/libraries/ISR_safe_memory -I/home/wwatson/arduino-1.8.15/hardware/teensy/avr/libraries/Wire -I/home/wwatson/arduino-1.8.15/hardware/teensy/avr/libraries/SPI -I/home/wwatson/Arduino/libraries/UHS_ByteBuffer -I/home/wwatson/Arduino/libraries/UHS_FS /tmp/arduino_build_159496/sketch/UHS_FS_NEW_DEMO.ino.cpp -o /tmp/arduino_build_159496/sketch/UHS_FS_NEW_DEMO.ino.cpp.o
    In file included from /home/wwatson/Arduino/libraries/UHS_host/UHS_host.h:64:0,
                     from /home/wwatson/Arduino/libraries/UHS_FS/examples/UHS_KINETIS_FS_HOST/UHS_FS_NEW_DEMO/UHS_FS_NEW_DEMO.ino:107:
    /home/wwatson/Arduino/libraries/UHS_host/UHS_KINETIS_FS_HOST/UHS_KINETIS_FS_HOST.h:215:22: error: variable or field 'uint8_t' declared void
             virtual void uint8_t vbusPower(uint8_t port, VBUS_t state) {
                          ^
    /home/wwatson/Arduino/libraries/UHS_host/UHS_KINETIS_FS_HOST/UHS_KINETIS_FS_HOST.h:215:22: error: expected ';' at end of member declaration
    /home/wwatson/Arduino/libraries/UHS_host/UHS_KINETIS_FS_HOST/UHS_KINETIS_FS_HOST.h:215:66: warning: ISO C++ forbids declaration of 'vbusPower' with no type [-fpermissive]
             virtual void uint8_t vbusPower(uint8_t port, VBUS_t state) {
                                                                      ^
    /home/wwatson/Arduino/libraries/UHS_host/UHS_KINETIS_FS_HOST/UHS_KINETIS_FS_HOST.h:215:30: error: conflicting return type specified for 'virtual int UHS_KINETIS_FS_HOST::vbusPower(uint8_t, VBUS_t)'
             virtual void uint8_t vbusPower(uint8_t port, VBUS_t state) {
                                  ^
    In file included from /home/wwatson/Arduino/libraries/UHS_host/UHS_host.h:49:0,
                     from /home/wwatson/Arduino/libraries/UHS_FS/examples/UHS_KINETIS_FS_HOST/UHS_FS_NEW_DEMO/UHS_FS_NEW_DEMO.ino:107:
    /home/wwatson/Arduino/libraries/UHS_host/UHS_usbhost.h:110:32: error:   overriding 'virtual uint8_t UHS_USB_HOST_BASE::vbusPower(uint8_t, VBUS_t)'
             virtual uint8_t UHS_NI vbusPower(NOTUSED(uint8_t port), NOTUSED(VBUS_t state)) {
                                    ^
    Using library RTClib in folder: /home/wwatson/Arduino/libraries/RTClib (legacy)
    Using library UHS_host in folder: /home/wwatson/Arduino/libraries/UHS_host (legacy)
    Using library ISR_safe_memory in folder: /home/wwatson/Arduino/libraries/ISR_safe_memory (legacy)
    Using library Wire at version 1.0 in folder: /home/wwatson/arduino-1.8.15/hardware/teensy/avr/libraries/Wire 
    Using library SPI at version 1.0 in folder: /home/wwatson/arduino-1.8.15/hardware/teensy/avr/libraries/SPI 
    Using library UHS_ByteBuffer in folder: /home/wwatson/Arduino/libraries/UHS_ByteBuffer (legacy)
    Using library UHS_FS in folder: /home/wwatson/Arduino/libraries/UHS_FS (legacy)
    Error compiling for board Teensy 3.6.
    Maybe it's me but before the updates it would compile but when uploaded the T3.6 would hang.

  5. #605
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    601
    Kinetis is for Teensy 3.[012] :-) The other is for MAX3421E on SPI, and yes, you can use that (up to two MAX3421E) plus native USB at the same time, AND SDcard after 2 simple soldering modifications.
    Configuring returned 00 <-- means it was successful.
    mount isn't happening because your storage has a volume label. Remove the label (make it blank) and it will work with the demo.

  6. #606
    Senior Member wwatson's Avatar
    Join Date
    Aug 2017
    Posts
    776
    @xxxajk - Cool, that did it With HUB and without HUB.

    Output:
    Code:
    USB HOST READY.
    No media. Waiting to mount /
    / mounted.
    Removing '/HeLlO.tXt' file... completed with 4
    
    Starting Write test...
    File opened OK, fd = 1
    Wrote 19 bytes, File closed result = 0.
    
    Starting Read test...
    File opened OK, fd = 1, displaying contents...
    ]-[ello \/\/orld!
    
    Read completed, last read result = -1 (20), file close result = 0.
    Testing rename
    file rename result = 0.
    
    Removing '/10MB.bin' file... completed with 0
    10MB write timing test  10240 writes, (0), (0),  18983 ms (19 sec)
    completed with 0
    10MB read timing test 10240 reads, (20),  10490 ms (10 sec)
    completed with 0
    Directory of '/'
    -rw--a     10485760 2021-08-27 16:10:14 10MB.bin
    -rw--a           19 2021-08-27 16:09:54 newtest.txt
    30916788224 bytes available on disk.
    
    Flushing caches...
    Remove and insert media...
    Edit: Will try more devices this weekend

  7. #607
    Senior Member
    Join Date
    Jun 2013
    Posts
    470
    I'm trying to get an M.2 SSD drive working. It's a 512 GB drive, with a single 64G FAT32 partition.

    During initialization, it's getting stuck in the following sequence: WaitMediaReady() -> msTestReady() -> msGetSCW().

    It gets hung up waiting for the queue_Data_Transfer() to complete. It doesn't crash, but is forever waiting for the msInCompleted to be set. Any ideas of what I can further do to get this drive working?

  8. #608
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,697
    Quote Originally Posted by yeahtuna View Post
    I'm trying to get an M.2 SSD drive working. It's a 512 GB drive, with a single 64G FAT32 partition.
    ...
    How is it powered? May need powered hub if not in use? Not sure how much current they eat.

    Seems @mjs513 ordered an m.2 SSD some time back to test?

  9. #609
    Senior Member
    Join Date
    Jun 2013
    Posts
    470
    Yup... That does the trick.

  10. #610
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    601
    Quote Originally Posted by yeahtuna View Post
    Yup... That does the trick.
    Usually does. Many people don't realize that you are trying to supply power to two things plugged into one USB port, and it may have a 500mA limit of current.
    After traveling down a long usb cable, power kind of ends up as much less, and then, you add another at the end of that.
    Now you have effectively tried to power something that is two times the distance than it was designed for.
    Sometimes even high quality cables don't help.
    Normally I use powered hubs. If I have no other choice, and it has an extremely short cable on it, and I'm not going to draw more than 400mA collectively then it's usually OK.
    Remember the hub eats some of the power budget, so, if you use a long cable to an unpowered hub to another long cable to the teensy, then another long cable, to yet possibly another hub... well, you can see where I'm going with this...

  11. #611
    Senior Member
    Join Date
    Jun 2013
    Posts
    470
    For clarification, I have a powered hub connected to the host port, and the SSD connected to the hub and that works reliably.

    The externally powering the Teensy with 5v adapter, and plugging the SSD directly into the host port also worked, but there were a couple of instances where the SSD shutdown, so not as reliable. I'll need to do more tests.

  12. #612
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    601
    Quote Originally Posted by yeahtuna View Post
    For clarification, I have a powered hub connected to the host port, and the SSD connected to the hub and that works reliably.

    The externally powering the Teensy with 5v adapter, and plugging the SSD directly into the host port also worked, but there were a couple of instances where the SSD shutdown, so not as reliable. I'll need to do more tests.
    Depending on the SSD, currently the maximum consumption (during a write) is ~17watts, or about 3 amps.
    These spikes aren't sustained long, though, so you possibly could get away with a 2amp power supply and some helper capacitors on the USB power supply line.

    Check the specs of the device, always add overhead.
    More amps on the supply side is better.
    For example, if you calculate that 1.5 amps will work, use a 2 amp supply.

  13. #613
    Senior Member
    Join Date
    Jun 2013
    Posts
    470
    I'll try swapping out my TPD3S014DBVR for a TPD3S044DBVR.

  14. #614
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    601
    Quote Originally Posted by yeahtuna View Post
    I'll try swapping out my TPD3S014DBVR for a TPD3S044DBVR.
    I was going to suggest that...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •