原因:由于freertos和Hal库版本不兼容问题导致的,使用CubeMa生成的函数会生成老版本的,所以需要改掉
int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create the sync object */
BYTE vol, /* Corresponding volume (logical drive number) */
_SYNC_t *sobj /* Pointer to return the created sync object */
)
{
int ret;
osSemaphoreDef(SEM);
/*
zyh HAL生成时新旧不兼容问题
*sobj = osSemaphoreCreate(osSemaphore(SEM), 1);
*/
//修改后
*sobj = osSemaphoreNew(1,1,osSemaphore(SEM));
ret = (*sobj != NULL);
return ret;
}
int ff_req_grant ( /* 1:Got a grant to access the volume, 0:Could not get a grant */
_SYNC_t sobj /* Sync object to wait */
)
{
int ret = 0;
/*
//zyh HAL生成时新旧不兼容问题
if(osSemaphoreWait(sobj, _FS_TIMEOUT) == osOK)
*/
//修改后
if(osSemaphoreAcquire(sobj, _FS_TIMEOUT) == osOK)
{
ret = 1;
}
return ret;
}
修改后编译通过
问题解决