Skip to main content
bernd2
Visitor II
March 17, 2016
Question

STM32Cube FatFS FreeRTOS double generated init code

  • March 17, 2016
  • 1 reply
  • 642 views
Posted on March 17, 2016 at 15:55

STM32Cube_FW_F4_V1.11.0

 I have enabled 3 FATFS: SDRAM, SRAM and SDCard

Bug 1: Using FreeRTOS and FATFS and USB-Desice on stm32F429

double

generates   MX_FATFS_Init();  MX_USB_DEVICE_Init();

in ''main()'' and in Task ''void StartDefaultTask(void const * argument)''

- one time would be enough

==> 2 calls of MX_FATFS_Init() ==>  6 calls of ''FATFS_LinkDriverEx()'' in ''ff_gen_drv.c''

Bug2: Array check in FATFS_LinkDriverEx in ''ff_gen_drv.c'':

 the array[_VOLUMES] index test in Line 55 is 

    if(disk.nbr <= _VOLUMES)

correct is

  if(disk.nbr < _VOLUMES) 

Result: Access behind the Array is made --> System overrides nextVariables and crashes some times later.

#!bug #!stm32-!cubemx
    This topic has been closed for replies.

    1 reply

    stm32cube-t
    ST Employee
    October 6, 2016
    Posted on October 06, 2016 at 17:39

    Dear user,

    The issue is known and logged against STM32Cube firmware package on ff_gen_drv.c but has not been fixed yet.

    Best regards