Roman Kochkin

STM32CubeMX 4.23.0 sd_diskio.c template bug

Discussion created by Roman Kochkin on Dec 24, 2017
Latest reply on Dec 26, 2017 by Imen D

This template code will only work for the F7 series. Although for F4 there must be exactly the same initialization. And now the code for the fatfs sd card does not work on F4.

 

DSTATUS SD_initialize(BYTE lun)
{
[#if familyName="stm32h7"]  [#-- special code for H7... --]
 [#if use_rtos = 1]
  SD_CheckStatus(lun);

 

  if(Stat != STA_NOINIT)
  {
    /* Create SD operation Queue */
    osMessageQDef(SD_Queue, QUEUE_SIZE, uint16_t);
    SDQueueID = osMessageCreate (osMessageQ(SD_Queue), NULL);
  }

 

  return Stat;
 [#else]
 return SD_CheckStatus(lun);
 [/#if]
[#else]
  return SD_CheckStatus(lun);
[/#if]
}

Outcomes