2 x Prop1 sharing 1 uSD
MacTuxLin
Posts: 821
Has anyone successfully access a single uSD card using either FSRW or Kye's SD-MMC_FATEngine with dual Prop1? I reckon only a single Prop1 can access the uSD card at anyone time?
Comments
I planned to have the Props signal each other so they would know which Prop could access the card when. I think you'd want to make sure all shared pins on one Prop were inputs while the other Prop used the SD card.
I agree with your view that two Props could share a SD card as long as they weren't both trying to access it at the same time.
I might try this tomorrow.
Not with FSRW or Kye's SD-MMC_FATEngine, but propforth uses a scheme where one cog does the driver for the SD, and the other cogs just send commands and recieve data.
The prop-to-prop interface is the high speed synchronous serial, so talking to a cog on a different prop appears the same as a cog on the local chip.
The parts are there, but it hasn't been built into a good example application yet, so there is still some work to do.
And of course its in forth.
Hmm, might be a good time to try PropForth. The only time I've tried Forth was on a Mac. Thanks.
Thanks Kye. Yeap, I'll make sure only 1 of them gets to access it at any one time.
Maybe also have some 100 ohm resistors in line with the SCLK, and DI lines. DO is driven by the card and CS is open drained by my driver.
If you do get 2 props sharing the SD card, your logic will need a way of knowing that it is not clobbering the area in use by the other prop (a feature known as mad brain in HA systems where the backup processor on a shared disk array would think the main unit failed while the main unit is still functioning and they begin scrambling the shared disk space) even though your hardware could guarantee that they both do not try simultaneous access.
Good luck,
Frank
P2: "I need to use, are you using?"
P1: "I'm using, you wait" ...
P1: "OK, I'm done, you still want it?"
... Something along that line ...
Hello Kye,
I'll scope it next week but I've briefly read thru the ASM. I have a question & please correct me if I'm wrong:
Assuming P1 is waiting (CIDCompareLoop), I should check for any cardErrorFlag before passing control to P2, right?
Just make sure to check the "partitionError" function to see if any command failed after being called.
Note: that my driver has write acceleration (meaning some functions return before the write has completed which will happen in the background)... so if you want to ensure that the block driver has released the card always unmount (by calling the "unmount" function) after using the card.
If you need directory support doing this then just use the path name feature (instead of "open("file")" do "open("folder/folder/file")"). This is because the current directory will get reset back to the root after each umount.