STM32F407 每次用FATFS对SD卡进行读写操作后,想用PC查看SD卡内容都需要格式化SD卡

2019-07-20 07:36发布

本人用的板子是STM32F407的,每次用STM32的FATFS对SD卡进行读写操作后,想用PC查看SD卡上的txt文本,都会被要求格式化SD卡,求助各位大神原因是什么?FATFS对SD卡的读写操作正常。
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
7条回答
patrickliu
2019-07-20 09:56
SD卡格式化为FAT32格式,然后通过CUBE设置FATFS的各项参数,目前我用的是下面的设置情况,用f_read()和f_write()操作是没有问题的。
Version:
FATFS version R0.12c
Function Parameters:
FS_READONLY (Read-only mode) Disabled
FS_MINIMIZE (Minimization level) Disabled
USE_STRFUNC (String functions) Enabled with LF -> CRLF conversion
USE_FIND (Find functions) Disabled
USE_MKFS (Make filesystem function) Enabled
USE_FASTSEEK (Fast seek function) Enabled
USE_EXPAND (Use f_expand function) Disabled
USE_CHMOD (Change attributes function) Disabled
USE_LABEL (Volume label functions) Enabled *
USE_FORWARD (Forward function) Disabled
Locale and Namespace Parameters:
CODE_PAGE (Code page on target) Simplified Chinese (DBCS) *
USE_LFN (Use Long Filename) Enabled with dynamic working buffer on the STACK *
MAX_LFN (Max Long Filename) 255
LFN_UNICODE (Enable Unicode) ANSI/OEM
STRF_ENCODE (Character encoding) UTF-8
FS_RPATH (Relative Path) Disabled
Physical Drive Parameters:
VOLUMES (Logical drives) 1
MAX_SS (Maximum Sector Size) 512
MIN_SS (Minimum Sector Size) 512
MULTI_PARTITION (Volume partitions feature) Disabled
USE_TRIM (Erase feature) Disabled
FS_NOFSINFO (Force full FAT scan) 0
System Parameters:
FS_TINY (Tiny mode) Disabled
FS_EXFAT (Support of exFAT file system) Enabled *
FS_NORTC (Timestamp feature) Dynamic timestamp
NORTC_YEAR (Year for timestamp) 2015
NORTC_MON (Month for timestamp) 6
NORTC_MDAY (Day for timestamp) 4
FS_REENTRANT (Re-Entrancy) Disabled
FS_TIMEOUT (Timeout ticks) 1000
SYNC_t (O/S sync object) osSemaphoreId
FS_LOCK (Number of files opened simultaneously) 2

一周热门 更多>