Skip to main content
andreasdrexel
Associate
February 16, 2016
Question

Bug in CubeMX with FATFS on SD-Card and FreeRTOS

  • February 16, 2016
  • 5 replies
  • 3094 views
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
This topic has been closed for replies.

5 replies

Nesrine M_O
Associate
February 16, 2016
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
February 16, 2016
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 III
February 16, 2016
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
Associate
February 17, 2016
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
ST Employee
March 22, 2016
Posted on March 22, 2016 at 19:20

Dear user,

This is fixed in STM32CubeMX 4.13.1