2022-08-12 01:04 AM
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?
2022-08-23 08:10 AM
Hello @Javier Muñoz
Issue reproduced using cubeMX 6.6.1 , stm32cubeIDE 1.10.1 and Nucleo-F767ZI , I added the two functions that you wrote above in the syscall.c and i clicked "Generate code " again nothing change the functions still there and cubeMX didn't overcome the two functions .
Can you please provide more details about the issue .
Ghofrane
2022-08-23 08:40 AM
Thanks for giving it a look @Ghofrane GSOURI .
I made a video for you
also ,find attached my cubeMx file
2022-08-24 01:06 AM
Good morning @Javier Muñoz
I recommend you to use stm32cubeide version 1.10.1
It is the latest version and your problem will be resolved
This is the link to download the latest version that i told you about
https://www.st.com/en/development-tools/stm32cubeide.html
Ghofrane
2022-08-24 01:13 AM
I dont think CubeIDE is the problem here, anyway, ill download the latest version and get back to you.
2022-09-07 03:44 AM
Hello @Javier Muñoz
If your issue is resolved, please close this post by clicking the "Select as Best" button on the previous answer. This will help other members of the community find this response more quickly.
Thanks for your contribution and do not hesitate to raise any issues or feedback.
Regards,
Ghofrane
2022-09-08 01:01 AM
@Ghofrane GSOURI I just downloaded the 1.10.1 CUbeIDE
And as i expected ,the issue is still there, this has nothing to do with the Cube IDE,
Same thing could be detected using a plain text editor.
When generating the boiler plate code wth CUBEMX , when freertosv2 is selected, CUBEMX uses old freertos v1 function definitions in syscall.c causing this error.
2022-09-08 01:02 AM
the issue is not yet resolved