|
本帖最后由 YH_505 于 2023-8-5 17:05 编辑
stm32f103平台移植了fatfs R0.15, 官网代码: http://elm-chan.org/fsw/ff/00index_e.html
使能了 “ #define FF_FS_EXFAT 1”, 有如下奇怪现象:
1. f_mout() 正常
2. 创建文件, f_write() 正常
3. f_open() f_findfirst()正常
但是只要工程中f_read()参与编译,任意地方使用f_read(), 都会导致上述功能不正常
只要关闭FF_FS_EXFAT 支持, fatfs全部功能都正常,但是这样就无法支持大容量卡了
按理大牛的不应该有这样的问题, 附上
/*********************************************************************************************************************/
另外R0.15 版本提供了stm32的例程,使用IAR8.40.1时, 只能使用low以下优化,
使用midium、high优化等级, 会锁死在xchg_spi()处, 官方驱动好处时在批量读写时切换SPI为16bit模式,暂时未作深究
/* Exchange a byte */
static BYTE xchg_spi (
BYTE dat /* Data to send */
)
{
SPIx_DR = dat; /* Start an SPI transaction */
while ((SPIx_SR & 0x83) != 0x03) ; /* Wait for end of the transaction */
return (BYTE)SPIx_DR; /* Return received byte */
}
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|