9
0
Fork 0

Fix FAT32 bug

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1829 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2009-05-27 21:44:20 +00:00
parent 9a1ec9abe6
commit ca68e12516
5 changed files with 28 additions and 19 deletions

View File

@ -734,8 +734,14 @@
* examples/nsh: Added MMC/SD support for the LM3S6918
* arch/arm/src/lm3s: Fix logic for setting and clearing output GPIOs (critical
fix!).
* drivers/mmcsd: Found numerous errors in current MMC/SD SPI driver. Bad frequency
* drivers/mmcsd: Found numerous errors in current MMC/SD SPI driver. Bad frequency
calculation based on CSD settings, inappropriate timeouts, odd code that looks like
a bad search and replace. Also needs support for SDHC ver 2.x. New MMC/SD is
largely redesigned and probably non-functional in the first check-in.
* drivers/mmcsd: Changes verified on 4Gb Kingston SHDC card. Still having
issues with 2Gb SanDisk SDC card.
* fs/fat: With the 4Gb card, the first tests of FAT32 were (finally) performed.
Found a correct a problem that prevented use of FAT32: It was not updating
the sector cache before checking the FAT32 FSINFO sector.

View File

@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
<p>Last Updated: May 26, 2009</p>
<p>Last Updated: May 27, 2009</p>
</td>
</tr>
</table>
@ -1424,10 +1424,15 @@ nuttx-0.4.7 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* examples/nsh: Added MMC/SD support for the LM3S6918
* arch/arm/src/lm3s: Fix logic for setting and clearing output GPIOs (critical
fix!).
* drivers/mmcsd: Found numerous errors in current MMC/SD SPI driver. Bad frequency
* drivers/mmcsd: Found numerous errors in current MMC/SD SPI driver. Bad frequency
calculation based on CSD settings, inappropriate timeouts, odd code that looks like
a bad search and replace. Also needs support for SDHC ver 2.x. New MMC/SD is
largely redesigned and probably non-functional in the first check-in.
* drivers/mmcsd: Changes verified on 4Gb Kingston SHDC card. Still having
issues with 2Gb SanDisk SDC card.
* fs/fat: With the 4Gb card, the first tests of FAT32 were (finally) performed.
Found a correct a problem that prevented use of FAT32: It was not updating
the sector cache before checking the FAT32 FSINFO sector.
pascal-0.1.3 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;

View File

@ -10,7 +10,7 @@ NuttX TODO List (Last updated April 12, 2009)
(12) Network (net/, netutils/)
(1) USB (drivers/usbdev)
(4) Libraries (lib/)
(6) File system/Generic drivers (fs/, drivers/)
(7) File system/Generic drivers (fs/, drivers/)
(2) Graphics subystem (graphics/)
(1) Pascal add-on (pcode/)
(0) Documentation (Documentation/)
@ -289,11 +289,6 @@ o File system / Generic drivers (fs/, drivers/)
Priority: Low. I have mixed feelings about if NuttX should pay a
performance penalty for better data integrity.
Description: FAT: FAT32 is untested -- because I don't have any large
enough devices yet to support a FAT32 FS.
Status: Open
Priority: Medium
Description: The simple SPI based MMCS/SD driver in fs/mmcsd does not
yet handle multiple block transfers.
Status: Open

View File

@ -1575,7 +1575,6 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot)
result = mmcsd_sendcmd(slot, &g_cmd55, 0);
if (result == MMCSD_SPIR1_IDLESTATE || result == MMCSD_SPIR1_OK)
{
SPI_SEND(spi, 0xff);
result = mmcsd_sendcmd(slot, &g_acmd41, 0);
if (result == MMCSD_SPIR1_OK)
{
@ -1586,7 +1585,6 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot)
else
{
fvdbg("%d. Send CMD1\n", i);
SPI_SEND(spi, 0xff);
result = mmcsd_sendcmd(slot, &g_cmd1, 0);
if (result == MMCSD_SPIR1_OK)
{

View File

@ -262,15 +262,20 @@ static inline int fat_path2dirname(const char **path, struct fat_dirinfo_s *diri
static int fat_checkfsinfo(struct fat_mountpt_s *fs)
{
/* Verify that this is, indeed, an FSINFO sector */
/* Make sure that the fsinfo sector is in the cache */
if (FSI_GETLEADSIG(fs->fs_buffer) == 0x41615252 &&
FSI_GETSTRUCTSIG(fs->fs_buffer) == 0x61417272 &&
FSI_GETTRAILSIG(fs->fs_buffer) == BOOT_SIGNATURE32)
if (fat_fscacheread(fs, fs->fs_fsinfo) == OK)
{
fs->fs_fsinextfree = FSI_GETFREECOUNT(fs->fs_buffer);
fs->fs_fsifreecount = FSI_GETNXTFREE(fs->fs_buffer);
return OK;
/* Verify that this is, indeed, an FSINFO sector */
if (FSI_GETLEADSIG(fs->fs_buffer) == 0x41615252 &&
FSI_GETSTRUCTSIG(fs->fs_buffer) == 0x61417272 &&
FSI_GETTRAILSIG(fs->fs_buffer) == BOOT_SIGNATURE32)
{
fs->fs_fsinextfree = FSI_GETFREECOUNT(fs->fs_buffer);
fs->fs_fsifreecount = FSI_GETNXTFREE(fs->fs_buffer);
return OK;
}
}
return -ENODEV;
}
@ -697,7 +702,7 @@ int fat_mount(struct fat_mountpt_s *fs, boolean writeable)
ret = fat_checkfsinfo(fs);
if (ret != OK)
{
goto errout_with_buffer;
goto errout_with_buffer;
}
}