Shop OBEX P1 Docs P2 Docs Learn Events
Everything and the Kitchen Sink - Full File System Driver Beta - Page 2 — Parallax Forums

Everything and the Kitchen Sink - Full File System Driver Beta

24

Comments

  • Ahle2Ahle2 Posts: 1,179
    edited 2010-01-12 17:29
    FATEngine Beta Demo Special works [noparse]:)[/noparse]
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-12 17:32
    Now that the block driver issue is resolved -- other features are very good. This is a really good alternative to fsrw for certain things. Most of my applications don't need super high performance, I'm more concerned with hub ram usage and the ability to make and switch to new directories is great for doing open-ended data logging where you say create a new file every day and arrange them in a year/month/date tree.

    One thing that does occur to me that might warrant a special/different version is that it would be very trivial to free up another 512 bytes of RAM by moving the byte buffer to the DAT area where the PASM code lives, since the PASM is never used again once the cog is started. However, that would ruin the ability to run more than one copy at a time.
  • KyeKye Posts: 2,200
    edited 2010-01-13 00:59
    Mmm, you'll have to do that localroger. I have interest in having multiple copies open at once.

    So, this is what I'll do. I'll make a version that uses my block driver and implements all my features I need, if that version does not work you can use another version where I have the FSRW block drivers running underneath.

    That should make everyone happy.

    ...

    @LocalRoger and everyone who has had my non special version fail.

    Can you please run the attached code and use the "mount" command (no parameters). With everything else·setup to work in the read me file.

    The command should either return disk I/O error or a·10·digit number. That number is the count of sectors on the volume. Multiply the number it returns by 512 on a calculator and check to see if that is arround the·count of bytes on your disk.·If it is correct then that means my mounting code worked.

    The code attached will not run any other commands besides "mount" as·I'm·using the mount command to just return the disk sector count and nothing else. This code is just for testing purposes.

    It will help me figure out what is wrong with my·block driver as I would prefer to use it since it follows·the SD card spec and offers more features that the FSRW block drivers.

    I remember having this type of error before but it just went away magically. I believe it was a problem with my my timeouts when using block read and write. However, while developing I had a situation where I couldn't even start the intialization process for an SD card. But that was caused by the fact that the SD card was in multi block mode as FSRW just used it and the power had not been cycled.

    Remembering that I would have to ask that you make sure to cycle the power on the SD card... Unplug it, after using FSRW with my block driver because my block driver does not ask the card to exit multiblock mode.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-13 01:13
    Will run your test first thing at work tomorrow, Kye. I am interested in getting your version to work as it is smaller and leaner than fsrw, and that is more important to me.
  • Ahle2Ahle2 Posts: 1,179
    edited 2010-01-13 10:01
    The last version gives
    >_ FAT Engine Terminal Now Running - Please Mount Disk First! Type... (mount 0)
    
    >_ mount
    Running command: mount
     0000000000 Mounted
    
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-13 15:49
    I get the same result as Ahle2 -- all zeroes.
  • KyeKye Posts: 2,200
    edited 2010-01-14 01:13
    Okay, well that means the mounting code fails... Now why is the real question...

    If you bear with me you can help debug this one section at a time.

    So just do the same thing you did with the old pice of code.

    If the test worked you·won't get zero returned from mountcard.

    I set this one up so that the when the driver manages to get a card to enter idle state on startup it writes $FFFFFFFF to the value that is returned by mountcard and then shuts down.

    I should be able to zero in on the error from this test.

    Thanks, I may have a few other test·coming too also.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,

    Post Edited (Kye) : 1/14/2010 1:18:53 AM GMT
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-14 13:32
    Progress! This one returns $FFFFFFFF if there is an SD card in the socket, and zeroes if there is not. Keep 'em coming...
  • KyeKye Posts: 2,200
    edited 2010-01-14 15:39
    Mmm, okay, so that means another part of the intialization code fails. Okay, that good since theres only a bit more to debug.

    Try this out.

    Just do the same thing as last time.

    You'll have to reprogram in between test because the block driver is set to shutdown.

    You should get 1 for MMC cards, 2 for·1.0 SD cards,·and 3 for 2.0 SD cards.

    I think I believe I know where the problem lies. This test should confirm that.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-14 17:32
    OK this one returns 00000000 whether there is a card in the socket or not.
  • AribaAriba Posts: 2,690
    edited 2010-01-14 17:52
    I get 00000003 for the SD cards that worked with your first driver version (the 512MB Kingston),
    and 00000000 for all others, which not worked.
  • KyeKye Posts: 2,200
    edited 2010-01-15 00:28
    Okay I think I know what the problem is. This one should work.

    You should get a value of 1, 2, or 3. But not zero.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • AribaAriba Posts: 2,690
    edited 2010-01-15 05:12
    Still the same result as before (mostly zero).
  • rokickirokicki Posts: 1,000
    edited 2010-01-15 06:17
    I believe fsrw is substantially smaller than this code.
    localroger said...
    Will run your test first thing at work tomorrow, Kye. I am interested in getting your version to work as it is smaller and leaner than fsrw, and that is more important to me.
  • KyeKye Posts: 2,200
    edited 2010-01-15 06:43
    @rokicki - The block drivers you have·increase the final·code size by more however.

    @Ariba and localRoger - thanks for the help guys, okay, please try this test build also, you should get results of 1 and not zero.

    I've narrowed the problem down to the intialization code used for the SD cards. However, I'm pretty much doing the same things as the new FSRW block drivers. I removed a few extra clocks that were not mandated by the spec however in my code that were in the new FSRW drivers. If this test doesn't work I'll have to try to put those in...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • AribaAriba Posts: 2,690
    edited 2010-01-15 07:10
    The only difference: I get now 1 instead of 3 for the working cards, but all others still zero.

    Andy
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2010-01-15 11:15
    Hopefully in the next week or so I can setup my SD card and Demo board and try out the code in this thread. I have been wanting to use some SD cards in a project, but haven't had time yet.

    Kye - keep up the testing and trouble shooting. I like your idea of doing different test codes and seeing the results from those helping you out.

    One question: I haven't studied the code yet, but how much space does this code take and how many COGs does it use?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-15 13:29
    rokicki, Kye's code is almost exactly the same size as fsrw2.6, but is oriented more toward universality and features than high speed. His block driver is substantially smaller (if we can get it to work) and is more suited to making it even smaller by overlaying the data buffer on the PASM source image when only one instance is needed.

    Personally I have been eyeing up sdspiqasm from fsrw1.x as the basis for a truly low-footprint system, but I kind of want to see where Kye goes with this thing first.
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-15 13:42
    Kye, latest test still returns zeroes for me.
  • KyeKye Posts: 2,200
    edited 2010-01-15 14:47
    For my system most of the high level functions can be commented out to reduce code size easily if you wanted to.

    Okay, attached is another test.

    You should hopefully get 2 or 1. Not zero.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-15 16:31
    Still zeroes.
  • KyeKye Posts: 2,200
    edited 2010-01-15 17:36
    ... WT*? Mmm, well... Umm... I'm out of ideas now. What type of SD card do you have localroger?

    Do you live in the USA? Maybe you could mail me that card so I could test it...

    If this piece of code doesn't work I'll need to work more hands on at this problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • KyeKye Posts: 2,200
    edited 2010-01-15 19:13
    Heres' a non-hacked version of my driver with lonesock's SPI SD/SDHC/MMC card underneath. It should work pretty well.

    Use this instead of the "special version".


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • AribaAriba Posts: 2,690
    edited 2010-01-15 19:17
    Kye, your latest Test version gives now always 2 for all my cards, exept the 16MB MMC (but this MMC also works not with the FSRW 2). Will try later also the Lonesock version...

    Andy
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-15 19:43
    OK, latest test gives 2 with a card inserted and 0 without. The version with lonesock's driver also works.
  • KyeKye Posts: 2,200
    edited 2010-01-15 20:47
    Oh, wait it does...? Well that's good new then.

    I should be able then to fix the problem with my version for all SD card. Thanks guys, I'll have a working non-demo version that should work for you posted up tonight.

    Now I know exactly what the problem was.

    Thanks,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • AribaAriba Posts: 2,690
    edited 2010-01-15 21:22
    The Lonesock version works with the SD cards, which not worked before, but no longer with the cards that worked.
    I hope this makes sense for you.

    Andy
  • KyeKye Posts: 2,200
    edited 2010-01-16 02:18
    Okay, this version should report the card sector count to you. If it does when you run the mount command then everything worked.

    The card sector count * 512 = number of bytes on the card. Note that the sector count is a bit less than the maximum capacity due to the use of security blocks and other stuff in the SD card protocol.

    You'll have to reprogram the prop chip between insertions since the block driver shutsdown once it mounts the SD card.

    So...

    1: Program,
    2: Put card in,
    3: Run mount command, look at value, should not be zero.
    4: Remove card
    5: Repeat for all cards, goto 1.

    This driver worked for all my cards. Cross your fingers.

    I'll have the non test version up soon once I get confirmation here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • localrogerlocalroger Posts: 3,452
    edited 2010-01-16 03:49
    I'll test it first thing Monday; I left the test rig at work.
  • HannoHanno Posts: 1,130
    edited 2010-01-16 07:39
    Great job Kye! I'll give this a try asap. Looking forward to more of your great work this year...
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Co-author of the official Propeller Guide- available at Amazon
    Developer of ViewPort, the premier visual debugger for the Propeller (read the review here, thread here),
    12Blocks, the block-based programming environment (thread here)
    and PropScope, the multi-function USB oscilloscope/function generator/logic analyzer
Sign In or Register to comment.