Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

MMC/SD support on LPC2000

MMC/SD support on LPC2000

2006-01-17 by Carsten Grøn

Hello,
I have some code running now on a Embedded Artists 2148 board that 
accesses a SD card (based on the philips code). So I can read/write 
individual sectors....
My plan is to use a SD card as a "circular" buffer for data, so I 
won't be using a real "file system" like FAT16 etc.
What I need now is a simple program (or some ideas for it) that can 
access a SD card when connected to a PC using "raw" sector access....
That way I will be able to read the data from the card when it is 
inserted in a card reader in a PC.

Any ideas/pointers ?

Regards,
Carsten

Re: [lpc2000] MMC/SD support on LPC2000

2006-01-17 by David Hawkins

Carsten Gr\ufffdn wrote:
> Hello,
> I have some code running now on a Embedded Artists 2148 board that 
> accesses a SD card (based on the philips code). So I can read/write 
> individual sectors....
> My plan is to use a SD card as a "circular" buffer for data, so I 
> won't be using a real "file system" like FAT16 etc.
> What I need now is a simple program (or some ideas for it) that can 
> access a SD card when connected to a PC using "raw" sector access....
> That way I will be able to read the data from the card when it is 
> inserted in a card reader in a PC.
> 
> Any ideas/pointers ?

If you are running Linux, you can always get direct access to
the device via eg. /dev/sda1 nodes (assuming here you stuck
the card in say a USB multi-card reader and it showed up as
/dev/sda, with /dev/sda1 being the first partition on that
device).

If you're on Windows, take a look at filedisk by Bo Brant\ufffdn, its
a utility for mounting devices much like the loopback device under
Linux. I've used it with Cygwin for dd'ing floppy images into fake
drives for booting vmware, and mounting iso's.

It should be low-level enough for you.

Here's a site with filedisk

http://www.insidewindows.info/

I'm not sure what Windows will do if you plug a device in that
has no file system, it'll probably offer to format it for you.
Helpful soul that it is ...

Dave

Re: [lpc2000] MMC/SD support on LPC2000

2006-01-17 by Tom Walsh

Carsten Gr\ufffdn wrote:

>Hello,
>I have some code running now on a Embedded Artists 2148 board that 
>accesses a SD card (based on the philips code). So I can read/write 
>individual sectors....
>My plan is to use a SD card as a "circular" buffer for data, so I 
>won't be using a real "file system" like FAT16 etc.
>What I need now is a simple program (or some ideas for it) that can 
>access a SD card when connected to a PC using "raw" sector access....
>That way I will be able to read the data from the card when it is 
>inserted in a card reader in a PC.
>
>Any ideas/pointers ?
>
>  
>
Linux (maybe Cygwin as well?): use dd command to suck in the drive 
contents: dd if=/dev/sda of=mySDcard.img

If you don't want the whole drive image, limit dd: dd if=/dev/sda 
of=mySDcard.img bs=512 count=100

That will read the first 100 sectors off the SD card.

Assuming, of course, you used an media reader of some kind and inserting 
the card mounted it as /dev/sda

TomW



>Regards,
>Carsten
>
>
>
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>  
>


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: MMC/SD support on LPC2000

2006-01-17 by Carsten Grøn

Thanks Dave,

I have looked at the filedisk program your mentioned, but I don't 
see (or more correctly, understand :-) how I can use that for 
accessing the individual sectors on the SD card ?
I'm also more after some "code snippets" that will allow me access 
to the SD cards sectors from within a C++ or C# application, 
basically what I would need, is just the "PC equivivalent" of the 
mmc_read_block() and mmc_write_block() in the Philips apps example 
code, that way my "PC log file displayer" application can just look 
at the SD card, and show the circular data (a large logfile) from 
the card...

Regards,
Carsten
Show quoted textHide quoted text
> 
> If you are running Linux, you can always get direct access to
> the device via eg. /dev/sda1 nodes (assuming here you stuck
> the card in say a USB multi-card reader and it showed up as
> /dev/sda, with /dev/sda1 being the first partition on that
> device).
> 
> If you're on Windows, take a look at filedisk by Bo Brantén, its
> a utility for mounting devices much like the loopback device under
> Linux. I've used it with Cygwin for dd'ing floppy images into fake
> drives for booting vmware, and mounting iso's.
> 
> It should be low-level enough for you.
> 
> Here's a site with filedisk
> 
> http://www.insidewindows.info/
> 
> I'm not sure what Windows will do if you plug a device in that
> has no file system, it'll probably offer to format it for you.
> Helpful soul that it is ...
> 
> Dave
>

Re: [lpc2000] MMC/SD support on LPC2000

2006-01-17 by Bertrik Sikken

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carsten Gr\ufffdn wrote:
> Hello,
> I have some code running now on a Embedded Artists 2148 board that
> accesses a SD card (based on the philips code). So I can read/write
> individual sectors....
> My plan is to use a SD card as a "circular" buffer for data, so I
> won't be using a real "file system" like FAT16 etc.
> What I need now is a simple program (or some ideas for it) that can
> access a SD card when connected to a PC using "raw" sector access....
> That way I will be able to read the data from the card when it is
> inserted in a card reader in a PC.
> 
> Any ideas/pointers ?

'/dev/sdx' filenames also work with cygwin, so you can do something
like this under cygwin:

dd if=/dev/sdg of=image.bin

There is not a simple relation between the /dev/sdx name and
the windows name as far as I can tell.

Bertrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDzVa6ETD6mlrWxPURAvW+AJ0XJpnI82q2qrZZ4GL9AGYpKYFjBwCdHZUU
yxeg4pxgFFLOjCeO1YaWghI=
=6qZp
-----END PGP SIGNATURE-----

Re: [lpc2000] Re: MMC/SD support on LPC2000

2006-01-17 by David Hawkins

> I have looked at the filedisk program your mentioned, but I don't 
> see (or more correctly, understand :-) how I can use that for 
> accessing the individual sectors on the SD card ?
> I'm also more after some "code snippets" that will allow me access 
> to the SD cards sectors from within a C++ or C# application, 
> basically what I would need, is just the "PC equivivalent" of the 
> mmc_read_block() and mmc_write_block() in the Philips apps example 
> code, that way my "PC log file displayer" application can just look 
> at the SD card, and show the circular data (a large logfile) from 
> the card...

I would just try it and see. Install Cygwin, and then install your
USB card reader with SD card installed. Try and figure out if
the /dev/sdX nodes are created. Sorry, I'm not sure what the
Cygwin command might be ...

To read binary data:

   int fd, len;
   char buf[10];

   fd = open("/dev/sda1", O_RDONLY);
   if (fd < 0) {
     printf("open failed\n");
     return -1;
   }
   len = read(fd, buf, 10);
   if (len < 0) {
     printf("read failed\n");
     close(fd);
     return -1;
   }

   ... mess with your data ...

Cheers
Dave

Re: MMC/SD support on LPC2000

2006-01-17 by Carsten Grøn

Sometimes I wish I was working under Linux :-)

Unfortunately, the people that is going to read the SD cards are not 
running Linux/Cygwin etc on their PC's, so my only option is to have 
something working under Windoze !

I will see if I can come up woth something for this, although (as 
usual) deadline is coming fast......

Regards,
Carsten


--- In lpc2000@yahoogroups.com, Bertrik Sikken <bertrik@z...> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Carsten Grøn wrote:
> > Hello,
> > I have some code running now on a Embedded Artists 2148 board 
that
> > accesses a SD card (based on the philips code). So I can 
read/write
> > individual sectors....
> > My plan is to use a SD card as a "circular" buffer for data, so I
> > won't be using a real "file system" like FAT16 etc.
> > What I need now is a simple program (or some ideas for it) that 
can
> > access a SD card when connected to a PC using "raw" sector 
access....
Show quoted textHide quoted text
> > That way I will be able to read the data from the card when it is
> > inserted in a card reader in a PC.
> > 
> > Any ideas/pointers ?
> 
> '/dev/sdx' filenames also work with cygwin, so you can do something
> like this under cygwin:
> 
> dd if=/dev/sdg of=image.bin
> 
> There is not a simple relation between the /dev/sdx name and
> the windows name as far as I can tell.
> 
> Bertrik
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFDzVa6ETD6mlrWxPURAvW+AJ0XJpnI82q2qrZZ4GL9AGYpKYFjBwCdHZUU
> yxeg4pxgFFLOjCeO1YaWghI=
> =6qZp
> -----END PGP SIGNATURE-----
>

Re: MMC/SD support on LPC2000

2006-01-17 by donhamilton2002

--- In lpc2000@yahoogroups.com, Carsten Grøn <cgroen@m...> wrote:
>
> Thanks Dave,
> 
> I have looked at the filedisk program your mentioned, but I don't 
> see (or more correctly, understand :-) how I can use that for 
> accessing the individual sectors on the SD card ?
> I'm also more after some "code snippets" that will allow me access 
> to the SD cards sectors from within a C++ or C# application, 
> basically what I would need, is just the "PC equivivalent" of the 
> mmc_read_block() and mmc_write_block() in the Philips apps example 
> code, that way my "PC log file displayer" application can just look 
> at the SD card, and show the circular data (a large logfile) from 
> the card...
> 
> Regards,
> Carsten
> 

"code snippets" assume that Windows knows how to use the media.
No program will be able to access that media until windows is happy.

Fooling Windows is what your looking for.

"filedisk" may be able to do that.


hamilton

Re: [lpc2000] MMC/SD support on LPC2000

2006-01-17 by Jaromir Subcik

Hi Carsten,
one possibility is to write one long defragmented file with a 512 (one
sector) unique bytes as starting symbol to SD card using standard card
reader on PC. This is easy task - erase (better quick format) entire SD card
and write prepared file.
On your board you can only find start of this file - read sectors from
begining until you find starting sequence and next sector is basic adress
for your buffer.
On PC you can simply read this file.
Sorry, I forgot how this metod calls - it is not sclerosis but my inability
;-)

Jarda
Show quoted textHide quoted text
----- Original Message -----
From: Carsten Gr\ufffdn
To: lpc2000@yahoogroups.com
Sent: Tuesday, January 17, 2006 9:07 PM
Subject: [lpc2000] MMC/SD support on LPC2000


Hello,
I have some code running now on a Embedded Artists 2148 board that
accesses a SD card (based on the philips code). So I can read/write
individual sectors....
My plan is to use a SD card as a "circular" buffer for data, so I
won't be using a real "file system" like FAT16 etc.
What I need now is a simple program (or some ideas for it) that can
access a SD card when connected to a PC using "raw" sector access....
That way I will be able to read the data from the card when it is
inserted in a card reader in a PC.

Any ideas/pointers ?

Regards,
Carsten

Re: MMC/SD support on LPC2000

2006-01-17 by Carsten Grøn

Hi Jarda,

yes, I also thought about that idea, only problem is that the card 
needs to be prepared on a PC, but I might be able to live with 
that....Guess it's a kind of "poor mans filesystem" :-)

I have found some information regarding direct disk access, and it 
should be perfectly possible from WinXP/2K...but the "one fixed file 
method" you describe might turn out to be easier overall....

Thanks,
Carsten


--- In lpc2000@yahoogroups.com, "Jaromir Subcik" <subcik@s...> wrote:
>
> Hi Carsten,
> one possibility is to write one long defragmented file with a 512 
(one
> sector) unique bytes as starting symbol to SD card using standard 
card
> reader on PC. This is easy task - erase (better quick format) 
entire SD card
> and write prepared file.
> On your board you can only find start of this file - read sectors 
from
> begining until you find starting sequence and next sector is basic 
adress
> for your buffer.
> On PC you can simply read this file.
> Sorry, I forgot how this metod calls - it is not sclerosis but my 
inability
Show quoted textHide quoted text
> ;-)
> 
> Jarda
>

Re: MMC/SD support on LPC2000

2006-01-17 by Carsten Grøn

Yup,

if that works, it is sure simple ! 
The only problem is that I would really hate (and so would the 
people using the PC software) to install lotsa software to use that 
feature (cygwin etc)....

Regards,
Carsten


--- In lpc2000@yahoogroups.com, David Hawkins <dwh@o...> wrote:
Show quoted textHide quoted text
>> 
> I would just try it and see. Install Cygwin, and then install your
> USB card reader with SD card installed. Try and figure out if
> the /dev/sdX nodes are created. Sorry, I'm not sure what the
> Cygwin command might be ...
> 
> To read binary data:
> 
>    int fd, len;
>    char buf[10];
> 
>    fd = open("/dev/sda1", O_RDONLY);
>    if (fd < 0) {
>      printf("open failed\n");
>      return -1;
>    }
>    len = read(fd, buf, 10);
>    if (len < 0) {
>      printf("read failed\n");
>      close(fd);
>      return -1;
>    }
> 
>    ... mess with your data ...
> 
> Cheers
> Dave
>

Re: [lpc2000] Re: MMC/SD support on LPC2000

2006-01-17 by David Hawkins

> I would just try it and see. 

Indeed it works.

I just plugged in a USB camera that appears as a USB mass
storage device

dd bs=512 count=1 if=/dev/sdb of=tmp.img

worked, and if I removed the device, it gave an error.

Seems good to me.

Dave

Re: [lpc2000] MMC/SD support on LPC2000

2006-01-17 by Sean

I get really tired of everyone bashing windows all the time... :)  Isn't it 
interesting how 4x the number of bugs are found in linux than windows?  But 
I digress...

Check out WinHex, it can directly access any fixed media device at a raw level.

Alternatively, if you aren't afraid of a little programming, you can easily 
open any raw device and seek to any sector and read/write to your hearts 
content with only a few lines of standard C code.  Windows has just as 
robust an addressing system as linux does under the /dev/ filesystem, if 
anything windows has even more, do a google search on the \\?\ prefix.  No 
fooling of windows is necessary to make this happen.

-- Sean

At 03:07 PM 1/17/2006, you wrote:
Show quoted textHide quoted text
>Hello,
>I have some code running now on a Embedded Artists 2148 board that
>accesses a SD card (based on the philips code). So I can read/write
>individual sectors....
>My plan is to use a SD card as a "circular" buffer for data, so I
>won't be using a real "file system" like FAT16 etc.
>What I need now is a simple program (or some ideas for it) that can
>access a SD card when connected to a PC using "raw" sector access....
>That way I will be able to read the data from the card when it is
>inserted in a card reader in a PC.
>
>Any ideas/pointers ?
>
>Regards,
>Carsten

Re: [lpc2000] Re: MMC/SD support on LPC2000

2006-01-17 by Tom Walsh

Carsten Gr\ufffdn wrote:

>Hi Jarda,
>
>yes, I also thought about that idea, only problem is that the card 
>needs to be prepared on a PC, but I might be able to live with 
>that....Guess it's a kind of "poor mans filesystem" :-)
>
>I have found some information regarding direct disk access, and it 
>should be perfectly possible from WinXP/2K...but the "one fixed file 
>method" you describe might turn out to be easier overall....
>
>  
>
His idea is not too bad.  blank an SD card with quick format,  that will 
erase the FAT table.  Then create a file the size of your buffer.  In 
your embedded system, read the partition table, MSDOS boot block and 
root directory to locate your file start cluster.  Then deblock from 
there from cluster to sector.  Be carefull of fragmentation, Microsoft 
loves to fragment files!

Of course, then you have the idiot (that's the guy that refuses to 
RTFM)  out in the field that wants to add / delete files on the SD card...

TomW

-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: [lpc2000] Re: MMC/SD support on LPC2000

2006-01-17 by David Hawkins

Carsten Gr\ufffdn wrote:
> Yup,
> 
> if that works, it is sure simple ! 
> The only problem is that I would really hate (and so would the 
> people using the PC software) to install lotsa software to use that 
> feature (cygwin etc)....

There's nothing special about the Cygwin technique, it
just uses the standard Linux tools. Under the hood its using a
Windows call ...

http://disktype.sourceforge.net/doc/ch01s04.html

Windows name: \\.\PHYSICALDRIVE2

so ...

   HANDLE h = CreateFile("\\\\.\\PHYSICALDRIVE2" ...

or whatever the Windows device names are.

Take a look around Microsoft for 'raw device access' or something
like that.

Dave

Re: MMC/SD support on LPC2000

2006-01-17 by Carsten Grøn

Hi Sean,
you're absolutely right !
If I were to suggest the people that is going to read the log data 
from this SD card, that they install Linux (or some other 
derivative), they would just look at me, and ask, WHAT ?
So, only option is to use Windows (which I absolutely don't mind, 
having 7 WinXP PC's in the house here :-)
I just realized that CreateFile can do all the magic, direct disk 
access and pretty much anything else !
(http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/fileio/fs/createfile.asp)

So this is the route I will take, definately,

thanks for the heads-up Sean

Carsten


--- In lpc2000@yahoogroups.com, Sean <embeddedrelated@w...> wrote:
>
> 
> I get really tired of everyone bashing windows all the time... :)  
Isn't it 
> interesting how 4x the number of bugs are found in linux than 
windows?  But 
> I digress...
> 
> Check out WinHex, it can directly access any fixed media device at 
a raw level.
> 
> Alternatively, if you aren't afraid of a little programming, you 
can easily 
> open any raw device and seek to any sector and read/write to your 
hearts 
> content with only a few lines of standard C code.  Windows has 
just as 
> robust an addressing system as linux does under the /dev/ 
filesystem, if 
> anything windows has even more, do a google search on the \\?\ 
prefix.  No 
Show quoted textHide quoted text
> fooling of windows is necessary to make this happen.
> 
> --

Re: [lpc2000] MMC/SD support on LPC2000

2006-01-17 by Sean

This may be a stupid question, why not just use a file system?  I believe 
that there is some code available for FAT file system access on SD/MMC for 
LPC series, wouldn't that make things a lot easier?  This way you can use 
any existing application without any special need for programming or 
unix-style commands.

-- Sean

At 03:07 PM 1/17/2006, you wrote:
Show quoted textHide quoted text
>Hello,
>I have some code running now on a Embedded Artists 2148 board that
>accesses a SD card (based on the philips code). So I can read/write
>individual sectors....
>My plan is to use a SD card as a "circular" buffer for data, so I
>won't be using a real "file system" like FAT16 etc.
>What I need now is a simple program (or some ideas for it) that can
>access a SD card when connected to a PC using "raw" sector access....
>That way I will be able to read the data from the card when it is
>inserted in a card reader in a PC.
>
>Any ideas/pointers ?
>
>Regards,
>Carsten
>
>
>
>
>
>SPONSORED LINKS
><http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC-J9hJ5qyXg0WPR0l6g>Microprocessor 
><http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq01nxwg>Microcontrollers 
><http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c6LyBvUqVQ>Pic 
>microcontrollers
><http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVIlekkDP-A>8051 
>microprocessor
>
>
>----------
>YAHOO! GROUPS LINKS
>
>    *  Visit your group "<http://groups.yahoo.com/group/lpc2000>lpc2000" 
> on the web.
>    *
>    *  To unsubscribe from this group, send an email to:
>    * 
> <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>lpc2000-unsubscribe@yahoogroups.com 
>
>    *
>    *  Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------

Re: MMC/SD support on LPC2000

2006-01-17 by Carsten Grøn

Sean, 
the reason (for me) would be that it would be simpler on the LPC 
board, no need for FAT etc (I'm actually also looking into prllc's FAT 
implementation with SD support at $139,- which I think is very 
reasonable). Also I'm a little worried that the card will be "killed" 
by problems with write-endurance (if using FAT, the FAT tables are 
written very often), and if used as a circular buffer, each sector 
will be written (relatively) seldom.

Regards,
Carsten


--- In lpc2000@yahoogroups.com, Sean <embeddedrelated@w...> wrote:
>
> 
> This may be a stupid question, why not just use a file system?  I 
believe 
> that there is some code available for FAT file system access on 
SD/MMC for 
> LPC series, wouldn't that make things a lot easier?  This way you 
can use 
Show quoted textHide quoted text
> any existing application without any special need for programming or 
> unix-style commands.
> 
> -- Sean
>

Re: [lpc2000] Re: MMC/SD support on LPC2000

2006-01-17 by David Hawkins

Carsten Gr\ufffdn wrote:
> Sean, 
> the reason (for me) would be that it would be simpler on the LPC 
> board, no need for FAT etc (I'm actually also looking into prllc's FAT 
> implementation with SD support at $139,- which I think is very 
> reasonable). Also I'm a little worried that the card will be "killed" 
> by problems with write-endurance (if using FAT, the FAT tables are 
> written very often), and if used as a circular buffer, each sector 
> will be written (relatively) seldom.
> 
> Regards,
> Carsten

Perhaps you could get the best of both worlds. Format the card with
a FAT file system containing one large file. If the micro only writes
bytes within that file, and the format is understood within that
file by both the micro, and the Windows app. the OS need only
know that there is a file there, not how to interpret it.

The circular buffering will just occur within the large binary
area that is 'the file'.

Dave

Re: MMC/SD support on LPC2000

2006-01-17 by Carsten Grøn

Dave,
yes, that would possibly "fix" both problems, the "FAT data" is just 
a "tool" for the PC afterwards to get to the data (as a file), and 
the processor would still be able to access the card as a "circular 
type" of memory. And as the file is fixed in size, there is no need 
to write to the "FAT table" on the card. Might do the trick !

Thanks,
Carsten

--- In lpc2000@yahoogroups.com, David Hawkins <dwh@o...> wrote:
>
> Carsten Grøn wrote:
> > Sean, 
> > the reason (for me) would be that it would be simpler on the LPC 
> > board, no need for FAT etc (I'm actually also looking into 
prllc's FAT 
> > implementation with SD support at $139,- which I think is very 
> > reasonable). Also I'm a little worried that the card will 
be "killed" 
> > by problems with write-endurance (if using FAT, the FAT tables 
are 
> > written very often), and if used as a circular buffer, each 
sector 
> > will be written (relatively) seldom.
> > 
> > Regards,
> > Carsten
> 
> Perhaps you could get the best of both worlds. Format the card with
> a FAT file system containing one large file. If the micro only 
writes
Show quoted textHide quoted text
> bytes within that file, and the format is understood within that
> file by both the micro, and the Windows app. the OS need only
> know that there is a file there, not how to interpret it.
> 
> The circular buffering will just occur within the large binary
> area that is 'the file'.
> 
> Dave
>

Re: [lpc2000] Re: MMC/SD support on LPC2000

2006-01-17 by Sean

IIRC Tom Walsh has a FAT implementation working with source code for free 
on the LPC series.  You could pretty easily modify it to NOT update the 
date/time in the fat table whenever you write to the file, meaning that you 
won't kill the area where teh FAT table is if you update it 
frequently.  Then you can easily setup a ring buffer in a file on the 
device, and it should be pretty easy to access and still give you the 
flexibility of having a recognized filesystem on a PC.  If not Tom, then 
there are a few other implementations available that will work fine for 
your simple application.

-- Sean

At 04:27 PM 1/17/2006, you wrote:
Show quoted textHide quoted text
>Sean,
>the reason (for me) would be that it would be simpler on the LPC
>board, no need for FAT etc (I'm actually also looking into prllc's FAT
>implementation with SD support at $139,- which I think is very
>reasonable). Also I'm a little worried that the card will be "killed"
>by problems with write-endurance (if using FAT, the FAT tables are
>written very often), and if used as a circular buffer, each sector
>will be written (relatively) seldom.
>
>Regards,
>Carsten
>
>
>--- In lpc2000@yahoogroups.com, Sean <embeddedrelated@w...> wrote:
> >
> >
> > This may be a stupid question, why not just use a file system?  I
>believe
> > that there is some code available for FAT file system access on
>SD/MMC for
> > LPC series, wouldn't that make things a lot easier?  This way you
>can use
> > any existing application without any special need for programming or
> > unix-style commands.
> >
> > -- Sean
> >
>
>
>
>
>
>----------
>YAHOO! GROUPS LINKS
>
>    *  Visit your group "<http://groups.yahoo.com/group/lpc2000>lpc2000" 
> on the web.
>    *
>    *  To unsubscribe from this group, send an email to:
>    * 
> <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>lpc2000-unsubscribe@yahoogroups.com 
>
>    *
>    *  Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------

Re: [lpc2000] Re: MMC/SD support on LPC2000

2006-01-17 by Sean

Except that the FAT table is usually updated on every write for the 
last-accessed and/or last-written fields.  But if you can get source code 
for a filesystem layer then you should be able to modify it to remove that 
update.

-- Sean

At 04:36 PM 1/17/2006, you wrote:
Show quoted textHide quoted text
>Carsten Grøn wrote:
> > Sean,
> > the reason (for me) would be that it would be simpler on the LPC
> > board, no need for FAT etc (I'm actually also looking into prllc's FAT
> > implementation with SD support at $139,- which I think is very
> > reasonable). Also I'm a little worried that the card will be "killed"
> > by problems with write-endurance (if using FAT, the FAT tables are
> > written very often), and if used as a circular buffer, each sector
> > will be written (relatively) seldom.
> >
> > Regards,
> > Carsten
>
>Perhaps you could get the best of both worlds. Format the card with
>a FAT file system containing one large file. If the micro only writes
>bytes within that file, and the format is understood within that
>file by both the micro, and the Windows app. the OS need only
>know that there is a file there, not how to interpret it.
>
>The circular buffering will just occur within the large binary
>area that is 'the file'.
>
>Dave

Re: [lpc2000] MMC/SD support on LPC2000

2006-01-19 by Hans Van Ingelgom

--- Sean <embeddedrelated@...> wrote:

> 
> I get really tired of everyone bashing windows all
> the time... :)  Isn't it 
> interesting how 4x the number of bugs are found in
> linux than windows?  But 
> I digress...

Weren't there some issues with patents on the FAT file
system recently? Here's a link:
http://www.eweek.com/article2/0,1895,1909857,00.asp
So I can really understand why people are looking at
alternatives to FAT at the moment.

----
PS: a quick rebuttal of your digression (sorry, but if
I don't respond people might get FUD'ed): Linux is a
complete system, e.g. Debian has over 9000 packages.
The base system hardly has any bugs. I'm using Debian
exclusively for more than 3 years, and I can't say I
have had many security issues since. 95% of the
security reports I receive involve packages I haven't
got installed. I never got a virus, never found a
root-kit (I check for that regulary), and I have a 3
year old system that I never had to re-install
(upgrades just work(tm)). There were about 2-3
packages I had to upgrade specifically because of
security fixes, and it was a breeze (i.e. it works
just like a regular upgrade). End of rebuttal of
digression. Please don't reply any further (IMO, you
already went too far/OT with your first comment).

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

Re: [lpc2000] Re: MMC/SD support on LPC2000

2006-01-19 by clemens fischer

> Carsten Gr\ufffdn:

> If I were to suggest the people that is going to read the log data
> from this SD card, that they install Linux (or some other derivative),
> they would just look at me, and ask, WHAT ?

"cygwin" isn't a complete operating system, it's a window$ native
implementation of most POSIX calls running off a DLL. this is to be able
to use "unix"-like tools and make programs the "unix" way, isolated from
the abyss of window$-APIs.

your customer would see a native window$ program.

  clemens

Re: MMC/SD support on LPC2000

2006-01-19 by Carsten Grøn

Hi Clemens,

yes I know, you're right.
Generally I simply just hate to install (or demand from 
users) "extra" stuff in order to use some command tool, I need to 
make a "simple application", that is self-contained (I know, it uses 
a zillion DLL's from the operating system....) instead of installing 
all kinds of software.

Now for something completely OT for this forum :-)

I have been making PC programs since the good old CPM days (for 22 
years now), been thru OS/2 and all the windows versions, and I have 
to say, I don't miss the old days ! It's never been more stable and 
easy to make software than it is today. I know, its also never been 
more complicated than it is today, but you have to pay a price for 
all the features you get. Part of that is due to Mr. Gates and 
Microsoft.
I take my hat of to those how uses Linux and experiments with it, 
however, I could not see myself use Linux as a developer, at least 
not with the things I do for a living, it would simply be a problem 
with tools (FPGA designs etc etc) and my productivity would suffer.

Now I might be completely ignorant and wrong about this, but this is 
how I see it :-)

Don't flame me........

Regards,
Carsten




--- In lpc2000@yahoogroups.com, clemens fischer <ino-qc@s...> wrote:
>
> > Carsten Grøn:
> 
> > If I were to suggest the people that is going to read the log 
data
> > from this SD card, that they install Linux (or some other 
derivative),
> > they would just look at me, and ask, WHAT ?
> 
> "cygwin" isn't a complete operating system, it's a window$ native
> implementation of most POSIX calls running off a DLL. this is to 
be able
> to use "unix"-like tools and make programs the "unix" way, 
isolated from
Show quoted textHide quoted text
> the abyss of window$-APIs.
> 
> your customer would see a native window$ program.
> 
>   clemens
>

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.