Page 1 of 1
MMC over SPI
Posted: Tue Feb 01, 2011 10:21 am
by mculover
Hi Giovanni,
From FatFs example, I do not understand about event in MMC over SPI Driver.
MMCDriver need MMCDriver.mmc_inserted_event and MMCDriver.mmc_removed_event.
How to MMCDriver link to function InsertHandler () and RemoveHandler () ?.
Thanks for advance.
mculover
Re: MMC over SPI
Posted: Tue Feb 01, 2011 12:32 pm
by Giovanni
The MMC driver needs to be reinitialize the card each time it is inserted, the FS module also requires to re-mount the file system on insertion.
The remove event is needed by the application, it notifies that reading and writing the FS is no more possible.
Giovanni
Re: MMC over SPI
Posted: Tue Feb 01, 2011 4:31 pm
by mculover
Hi Giovanni,
How event in MMCDriver work ?.
MMCDriver and el0, el1 relative with...
Code: Select all
struct EventListener el0, el1;
chEvtRegister(&MMCD1.mmc_inserted_event, &el0, 0);
chEvtRegister(&MMCD1.mmc_removed_event, &el1, 1);
Handler function and evhndl relative with...
Code: Select all
chEvtDispatch(evhndl, chEvtWaitOne(ALL_EVENTS));
static const evhandler_t evhndl[] = {
InsertHandler, /*Function name */
RemoveHandler /*Function name */
};
evhndl and el0 not relative.
I can not find connection point between MMCD1.mmc_inserted_event and InsertHandler ().
I don't know, How MMCD1.mmc_inserted_event call function InsertHandler () ?
Thanks in advance.
mculover
Re: MMC over SPI
Posted: Tue Feb 01, 2011 4:59 pm
by Giovanni
It is the third parameter in the chEvtRegister() function, it specifies the index in the event handlers array. Basically it creates an association between the event source and the handler function.
Giovanni
Re: MMC over SPI
Posted: Wed Feb 02, 2011 1:47 pm
by mculover
Hi Giovanni,
I will test again, Thanks in advance.
mculover
Re: MMC over SPI
Posted: Sat Feb 19, 2011 10:28 am
by mculover
Hi Giovanni,
In example of Chibi RTOS.
Other driver create driver object in each own section, Ex. SD1 for serial.
Why user create "MMCDriver MMCD1;", Not in own section ?.
For remove SD Card event, What is right choice to do ?.
Use mmcDisconnect () or more or nothing to do like in example ?.
Thanks for advance.
mculover
Re: MMC over SPI
Posted: Sat Feb 19, 2011 12:17 pm
by Giovanni
Hi,
The MMC driver is "generic" the other drivers are tied to physical hardware resources. This is why serial driver are implicitly instantiated and the MMC driver has to be instantiated and initialized explicitly.
There is no need to perform mmcDisconnect() when a card is removed, the card is gone already, the internal state machine is reset automatically in the pre-insertion state (see the diagram).
Giovanni
Re: MMC over SPI
Posted: Mon Feb 21, 2011 9:37 am
by mculover
Hi Giovanni,
FatFs can accept long file name and SDHC card. But, I find limitation of MMC driver is 2GB SD Card in your document.
What is point to improve driver to use more 2GB SD card, In SPI driver or MMC driver ?.
Thanks for advance.
mculover
Re: MMC over SPI
Posted: Mon Feb 21, 2011 9:51 am
by Giovanni
Hi,
It is the card initialization that should be modified, not a big deal, this change is in the to-do list for 2.3.x.
Giovanni