CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

128MB SD card how to partition it to 4 X 32MB
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

PostPosted: Thu May 13, 2004 1:25 pm     Reply with quote

Ttelmah wrote:
ckielstra wrote:
Sorry, still no answer on how to partition.... but maybe you can look at your problem in another way? Do you need different partitions? Next year 128MB cards will be the standard, are you going to create even more partitions then?

Sandisk MMC cards are manufactored with two partitions, don't know for SD cards or other brands.

On SD and MMC cards you don't specify the address by a sectornr. + offset, but by a linear 32-bit address. So instead of a maximum of 32MB you have an internal maximum of 4GB. Why stick to the FAT16? You can also use FAT32. Or if you are never going to read the card from a standard PC you can create your own file system...

From other posts I've learned that implementing FAT16 on a PIC will take about 10k of code space. Your own dedicated file system might be much smaller.


The other way to go, is to split the disk on a PocketPC. FlashFormat can definately do this on these devices.
The failure of PM to handle the drive, is down to the adapter used. I have four different adapters that talk to these drives (one a PCMCIA card, a couple of USB ones, and a couple of other 'odd' devices like an HP printer). On the PCMCIA device, PM sees all the drives. On the HP printer, it sees none. On one of the USB devices it sees them all, while on the other it only sees the CF slot, and not the SD one!...

Best Wishes


Well that's correct and I'm being lazy... Someone sent me code to read/write FAT16 ...
I looked at FAT32 and the mess with long file names does not look interesting at all...
I would like to be able to read the SD card on a PC and not have to read it in the device and sent it to the PC, otherwise linear addressing would be an option.

I'll just have to get a 32meg card and take it from there...
Hans Wedemeyer



Joined: 15 Sep 2003
Posts: 226

View user's profile Send private message

PostPosted: Thu May 13, 2004 1:27 pm     Reply with quote

Ttelmah wrote:
ckielstra wrote:
Sorry, still no answer on how to partition.... but maybe you can look at your problem in another way? Do you need different partitions? Next year 128MB cards will be the standard, are you going to create even more partitions then?

Sandisk MMC cards are manufactored with two partitions, don't know for SD cards or other brands.

On SD and MMC cards you don't specify the address by a sectornr. + offset, but by a linear 32-bit address. So instead of a maximum of 32MB you have an internal maximum of 4GB. Why stick to the FAT16? You can also use FAT32. Or if you are never going to read the card from a standard PC you can create your own file system...

From other posts I've learned that implementing FAT16 on a PIC will take about 10k of code space. Your own dedicated file system might be much smaller.


The other way to go, is to split the disk on a PocketPC. FlashFormat can definately do this on these devices.
The failure of PM to handle the drive, is down to the adapter used. I have four different adapters that talk to these drives (one a PCMCIA card, a couple of USB ones, and a couple of other 'odd' devices like an HP printer). On the PCMCIA device, PM sees all the drives. On the HP printer, it sees none. On one of the USB devices it sees them all, while on the other it only sees the CF slot, and not the SD one!...

Best Wishes


Well that's correct and I'm being lazy... Someone sent me code to read/write FAT16 ...
I looked at FAT32 and the mess with long file names does not look interesting at all...
I would like to be able to read the SD card on a PC and not have to read it in the device and sent it to the PC, otherwise linear addressing would be an option.

I'll just have to get a 32meg card and take it from there...
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Fri May 14, 2004 7:13 am     Reply with quote

A FAT16 drive can contain up to 4 partitions. The master boot record (the first sector of 512 bytes) can have a partition table of up to 4 entries of 16 bytes each. The issue is it is nice to stay with 512 byte sector since a write modify to an SD card requires reading in the block first so 512 bytes of RAM is needed If the format sector size is also 512 this makes for easier coding. Further FAT 16 is a messy design but FAT32 is even more to chew on and with limited ROM space in the PIC it is not the first choice.

FDisk is the softee way to build the partion table....now hard disks are accessed early in the bios and are visible in DOS via int13. An SD card attached to a USB controller is another matter. So FDISK won't see the SD card. Even if the partion table was put on the SD card I suspect it would not be handled by the SD driver in windows. The softee view of SD cards was probably just bigger floppies and floppies weren't partitioned..since larger cards (32mb plus) can be accessed using FAT32 they took the "why bother" approach. It might not be too hard to add the extended DOS partion table and logic on the PIC side but only the first partition I suspect will ever be readable in Windows.
Guest








PostPosted: Fri May 14, 2004 2:22 pm     Reply with quote

Thanks for the heads up.
Seems like I'll have to bit the bullet and do everything FAT32.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group