Skip to main content
stm322
Associate III
March 5, 2009
Question

Is there a problem with the FIFO of the SDIO?

  • March 5, 2009
  • 2 replies
  • 994 views
Posted on March 05, 2009 at 23:01

Is there a problem with the FIFO of the SDIO?

    This topic has been closed for replies.

    2 replies

    stm322
    stm322Author
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:05

    Hello,

    Could somebody confirm or explain where I am wrong with the following problem on a STM32F103ZET6 ?

    1 – Can we only write once to the FIFO of the SDIO when DPSM is enabled? And Does the DPSM have to be enabled to write to the FIFO?

    2 – Does this problem explain why we can only transfer data with 1 byte block (see errata section 2.13 Limited multibyte support with SDIO cards)

    /* SDIO configuration */

    SDIO_InitStructure.SDIO_ClockDiv = (UI8)0x01;

    SDIO_InitStructure.SDIO_ClockEdge = SDIO_ClockEdge_Rising;

    SDIO_InitStructure.SDIO_ClockBypass = SDIO_ClockBypass_Disable;

    SDIO_InitStructure.SDIO_ClockPowerSave = SDIO_ClockPowerSave_Disable;

    SDIO_InitStructure.SDIO_BusWide = SDIO_BusWide_4b;

    SDIO_InitStructure.SDIO_HardwareFlowControl = SDIO_HardwareFlowControl_Disable;

    SDIO_Init(&SDIO_InitStructure);

    /* “FIFO� configuration with DPSM disabled */

    SDIO_DataInitStructure.SDIO_DataTimeOut = SD_DATATIMEOUT;

    SDIO_DataInitStructure.SDIO_DataLength = 32;

    SDIO_DataInitStructure.SDIO_DataBlockSize = SDIO_DataBlockSize_32b;

    SDIO_DataInitStructure.SDIO_TransferDir = SDIO_TransferDir_ToCard;

    SDIO_DataInitStructure.SDIO_TransferMode = SDIO_TransferMode_Block;

    SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Disable;

    SDIO_DataConfig(&SDIO_DataInitStructure);

    /* try to write data in the FIFO */

    SDIO_WriteData(0x00000001);

    SDIO_WriteData(0x00000002);

    SDIO_WriteData(0x00000003);

    SDIO_WriteData(0x00000004);

    /* RESULT */

    /* reading the memory from 0x40018080 to 0x400180FC (FIFO address) everything is at 0, nothing is written */

    /* other “FIFO� configuration with DPSM enabled */

    SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;

    SDIO_DataConfig(&SDIO_DataInitStructure);

    /* try to write data in the FIFO */

    SDIO_WriteData(0x00000005);

    /* RESULT */

    /* reading the memory from 0x40018080 to 0x400180FC (FIFO address). The full FIFO is written with 0x00000005 */

    /* try to write again in the FIFO */

    SDIO_WriteData(0x00000006);

    /* RESULT */

    /* reading the memory from 0x40018080 to 0x400180FC (FIFO address). The full FIFO is STILL written with 0x00000005 */

    /* reinit DPSM */

    SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;

    SDIO_DataConfig(&SDIO_DataInitStructure);

    /* try to write data in the FIFO */

    SDIO_WriteData(0x00000007);

    /* RESULT */

    /* reading the memory from 0x40018080 to 0x400180FC (FIFO address). The full FIFO is written with 0x00000007 */

    /* try now to access the FIFO with pointer at different address */

    UI32 *ptFifo;

    ptFifo = (UI32)0x40018084;

    /* reinit DPSM */

    SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;

    SDIO_DataConfig(&SDIO_DataInitStructure);

    /* try to write data in the FIFO */

    *ptFifo = 0x00000008;

    /* RESULT */

    /* reading the memory from 0x40018080 to 0x400180FC (FIFO address). The full FIFO is written with 0x00000008 */

    INFO: seeing the behaviour of the FIFO, I didn’t check any registers such as SDIO FIFO Counter. Because DPSM is enabled, as soon as I write to the FIFO, data are transferred.

    Thanks in advance.

    talib
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 13:05

    I am also facing the same problem with FIFO in SDIO.

    is it a known issue in STM32F103 series. What is the work around?