[En-Nut-Discussion] MMC Card interface to Ethernut

Pearless Douglas.Pearless at pearless.co.nz
Sat Oct 2 12:20:30 CEST 2004


Do I assume that I should be extending c:\ethernut\nut\fs\fat.c to also
handle MMC cards, rather than re-inventing the wheel????  Douglas

-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Pearless
Sent: Saturday, 2 October 2004 9:38 p.m.
To: 'Ethernut User Chat (English)'
Subject: RE: [En-Nut-Discussion] MMC Card interface to Ethernut

Hi actually to answer my own question, reading the fat.c code, I guess
something like:

NUTDEVICE devMMC = {
    0,                          /*!< Pointer to next device. */
    {'M', 'M', 'C', '0', 0, 0, 0, 0, 0},        /*!< Unique device name. */
    IFTYP_STREAM,               /*!< Type of device. Obsolete. */
    0,                          /*!< Base address. Unused. */
    0,                          /*!< First interrupt number. Unused. */
    0,                          /*!< Interface control block. Unused. */
    0,                          /*!< Driver control block. Unused. */
    0,                          /*!< Driver initialization routine. Not
supported. */
    0,                          /*!< Driver specific control function. Not
supported. */
    Read_MMC,                   /*!< Read data from a file. */
    Write_MMC,                  /*!< Write data to a file. */
#ifdef __HARVARD_ARCH__
    Write_MMC_P,                /*!< Write data from program space to a
file. */
#endif
    Open_MMC,                   /*!< Open a file. */
    Close_MMC,                  /*!< Close a file. */
    Size_MMC_file                    /*!< Return file size. */
};

And then implement the routines required.

In my previous post I should have said "CF and MMC card" not "CD and MMC
card", ah well must be late...

Douglas.

-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Pearless
Sent: Saturday, 2 October 2004 9:24 p.m.
To: 'Ethernut User Chat (English)'
Subject: RE: [En-Nut-Discussion] MMC Card interface to Ethernut

Hi,

I have found some code that works for a CD and MMC card, but it needs some
work to fix it up.

I have a general question. I assume it would be possible to extend Nut/OS so
that the MMC and CF cards can be used like any other block device (fopen,
fflush, fread. Fwrite, fclose), and included in the configurator, but I am
unsure how to extend the NutOS to do this, any pointers or ideas here?

I do not have unlimited time, and my first priority is my customer project
so currently I am using a fopen_mmc (etc) that I have created.

Douglas

-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Ole Reinhardt
Sent: Saturday, 2 October 2004 7:36 p.m.
To: Ethernut User Chat (English)
Subject: RE: [En-Nut-Discussion] MMC Card interface to Ethernut

Hi,

> What tools did you use to do that?

I've connected an sd / mmc cardreader to my linux box. On Linux the card
is shown as scsi interface (emulation). You can now use fdisk to create
a partition table and mkdosfs to create a filesystem in one of your
partitions. I also have a card with an ext2 filesystem created in the
same way.

Btw: If you'd like to implement fat16 why not directly fat32. I'll
search if i have some code you could use. Would be great to have a block
device i/o and file system functionality also for bigger devices on
NutOS (we could use the same code on a CF card too.)

-- 
kernel concepts    Tel: +49-271-771091-14
Dreisbachstr. 24   Fax: +49-271-771091-19
D-57250 Netphen    E+ : +49-177-7420433
--


_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.772 / Virus Database: 519 - Release Date: 1/10/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.772 / Virus Database: 519 - Release Date: 1/10/2004
 

_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.772 / Virus Database: 519 - Release Date: 1/10/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.772 / Virus Database: 519 - Release Date: 1/10/2004
 

_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.772 / Virus Database: 519 - Release Date: 1/10/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.772 / Virus Database: 519 - Release Date: 1/10/2004
 




More information about the En-Nut-Discussion mailing list