USB Testing

1131415161719»

Comments

  • I finally got around to trying out the MouseKbdLite file...

    Not really working, but I do get these messages only when I connect a USB device:
    <Full-Speed device connected.>
    
    GetDescriptor(TYPE_DEVICE): 0x00000000, Retry limit exceeded, transaction canceled.
    

    Maybe I need pullup resistors?
    Prop Info and Apps: http://www.rayslogic.com/
  • RaymanRayman Posts: 9,347
    edited 2019-02-18 - 22:33:21
    Actually, I think I made a big mistake with this board...
    Seems that I have DP on an even pin...

    Tried this, but it doesn't work:
    DP           = 12'27                       ' DP is passive
    DM           = 13'26                       ' DM is "The Brain"
    

    Time to break out some jumpers...
    Prop Info and Apps: http://www.rayslogic.com/
  • Rayman wrote: »
    Actually, I think I made a big mistake with this board...
    Seems that I have DP on an even pin...

    Tried this, but it doesn't work:
    DP           = 12'27                       ' DP is passive
    DM           = 13'26                       ' DM is "The Brain"
    

    Time to break out some jumpers...

    Yeah. DP must be the odd pin. No pullup/down resistors needed on silicon.
    garryj
  • Ok, I've reversed the wires and now it works with what I think is full speed wireless mouse.

    But, doesn't work with low speed mouse or keyboard.
    Gives that same message as with wires backwards:
    GetDescriptor(TYPE_DEVICE): 0x00000000, Retry limit exceeded, transaction canceled.
    Prop Info and Apps: http://www.rayslogic.com/
  • RaymanRayman Posts: 9,347
    edited 2019-02-20 - 14:00:49
    Uh Oh, low speed works when compiled with PNut, but not with Fastspin.
    This sounds like a great challenge for ersmith!
    Prop Info and Apps: http://www.rayslogic.com/
  • Never mind, latest beta version of FastSpin (3.9.21-beta-83b9b75) works with low speed USB.
    Prop Info and Apps: http://www.rayslogic.com/
  • Trying USBMS and think I see a typo...

    Fastspin gives a warning on this line:
    dreq_clear_endpoint
                    cmp     cbw_flags, #BULK_DIR_IN
    


    warning on line 3400 that "cmp" is used without flags being set...
    Prop Info and Apps: http://www.rayslogic.com/
  • Just tried a few thumbdrives…

    The USB-SD-uSD thing is fun. It works with a black 2GB card, but not that white 32GB one.
    The 64GB Kangaroo doesn't work, probably because it's NTFS.
    1GB Lexar JumpDrive works.

    4GB RiData doesn't work, not sure why, seems like it should..
    Gives this:
    <Full-Speed device connected.>
    
    
    
    Vendor ID: Ut163
    
    Product ID: USB2FlashStorage
    
    Version level: 0.00
    
    Media is removable
    
    Device does not claim conformance to any SPC standard
    
    Highest LBA: 8060926
    
    Sector size: 512
    
    Checking media for a FAT file system...
    
    Unable to mount this device.
    
    3024 x 4032 - 2M
    Prop Info and Apps: http://www.rayslogic.com/
  • Rayman wrote: »
    Trying USBMS and think I see a typo...

    Fastspin gives a warning on this line:
    dreq_clear_endpoint
                    cmp     cbw_flags, #BULK_DIR_IN
    


    warning on line 3400 that "cmp" is used without flags being set...

    Yep. This routine is called when clearing a stalled endpoint, which is fairly rare. This one's been there a while. Thanks!
    garryj
  • Rayman wrote: »
    Just tried a few thumbdrives…
    4GB RiData doesn't work, not sure why, seems like it should..

    Hmm. It's bailing early in the FAT check, so the issue is likely something it doesn't like in the MBR or the volume BPB.

    At the "#" start-up prompt, issue a TGLDBG command to enable verbose output and it will output both of these sectors during device enumeration.
    garryj
  • Here it is. Note: this is a fairly old USB drive, wouldn't worry too much about it...
    <Full-Speed device connected.>
    
    GetDescriptor(TYPE_DEVICE): ACK
    
    SetAddress(): ACK
    
    GetDescriptor(TYPE_DEVICE): ACK
    
    GetDescriptor(TYPE_CONFIG): ACK
    
    SetConfiguration(): ACK
    
    RequestMaxLUN(): ACK
    
    
    
    INQUIRY(6):
    
    03EF4: 55 53 42 43  6B 85 59 63  24 00 00 00  80 00 06 12   'USBCk.Yc$.......'
    
    03F04: 00 00 00 24  00 00 00 01  00 00 00 00  00 00 00 55   '...$...........U'
    
    
    
    Data:
    
    04705: 00 80 02 02  1F 00 00 00  55 74 31 36  33 20 20 20   '........Ut163   '
    
    04715: 55 53 42 32  46 6C 61 73  68 53 74 6F  72 61 67 65   'USB2FlashStorage'
    
    04725: 30 2E 30 30  00 00 00 00  00 00 00 00  00 00 00 00   '0.00............'
    
    
    
    Status:
    
    03F13: 55 53 42 53  6B 85 59 63  00 00 00 00  00 53 74 61   'USBSk.Yc.....Sta'
    
    
    
    INQUIRY(6): ACK
    
    Vendor ID: Ut163
    
    Product ID: USB2FlashStorage
    
    Version level: 0.00
    
    Media is removable
    
    Device does not claim conformance to any SPC standard
    
    READ CAPACITY(10):
    
    03EF4: 55 53 42 43  C6 A8 A0 E7  08 00 00 00  80 00 0A 25   'USBC...........%'
    
    03F04: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 55   '...............U'
    
    
    
    Data:
    
    04804: 00 7A FF FE  00 00 02 00  00 00 00 00  00 00 00 00   '.z..............'
    
    
    
    Status:
    
    03F13: 55 53 42 53  C6 A8 A0 E7  00 00 00 00  00 53 74 61   'USBS.........Sta'
    
    
    
    READ CAPACITY(10): ACK
    
    Highest LBA: 8060926
    
    Sector size: 512
    
    Checking media for a FAT file system...
    
    MBR0
    
    0
    
    1
    
    READ(10):
    
    03EF4: 55 53 42 43  E3 33 2F A3  00 02 00 00  80 00 0A 28   'USBC.3/........('
    
    03F04: 00 00 00 00  00 00 00 01  00 00 00 00  00 00 00 55   '...............U'
    
    
    
    Data:
    
    04BD4: FA 33 C0 8E  D0 BC 00 7C  8B F4 50 07  50 1F FB FC   '.3.....|..P.P...'
    
    04BE4: BF 00 06 B9  00 01 F2 A5  EA 1D 06 00  00 BE BE 07   '................'
    
    04BF4: B3 04 80 3C  80 74 0E 80  3C 00 75 1C  83 C6 10 FE   '...<.t..<.u.....'
    
    04C04: CB 75 EF CD  18 8B 14 8B  4C 02 8B EE  83 C6 10 FE   '.u......L.......'
    
    04C14: CB 74 1A 80  3C 00 74 F4  BE 8B 06 AC  3C 00 74 0B   '.t..<.t.....<.t.'
    
    04C24: 56 BB 07 00  B4 0E CD 10  5E EB F0 EB  FE BF 05 00   'V.......^.......'
    
    04C34: BB 00 7C B8  01 02 57 CD  13 5F 73 0C  33 C0 CD 13   '..|...W.._s.3...'
    
    04C44: 4F 75 ED BE  A3 06 EB D3  BE C2 06 BF  FE 7D 81 3D   'Ou...........}.='
    
    04C54: 55 AA 75 C7  8B F5 EA 00  7C 00 00 49  6E 76 61 6C   'U.u.....|..Inval'
    
    04C64: 69 64 20 70  61 72 74 69  74 69 6F 6E  20 74 61 62   'id partition tab'
    
    04C74: 6C 65 00 45  72 72 6F 72  20 6C 6F 61  64 69 6E 67   'le.Error loading'
    
    04C84: 20 6F 70 65  72 61 74 69  6E 67 20 73  79 73 74 65   ' operating syste'
    
    04C94: 6D 00 4D 69  73 73 69 6E  67 20 6F 70  65 72 61 74   'm.Missing operat'
    
    04CA4: 69 6E 67 20  73 79 73 74  65 6D 00 00  00 00 00 00   'ing system......'
    
    04CB4: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04CC4: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04CD4: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04CE4: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04CF4: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04D04: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04D14: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04D24: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04D34: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04D44: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04D54: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04D64: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04D74: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04D84: 00 00 00 00  00 00 00 00  68 A8 A6 B3  00 00 80 01   '........h.......'
    
    04D94: 01 00 06 FE  7F F4 3F 00  00 00 C0 FF  7A 00 00 00   '......?.....z...'
    
    04DA4: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04DB4: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
    
    04DC4: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA   '..............U.'
    
    
    
    Status:
    
    03F13: 55 53 42 53  E3 33 2F A3  00 00 00 00  00 53 74 61   'USBS.3/......Sta'
    
    
    
    READ(10): ACK
    
    Partition BPB
    
    63
    
    1
    
    READ(10):
    
    03EF4: 55 53 42 43  CB 8A CE 18  00 02 00 00  80 00 0A 28   'USBC...........('
    
    03F04: 00 00 00 00  3F 00 00 01  00 00 00 00  00 00 00 55   '....?..........U'
    
    
    
    Data:
    
    04BD4: EB 3C 90 4D  53 44 4F 53  35 2E 30 00  02 80 04 00   '.<.MSDOS5.0.....'
    
    04BE4: 02 00 02 00  00 F8 F6 00  3F 00 FF 00  3F 00 00 00   '........?...?...'
    
    04BF4: C0 FF 7A 00  80 00 29 AB  89 A9 F4 4E  4F 20 4E 41   '..z...)....NO NA'
    
    04C04: 4D 45 20 20  20 20 46 41  54 31 36 20  20 20 33 C9   'ME    FAT16   3.'
    
    04C14: 8E D1 BC F0  7B 8E D9 B8  00 20 8E C0  FC BD 00 7C   '....{.... .....|'
    
    04C24: 38 4E 24 7D  24 8B C1 99  E8 3C 01 72  1C 83 EB 3A   '8N$}$....<.r...:'
    
    04C34: 66 A1 1C 7C  26 66 3B 07  26 8A 57 FC  75 06 80 CA   'f..|&f;.&.W.u...'
    
    04C44: 02 88 56 02  80 C3 10 73  EB 33 C9 8A  46 10 98 F7   '..V....s.3..F...'
    
    04C54: 66 16 03 46  1C 13 56 1E  03 46 0E 13  D1 8B 76 11   'f..F..V..F....v.'
    
    04C64: 60 89 46 FC  89 56 FE B8  20 00 F7 E6  8B 5E 0B 03   '`.F..V.. ....^..'
    
    04C74: C3 48 F7 F3  01 46 FC 11  4E FE 61 BF  00 00 E8 E6   '.H...F..N.a.....'
    
    04C84: 00 72 39 26  38 2D 74 17  60 B1 0B BE  A1 7D F3 A6   '.r9&8-t.`....}..'
    
    04C94: 61 74 32 4E  74 09 83 C7  20 3B FB 72  E6 EB DC A0   'at2Nt... ;.r....'
    
    04CA4: FB 7D B4 7D  8B F0 AC 98  40 74 0C 48  74 13 B4 0E   '.}.}....@t.Ht...'
    
    04CB4: BB 07 00 CD  10 EB EF A0  FD 7D EB E6  A0 FC 7D EB   '.........}....}.'
    
    04CC4: E1 CD 16 CD  19 26 8B 55  1A 52 B0 01  BB 00 00 E8   '.....&.U.R......'
    
    04CD4: 3B 00 72 E8  5B 8A 56 24  BE 0B 7C 8B  FC C7 46 F0   ';.r.[.V$..|...F.'
    
    04CE4: 3D 7D C7 46  F4 29 7D 8C  D9 89 4E F2  89 4E F6 C6   '=}.F.)}...N..N..'
    
    04CF4: 06 96 7D CB  EA 03 00 00  20 0F B6 C8  66 8B 46 F8   '..}..... ...f.F.'
    
    04D04: 66 03 46 1C  66 8B D0 66  C1 EA 10 EB  5E 0F B6 C8   'f.F.f..f....^...'
    
    04D14: 4A 4A 8A 46  0D 32 E4 F7  E2 03 46 FC  13 56 FE EB   'JJ.F.2....F..V..'
    
    04D24: 4A 52 50 06  53 6A 01 6A  10 91 8B 46  18 96 92 33   'JRP.Sj.j...F...3'
    
    04D34: D2 F7 F6 91  F7 F6 42 87  CA F7 76 1A  8A F2 8A E8   '......B...v.....'
    
    04D44: C0 CC 02 0A  CC B8 01 02  80 7E 02 0E  75 04 B4 42   '.........~..u..B'
    
    04D54: 8B F4 8A 56  24 CD 13 61  61 72 0B 40  75 01 42 03   '...V$..aar.@u.B.'
    
    04D64: 5E 0B 49 75  06 F8 C3 41  BB 00 00 60  66 6A 00 EB   '^.Iu...A...`fj..'
    
    04D74: B0 42 4F 4F  54 4D 47 52  20 20 20 20  0D 0A 52 65   '.BOOTMGR    ..Re'
    
    04D84: 6D 6F 76 65  20 64 69 73  6B 73 20 6F  72 20 6F 74   'move disks or ot'
    
    04D94: 68 65 72 20  6D 65 64 69  61 2E FF 0D  0A 44 69 73   'her media....Dis'
    
    04DA4: 6B 20 65 72  72 6F 72 FF  0D 0A 50 72  65 73 73 20   'k error...Press '
    
    04DB4: 61 6E 79 20  6B 65 79 20  74 6F 20 72  65 73 74 61   'any key to resta'
    
    04DC4: 72 74 0D 0A  00 00 00 00  00 00 00 AC  CB D8 55 AA   'rt............U.'
    
    
    
    Status:
    
    03F13: 55 53 42 53  CB 8A CE 18  00 00 00 00  00 53 74 61   'USBS.........Sta'
    
    
    
    READ(10): ACK
    
    Unable to mount this device.
    
    
    
    HWStack return address:
    
    00000016
    
    Prop Info and Apps: http://www.rayslogic.com/
  • Rayman wrote: »
    Here it is. Note: this is a fairly old USB drive, wouldn't worry too much about it...
    It's formatted as partition type $06 (FAT16) with a cluster size of 128KB and I currently have the cluster buffer set to a max of 32KB. I did that because FAT32 with 16KB cluster size gets you 64GB+. But since we're testing, I probably should be looking at the extremes, too.

    If you want to test it out, you can change the MAX_CLUSTER_SIZE constant to a max of 128KB and the "boms_cluster_buff" buffer size to MAX_CLUSTER_SIZE and it should enumerate.
    garryj
  • Huh, I thought 32KB was max cluster size. I remember Win95 limited to that. Largest FAT16 volume size was 2 GB.
    "There's no huge amount of massive material
    hidden in the rings that we can't see,
    the rings are almost pure ice."
  • yes, that worked, thanks.
    Prop Info and Apps: http://www.rayslogic.com/
  • garryj: Do you have any guidance for using this in an application?
    I see I can "type" a file, so know I can get access to a file's contents.

    Say I want to open a bmp file and copy contents to RAM.
    Is there an easy way to do that?
    Prop Info and Apps: http://www.rayslogic.com/
  • evanh wrote: »
    Huh, I thought 32KB was max cluster size. I remember Win95 limited to that. Largest FAT16 volume size was 2 GB.
    Yep, that's still what MS recommends for "maximum compatibility" regarding FAT16.
    garryj
  • Rayman wrote: »
    garryj: Do you have any guidance for using this in an application?
    I see I can "type" a file, so know I can get access to a file's contents.

    Say I want to open a bmp file and copy contents to RAM.
    Is there an easy way to do that?

    The TYPE/CAT routine is single-minded, but does show the steps needed to read the directory and access the content of a file. Real fopen() type access is planned, but slow in coming...
    garryj
  • Thanks. I'm still thinking about how I'd use this...
    uSD kindof does the same thing.

    Thumb drives can be bigger in capacity though.
    Harder to break, apparently.
    Easier to handle...
    Prop Info and Apps: http://www.rayslogic.com/
  • RaymanRayman Posts: 9,347
    edited 2019-02-21 - 17:22:33
    How does the read speed compare with usd with spi interface ?

    Only needs 2 pins (instead of 4 for uSD). That can be a big advantage...
    Prop Info and Apps: http://www.rayslogic.com/
  • jmgjmg Posts: 13,261
    Rayman wrote: »
    How does the read speed compare with usd with spi interface ?

    Only needs 2 pins (instead of 4 for uSD). That can be a big advantage...

    Did you mean USB vs SPI ?
    USB needs 2 COGs I think, but yes, it can run on just 2 pins.
    Top USB speeds I've seen from PC's are 8~9 MBit/s (ie the 12 MHz minus overheads), which is slower than P2 can run SPI.
  • I bet USB could be made to run in 1 cog.
    Prop Info and Apps: http://www.rayslogic.com/
  • Rayman wrote: »
    I bet USB could be made to run in 1 cog.
    Working on it...

    BTW, my head-math sucks -- the cluster size of your RiData drive is 64KB. For what it's worth, this is what MS has to say regarding FAT cluster sizes:
    BPB_SecPerClus (BPB offset 13, one byte):
    Number of sectors per allocation unit. This value must be a power
    of 2 that is greater than 0. The legal values are 1, 2, 4, 8, 16, 32, 64,
    and 128. Note however, that a value should never be used that
    results in a “bytes per cluster” value (BPB_BytsPerSec *
    BPB_SecPerClus) greater than 32K (32 * 1024). There is a
    misconception that values greater than this are OK. Values that
    cause a cluster size greater than 32K bytes do not work properly; do
    not try to define one. Some versions of some systems allow 64K
    bytes per cluster value. Many application setup programs will not
    work correctly on such a FAT volume.
    
    garryj
Sign In or Register to comment.