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.
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.
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.
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.
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.
@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...
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
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.
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...
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.
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.
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
Comments
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.
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,
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
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,
and 00000000 for all others, which not worked.
You should get a value of 1, 2, or 3. But not zero.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
@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,
Andy
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
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.
Okay, attached is another test.
You should hopefully get 2 or 1. Not zero.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
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,
Use this instead of the "special version".
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Andy
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,
I hope this makes sense for you.
Andy
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,
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