Question
CubeMx generates cmsis-v1 functions when using FATFS+FREERTOS cmsis-v2
I am using cubeMX 6.6.1.
When selected FREERTOS cmsis-v2 and FATFS, everytime cubeMX generates code it oveerrides syscall.c with FREERTOS cmsis-v1 prototype funcions.
int ff_cre_syncobj ( /* TRUE:Function succeeded, FALSE:Could not create due to any error */
BYTE vol, /* Corresponding logical drive being processed */
_SYNC_t *sobj /* Pointer to return the created sync object */
)
{
int ret;
osSemaphoreDef(SEM);
//*sobj = osSemaphoreCreate(osSemaphore(SEM), 1);//cubeMX generates this
*sobj = osSemaphoreNew(1, 1, osSemaphore(SEM));///cmsis-v2 equivalent
ret = (*sobj != NULL);
return ret;
}int ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get a grant */
_SYNC_t sobj /* Sync object to wait */
)
{
int ret = 0;
//if(osSemaphoreWait(sobj, _FS_TIMEOUT) == osOK)
if(osSemaphoreAcquire(sobj, _FS_TIMEOUT) == osOK)
{
ret = 1;
}
return ret;
}
is there any way i could prevent cubeMX to override this two functions every time GENERATE CODE is clicked?
is this a cubeMX bug? or is it expected?