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 CCS Technical Support

FAT32 problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Chawee
Guest







FAT32 problem
PostPosted: Sun Nov 25, 2007 10:15 am     Reply with quote

Hi,

i using the FAT and MMC/SD driver from CCS. The Fat-init is ok, also i can use the mmc/sd commands for example to read ot the card data. All this works fine. But if i try the "ex-fat.c" examples, nothing happend. I use the dir command but i only get the output " -/ "
Also all other examoles doesn´t work.
I using a 1 GB Kingston SD-CARD (FAT32 Format )and i put a few textfiles to the root.

Could anyone help me?

Chawee
Chawee
Guest







PostPosted: Tue Nov 27, 2007 12:27 am     Reply with quote

Hello,

no one have an idea, which could be my problem. My SD-CARD is formatted with 512Bytes Blocksize.
All the SD_CARD functions works probarly, only the fat makes problem. If i call the function for FAT Indformation, i only get zeros.

Please help me

Chawee
Evan
Guest







I thought is the CCSC fat.c question
PostPosted: Tue Nov 27, 2007 1:30 am     Reply with quote

I now also am and your similar question(I alone have tested mmcsd.c am do not have the question )
I thought is the CCSC fat.c->fat_init() error.Has not obtained bpbstart!!!
EX:CCSC LIBcode:
signed int fat_init()
{
:
:

// initialize the media
ec += mmcsd_init();
//******************************
!!!-->Must jump DBR ,==>obtained bpbstart!!!

Other examples :
bpbstart=0;
mmc_open_block(0x00000000);
mmc_skip(0xE3); //0xe3=227 X2=454 从主引导记录里读到分区的起始扇区(从这个地址读到逻辑地址的0扇区)
mmc_read();

bpbstart=((int16) data_hi<<8);
bpbstart+=data_lo;
mmc_cancel_block();

//------------BPB-------------FAT32---------------------------------------------
//bpbstart:256mb=101
mmc_open_block((int32) bpbstart); // 打开主引导区 //
mmc_skip(5);
mmc_read();
BPB_bytspersec=data_hi; //11 每扇区字节数
mmc_read();
BPB_bytspersec=BPB_bytspersec+((int16) data_lo<<8); //11.12
BPB_SecPerClus=data_hi; //13 每簇扇区数
mmc_read();
BPB_ResvdSecCnt=((int16) data_hi<<8)+data_lo; //14.15 保留扇区数,从DBR到FAT的扇区数


//********************************

// start filling up variables
ec += mmcsd_read_data(11, 2, &Bytes_Per_Sector);
ec += mmcsd_read_data(13, 1, &Sectors_Per_Cluster);
ec += mmcsd_read_data(14, 2, &Reserved_Sectors);
ec += mmcsd_read_data(16, 1, &FATs);
:
:
//************************************
I am sorry, my english is very poor
Evan 中国.
Chawe
Guest







PostPosted: Tue Nov 27, 2007 3:46 am     Reply with quote

Hi Evan,

i´m sorry, but i don´t understand what you want to tell me. I have to change something at the code?

Chawee
Evan
Guest







check entered into BPB zone
PostPosted: Tue Nov 27, 2007 11:40 pm     Reply with quote

Hi Chawe

I think the reason is that when FAT-INT() is running, it is still in MBR zone instead of BPB zone, so all the data you got are 0. Now what you have to do is check that if it has entered into BPB zone.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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