I'm using the eZDSP5535 with the c55_csl_3.04 CSL and a 2GB microSD card from SanDisk. My code follows an example from the CSL. My SD card is only half full when the CSL throws an error at line 1289 in csl_mmcsd_atIf.c:
if((startSector > (hMmcSd->cardObj->totalSectors - 1)) ||
(sectorCount > validSectors))
{
ataResult = ATA_ERROR_INVALID_PARAM;
return (ataResult);
}
hMmcSd->cardObj->totalSectors is roughly half of that for gpstrAtaDrive->TotalSectors. I new to using an SD card. It appears to me that cardObj->blockLength being set 1024 instead of (the usual?) 512 may be the problem. As a quick check, I doubled the value of cardObj->totalSectors and was able to completely fill up the SD card.
I did have to comment out chk_mmc() since this line kept throwing an error with my Windows formatted FAT32 card.
if((sectors_in_partition_from_MBR+boot_record_sector)!=disk_sectors_from_csd)
mmcerror |= MMC_ERR_MBR_DSKSIZE_MISMATCH;
I would rather not override the CSL value for the total number of sectors. Am I doing something wrong somewhere? Is a sector always 512 bytes?
Thanks.