cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMx generates cmsis-v1 functions when using FATFS+FREERTOS cmsis-v2

Javier1
Principal

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?

we dont need to firmware by ourselves, lets talk
7 REPLIES 7
Ghofrane GSOURI
ST Employee

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

Thanks for giving it a look @Ghofrane GSOURI​ .

I made a video for you

https://youtu.be/vor4Cxj1LGw

also ,find attached my cubeMx file

we dont need to firmware by ourselves, lets talk
Ghofrane GSOURI
ST Employee

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

I dont think CubeIDE is the problem here, anyway, ill download the latest version and get back to you.

we dont need to firmware by ourselves, lets talk
Ghofrane GSOURI
ST Employee

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

@Ghofrane GSOURI​ I just downloaded the 1.10.1 CUbeIDE

0693W00000SunUJQAZ.png 0693W00000SunVqQAJ.pngAnd 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.

we dont need to firmware by ourselves, lets talk

the issue is not yet resolved

we dont need to firmware by ourselves, lets talk