Microchip

 USB MassMemory device

Change Page: 1234 > | Showing page 1 of 4, messages 1 to 20 of 79
Author Message
DarioG

  • Total Posts : 39338
  • Reward points : 0
  • Joined: 2/25/2006
  • Location: Trana (TO), Italy
  • Status: offline
USB MassMemory device Tuesday, January 16, 2007 4:51 AM (permalink)
0
I'm finally working on Microchip's MassMemory device. I'm starting out with the shipped version, then I'd like to have it interfaced to another Flash Memory rather than SD (more an academic exercise actually and also because I have not SD socket nor cards here at the moment...), and later also try some FAT support.

First trouble I ran into... I'm using Windows 98 on that Development PC and I can't find a driver for the Device! I tried UMSS from Microsoft, adapted VID & PID, but now the device is recgnized yet not working (yellow exclamation mark). I tried googling, but with no success... so am asking if anybody already ran into this. Actually, into the INF file, I should probably also "declare if the device is using ONLY_BULK, C/B or C/B/I access". I could not find that info into Microchip's sources, but I assumed it is a Bulk only... yet it does not work.

Thanks everybody!
Dario Greggio

 
#1
    ric

    • Total Posts : 12865
    • Reward points : 0
    • Joined: 11/7/2003
    • Location: Australia, Melbourne
    • Status: offline
    RE: USB MassMemory device Tuesday, January 16, 2007 4:59 AM (permalink)
    0
    Windows 98 doesn't have support for mass storage devices built in, Windows 2000 and XP both do.
    ---—≡≡≡
    (All users, please read the "forum guidelines" before posting a question.)
     
    #2
      DarioG

      • Total Posts : 39338
      • Reward points : 0
      • Joined: 2/25/2006
      • Location: Trana (TO), Italy
      • Status: offline
      RE: USB MassMemory device Tuesday, January 16, 2007 5:03 AM (permalink)
      0
      Yes, I know wink, that's why I'm searching for one!

      It's what happens with Pen Drive and/or MP3 players, which ship a driver for older OS.
      Dario Greggio

       
      #3
        DarioG

        • Total Posts : 39338
        • Reward points : 0
        • Joined: 2/25/2006
        • Location: Trana (TO), Italy
        • Status: offline
        RE: USB MassMemory device Tuesday, January 16, 2007 5:07 AM (permalink)
        0
        Hmmm, AN1033 states that *this device does not support Windows 98 (see FAQ)" ... grrr, why, if anybody else *can* support it?Smile
        Dario Greggio

         
        #4
          DarioG

          • Total Posts : 39338
          • Reward points : 0
          • Joined: 2/25/2006
          • Location: Trana (TO), Italy
          • Status: offline
          RE: USB MassMemory device Tuesday, January 16, 2007 6:23 AM (permalink)
          0
          Ok, moving on by now.
          The device is not working even in Win2000.

          Anybody can confirm if the device is supposed to be enumerated/installed EVEN if no memory is there? (I simply faked the CARD_PRESENT switches and such)
          I mean, I'm not handling my memory at the moment: just wanted to know if the device will "appear", of course without accepting writes or reads from Windows Filesystem.
          Dario Greggio

           
          #5
            Pacer

            • Total Posts : 1164
            • Reward points : 0
            • Joined: 12/1/2004
            • Status: offline
            RE: USB MassMemory device Tuesday, January 16, 2007 6:34 AM (permalink)
            0
            Dario, I never got round to trying making something in this class yet. But one of the first things the operating system is going to do is read the directory and that sounds like it's going to fail to me.
             
            #6
              DarioG

              • Total Posts : 39338
              • Reward points : 0
              • Joined: 2/25/2006
              • Location: Trana (TO), Italy
              • Status: offline
              RE: USB MassMemory device Tuesday, January 16, 2007 6:37 AM (permalink)
              0
              I see, Pacer. I had that feeling, but hoped to be able to "split" the development phase.
              Thx by now.
              Dario Greggio

               
              #7
                jarin

                • Total Posts : 740
                • Reward points : 0
                • Joined: 5/23/2005
                • Status: offline
                RE: USB MassMemory device Tuesday, January 16, 2007 6:49 AM (permalink)
                0
                Yes Dario, I've got it worked under win2000, with no memory card. Of course, there were neccessary some changes to make the firmware ignoring there is no card.
                I also tried to modify the firmware to talk to EEPROM 24LC1025 rather than SD card, but I was only partial succesful.
                After a few experiments I got a new drive icon under "My computer", but I wasn't able to format or write to the device, it probably need a bit more investigation.

                Jaromir Sukuba, Bratislava, Slovakia
                http://jaromir.xf.cz/  - open source PIC18 debugger. Update 20.02.2012, project RetroBSD minicomputer
                 
                #8
                  Pacer

                  • Total Posts : 1164
                  • Reward points : 0
                  • Joined: 12/1/2004
                  • Status: offline
                  RE: USB MassMemory device Tuesday, January 16, 2007 6:52 AM (permalink)
                  0
                  Here's the first few transfers to expect:



                  [image]local://26770/D91A7DB2FC6F48E58ECA26ED7A0DA074.gif[/image]
                  <message edited by Pacer on Tuesday, January 16, 2007 6:55 AM>
                  Attached Image(s)
                   
                  #9
                    DarioG

                    • Total Posts : 39338
                    • Reward points : 0
                    • Joined: 2/25/2006
                    • Location: Trana (TO), Italy
                    • Status: offline
                    RE: USB MassMemory device Tuesday, January 16, 2007 6:58 AM (permalink)
                    0
                    Alright, thank you both: I'll continue my work tonight.

                    Do you confirm that no one has got this working under Win98? Maybe a driver should be written from scratch using DDK? I can't believe that it needs exactly "usbstor.sys" wink
                    Dario Greggio

                     
                    #10
                      alhyene

                      • Total Posts : 19
                      • Reward points : 0
                      • Joined: 12/24/2006
                      • Location: 0
                      • Status: offline
                      RE: USB MassMemory device Wednesday, January 17, 2007 9:01 PM (permalink)
                      0
                      I don't know if it work, maybe by tweaking VID / PID, but I got my pendrive working under 98 with this driver :
                      http://www.lexar.com/drivers/files/Jdusb2.exe
                       
                       
                      #11
                        DarioG

                        • Total Posts : 39338
                        • Reward points : 0
                        • Joined: 2/25/2006
                        • Location: Trana (TO), Italy
                        • Status: offline
                        RE: USB MassMemory device Thursday, January 18, 2007 1:45 AM (permalink)
                        0
                        Thanks alhyene!
                        I'm twiddling with the Block Size and other parameters in the Code... I will test it soon.
                        Dario Greggio

                         
                        #12
                          DarioG

                          • Total Posts : 39338
                          • Reward points : 0
                          • Joined: 2/25/2006
                          • Location: Trana (TO), Italy
                          • Status: offline
                          RE: USB MassMemory device Thursday, January 18, 2007 9:23 AM (permalink)
                          0
                          Hmmm, well I'm stuck at almost step #1:
                          Looks like only one packet is exchanged, and this one fails!

                          I'm attaching a SnoopyPro log, it looks like there's no answer to the 1st BULK request (and that 0xc0000005 error is scary, looks like the famous Exception Error in Windows... !)
                          (1st half of the screen is a PenDrive, working. The packet is 32 bytes instead of 31, but I can't say if that makes a difference) 2nd half is my MSD variation.

                          The main structure of my program is almost identical to Microchip's one, I'm just cheating a little as needed to fake the presence of a SD card... but it looks like we're not even getting there!

                          Pacer, can you help me?
                          Thanks
                          <message edited by DarioG on Thursday, January 18, 2007 9:28 AM>
                          Attached Image(s)
                          Dario Greggio

                           
                          #13
                            Pacer

                            • Total Posts : 1164
                            • Reward points : 0
                            • Joined: 12/1/2004
                            • Status: offline
                            RE: USB MassMemory device Thursday, January 18, 2007 9:58 AM (permalink)
                            0
                            Quick look only. That's a scsi enquiry command. It is in a CBW which is supposed to be 31 bytes long. The response is supposed to be an IN bulk transfer of 36 bytes in which you describe the device. I guess you have to fake that somehow...
                             
                            #14
                              DarioG

                              • Total Posts : 39338
                              • Reward points : 0
                              • Joined: 2/25/2006
                              • Location: Trana (TO), Italy
                              • Status: offline
                              RE: USB MassMemory device Thursday, January 18, 2007 10:01 AM (permalink)
                              0
                              Thanks, I'm figuring out that something is deeply wrong in code... the Pic does not even see the correct signature in incoming packet!!
                              So it does not reply at all (thus probably the 0xc0000005)

                              Going on Smile

                              BTW, you've not used that MassMemory example by Microchip, have you?
                              Dario Greggio

                               
                              #15
                                DarioG

                                • Total Posts : 39338
                                • Reward points : 0
                                • Joined: 2/25/2006
                                • Location: Trana (TO), Italy
                                • Status: offline
                                RE: USB MassMemory device Thursday, January 18, 2007 10:10 AM (permalink)
                                0
                                BINGO!

                                In my effort to "sum up altogether" different parts from different Microchip Stacks... (HID, CDC, MSD) at least in their common parts...
                                I had erased one call needed for MSD (or better, forgot to copy)

                                All good and device is already recognized by Win 98 with "UMSS" driver... am really happy Smile

                                Now, it's asking for formatting... let's see how it goes.
                                Dario Greggio

                                 
                                #16
                                  DarioG

                                  • Total Posts : 39338
                                  • Reward points : 0
                                  • Joined: 2/25/2006
                                  • Location: Trana (TO), Italy
                                  • Status: offline
                                  RE: USB MassMemory device Thursday, January 18, 2007 11:12 AM (permalink)
                                  0
                                  Hmmm, in your mind, should a MassMemory Device work also with a Sector Size of 128 (instead of 512) ?
                                  Dario Greggio

                                   
                                  #17
                                    Pacer

                                    • Total Posts : 1164
                                    • Reward points : 0
                                    • Joined: 12/1/2004
                                    • Status: offline
                                    RE: USB MassMemory device Thursday, January 18, 2007 12:11 PM (permalink)
                                    0
                                    Dario, I've never played with Mass Storage except to look at the protocol on the bus. Jan's book says, about FAT 16 and FAT32 sector size: 'use 512 (bytes/sector) for maximum compatibility, other allowed values are 1k, 2k 4k, 8k, 16k, 32k, 64k.'
                                     
                                    Reading that I would stick to 512.
                                     
                                    Many of the first Read commands are to LBA 0 which will contain the boot sector which contains formatting information. If you are faking the medium then you will have to provide a convincing set of data for that sector, when asked in a 'read' to provide it.
                                     
                                    #18
                                      DarioG

                                      • Total Posts : 39338
                                      • Reward points : 0
                                      • Joined: 2/25/2006
                                      • Location: Trana (TO), Italy
                                      • Status: offline
                                      RE: USB MassMemory device Thursday, January 18, 2007 12:33 PM (permalink)
                                      0
                                      Hi Pacer, thank you.
                                      I am already reading/writing to a 24LC256 I had around. So, I'm only faking the "attributes" or rather I'm providing small ones, to accomplish a 32KB disk drive!

                                      I (wrongly) decided to reduce the sector size, because the 24LC512 I planned to use has an internal buffer for page_write of 128 bytes. But later I discovered that I could easily split the WRITE_REQUEST from USB into smaller ones (and moreover the 24LC256 hs a 64bytes buffer...)

                                      I've done tests with 128bytes sector size and it seems to hang somewhere, when trying to format or rather while gathering medium properties, after having read correctly some sectors (seems 0 and 1). I mean, all is fine as for installing device and showing in My Computer. As I click on it, it hangs, and the sniffer seems to show that a "0x03" packet (Request_sense, it would seem) has gotton no answer. Strange, indeed: I guess the problem is not there.

                                      Thank you, I'll go on with 512 bytes sectors, later.
                                      Dario Greggio

                                       
                                      #19
                                        DarioG

                                        • Total Posts : 39338
                                        • Reward points : 0
                                        • Joined: 2/25/2006
                                        • Location: Trana (TO), Italy
                                        • Status: offline
                                        RE: USB MassMemory device Friday, January 19, 2007 4:41 PM (permalink)
                                        0
                                        Well, some steps ahead, but still not done.

                                        The board used to hang at "REQUEST_SENSE", a command that PC sends after havng read INQUIRY data, CAPACITY and some sectors (which of course by now contain rubbish: in fact, if I double-click the icon, I'm asked to format).
                                        Strange is, REQUEST_SENSE is handled rather easily, returning a 18-byte struct to the PC, so nothing fancy; I found out that the struct could possibly not have been initialized properly, so I added a call to the ResetSense() func, and someway I moved on.

                                        Yet, some other problem must lie there. Though Capacity is correctly returned (63 sectors made of 512 bytes = 32768bytes= 24LC256 capacity), when Format is on, I get "unknown size" on Win2000 and some 2000000MB on Win98. Of course format fails (but this could be a problem of the low-level I2C functions... though they've been almost copied from a working project).
                                        I also tried other capacity value, to cheat... and indeed it seems to take longer to popup the "Format" dialog, but nothing works anyway.

                                        The sniffer is telling me that things are working rather well... The error I was getting when the device used to hang was a "0xc000000c" which should mean "BUFFER OVERRUN". No reason for this, of course, as I explained above...


                                        Dario Greggio

                                         
                                        #20
                                          Online Bookmarks Sharing: Share/Bookmark
                                          Change Page: 1234 > | Showing page 1 of 4, messages 1 to 20 of 79

                                          Jump to:

                                          Current active users

                                          There are 0 members and 1 guests.

                                          Icon Legend and Permission

                                          • New Messages
                                          • No New Messages
                                          • Hot Topic w/ New Messages
                                          • Hot Topic w/o New Messages
                                          • Locked w/ New Messages
                                          • Locked w/o New Messages
                                          • Read Message
                                          • Post New Thread
                                          • Reply to message
                                          • Post New Poll
                                          • Submit Vote
                                          • Post reward post
                                          • Delete my own posts
                                          • Delete my own threads
                                          • Rate post

                                          2000-2013 ASPPlayground.NET Forum Version 3.9