felis / UHS30

For information about the project see README below
GNU General Public License v2.0
133 stars 39 forks source link

UHS_FS_NEW_DEMO on USB Host Shield and Teensy 3.5 #23

Closed mjs513 closed 7 years ago

mjs513 commented 7 years ago

This is a continuation of the issue raised on ush2 with accessing a mass storage device using a usb host shield and a teensy 3.5. By the way its a microcent 8gb thumb drive. I incorporated the suggestions in the last post:

#define UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE 0

// Uncomment to debug
#define ENABLE_UHS_DEBUGGING 1
// Uncomment to make debugging very noisy
#define DEBUG_PRINTF_EXTRA_HUGE 1

and still hangs. I am attaching a text file with the debug messages for your reference.

Teensy35 Debug Dump.txt

Mike

UPDATE: Fiddling around with the FS_lock parameter, changed it to around 1000 and it seemed to running even further. On the off chance that there is some sort of propotional time affect on the sketch with the number of files on the drive I decided to delete all files on the drive and put just 5 files on it for a test.

With a FS_lock of one I get a repeating error:

ResetRecovery

Gen SCSI Err: 27 LUN: 00

Read LUN:

CBW.dCBWTag: 00000032 USB Error: 06 Index: 01 CBW: OK Data Stage: OK CSW:Sig error Invalid CSW

where the TAG keeps incrementing. Changing it to 255 it proceeds further with periodic error messages like above - gets to CBW.dCBWTag: 00000ADE hangs for awhile then it gives me a few more USB errors and SCSI errors and continues very slowly. Increasing it makes it worse like for FS_lock 1.

Hope this info helps

xxxajk commented 7 years ago

try `

define DEBUG_PRINTF_EXTRA_HUGE_UHS_HOST 1

` and show me the output from that (warning there will be quite a lot of data)

mjs513 commented 7 years ago

Ok will run it now. What FS LOCK do you want me to use?

xxxajk commented 7 years ago

For 1 file use 1 lock, for 2, use 2, etc. The lock just determines how many files can be opened at the same time.

mjs513 commented 7 years ago

Yep got that, but the sketches performance with thumb drive (how many errors I get) seems to be dependent on that value. Running it now for 1024 - will let it run to the end

UPDATE: Sketch hung at tag 381 here is the debug file: Teensy35 Debug Dump2.txt

xxxajk commented 7 years ago

Yes, that value also tweaks how many buffers are used. Be sure to use fs_sync(); before ejecting media in your own sketches.

mjs513 commented 7 years ago

Got it thanks. Now just to get through this issue.