cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in CubeMX with FATFS on SD-Card and FreeRTOS

andreasdrexel
Associate
Posted on February 16, 2016 at 14:58

The MX_FATFS_Init function is beeing called in the main function and again in the default task. After the second call the SD_Path is invalid. I'm using CubeMX 4.13.0 with the STM32F417IGH6, the configuration is in the attachments.

int main(void)

{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */

  HAL_Init();

  /* Configure the system clock */

  SystemClock_Config();

  /* Initialize all configured peripherals */

  MX_GPIO_Init();

  MX_DMA_Init();

  MX_SDIO_SD_Init();

 

MX_FATFS_Init();

 

...

/* StartDefaultTask function */

void StartDefaultTask(void const * argument)

{

  /* init code for FATFS */

 

MX_FATFS_Init();

  /* USER CODE BEGIN 5 */

  /* Infinite loop */

  for(;;)

  {

    osDelay(1);

  }

  /* USER CODE END 5 */ 

}

#bug #cubemx
5 REPLIES 5
Nesrine M_O
Lead II
Posted on February 16, 2016 at 18:22

Hi andi475,

I generate a project using the same settings as you (STM32CubeMx 4.13.0, FreeRTOS, SDIO, FATFS) and I don’t have such problem, the FATFS init function in called only one time in the StartDefaultTask.

So please try to generate a new project with MX, if the problem still exist, share your *.ioc file for check. 

-Syrine-

andreasdrexel
Associate
Posted on February 16, 2016 at 20:32

Hi Syrine,

Thanks for the fast response. I already tried deleting the old files and generating a new project. The ioc file is attached to my first post.

askari.nima
Associate II
Posted on February 16, 2016 at 21:19

this is a bug on stm32cube.

sdio_init , fatfs_init , usb_host_init function must be delete from main and call only on default task .
Nesrine M_O
Lead II
Posted on February 17, 2016 at 09:47

Hi,

I'll report this issue to our MX team for checking. Sorry for the inconvenience it may bring.

-Syrine-

stm32cube-t
Senior III
Posted on March 22, 2016 at 19:20

Dear user,

This is fixed in STM32CubeMX 4.13.1