[En-Nut-Discussion] Problems with PHAT on MMC with ethernut 3, NutOS 4.4.0
Ole Reinhardt
ole.reinhardt at embedded-it.de
Tue Feb 12 15:42:36 CET 2008
Hi,
> > mmc_volume = _open("MMC0:1/PHAT0", _O_RDWR | _O_BINARY);
> >
> > later closed with:
> >
> > _close(mmc_volume);
>
> Any reason for not leaving it open? I'm not sure about closing volumes.
Not realy. Just in case the buffers need to be flushed befor powering
off. But looking into the code tells me that only memory is freed when
closing the volume. So not necessary at all.
> > Which meens that I only get the . and .. entry even if the directory is
> > full with files.
>
> You mean full of files
> 1. created by Nut/OS
> or
> 2. created on another computer?
Full of files created by another computer.
> In case 1 the card may have been removed without flushing the buffer
> contents. In case 2 there might be a format incompatibility (although I
> never saw any MMC with FAT not readable by Nut/OS).
I created the file system by my own with mkfs.vfat on my linux
workstation. Before creating the fat filesystem the mmc card was
formated with other filesystems (FAT as well as EXT2 / EXT3)
>
> > Trying to create a new directory corrupts the filesystem. Here is my code:
> >
> > if (mkdir(dirname, 0755) != 0) {
> > ERROR("Could not create directory %s : error %d\r\n", dirname, errno);
> > }
>
> I'm sure it won't. Did you try the ftpserv sample?
Not yet. This will be my next task for this evening.
> Even this sample is quite complex and not really usable for bug
> approval. Can you please send a stripped down sample via private email?
> I'll also send a small test application directly to you.
Shure I'll do this evening.
> > Complete test code can be provided!
>
> See above. But please keep it as simple as possible.
Shure. I'll strip it down to just a few lines of the file system access
functions.
Bye,
Ole
--
_____________________________________________________________
| |
| Embedded-IT Hard- und Softwarelösungen |
| |
| Ole Reinhardt Tel. / Fax: +49 (0)271 7420433 |
| Luisenstraße 29 Mobil: +49 (0)177 7420433 |
| 57076 Siegen eMail: ole.reinhardt at embedded-it.de |
| Germany Web: http://www.embedded-it.de |
| UstID / VAT: DE198944716 |
|_____________________________________________________________|
More information about the En-Nut-Discussion
mailing list