SDIO internel DMA question of SDIO example code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SDIO internel DMA question of SDIO example code

789 Views
NoOne
Contributor I

Borad:LPC54S018M-EVK

SDK example:sdmmc_examples/sdio

My goals: to drive WF200(siliconlabs wireless chip) with sdio peripheral interface 

Q1:funtion SDIO_IO_Read_Extended(sdio_card_t *card, sdio_func_num_t func, uint32_t regAddr, uint8_t *buffer, uint32_t count, uint32_t flags)  in fsl_sdio.c I configed as SDIO_IO_Read_Extended(card, kSDIO_FunctionNum1, 0,wx_dataRead,4,SDIO_EXTEND_CMD_OP_CODE_MASK)) and SDK_ALIGN(uint8_t wx_dataRead[SDK_SIZEALIGN( 4 , SDMMC_DATA_BUFFER_ALIGN_CACHE)],  MAX(SDMMC_DATA_BUFFER_ALIGN_CACHE, SDMMCHOST_DMA_BUFFER_ADDR_ALIGN));

It's a stream transfer mode , but example code is without  "data.streamTransfer = 1U ;" . Should I add it?

Q2:I debug this funtion to the insert funtion SDIF_TransferDataBlocking(SDIF_Type *base, sdif_data_t *data, bool isDMA). When it excuted "dmaStatus = SDIF_GetInternalDMAStatus(base);" ,dmaStatus  get the value 0xa000 which mean DMAC state machine present state is 5-DMA_WR_REQ_WAIT .Besides ,  it's always going around here and dmaStatus  is 0xa000 forever . I can't find any explain in reference UM11115. 

0 Kudos
Reply
1 Reply

783 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, WuXin,

Frankly speaking, I am not familiar with SDIO protocol, regarding your question, pls refer to declaration in fsl_sdif.h:

enum
{
kSDIF_CmdResponseExpect = SDIF_CMD_RESPONSE_EXPECT_MASK, /*!< command request response*/
kSDIF_CmdResponseLengthLong = SDIF_CMD_RESPONSE_LENGTH_MASK, /*!< command response length long */
kSDIF_CmdCheckResponseCRC = SDIF_CMD_CHECK_RESPONSE_CRC_MASK, /*!< request check command response CRC*/
kSDIF_DataExpect = SDIF_CMD_DATA_EXPECTED_MASK, /*!< request data transfer,either read/write*/
kSDIF_DataWriteToCard = SDIF_CMD_READ_WRITE_MASK, /*!< data transfer direction */
kSDIF_DataStreamTransfer = SDIF_CMD_TRANSFER_MODE_MASK, /*!< data transfer mode :stream/block transfer command */
kSDIF_DataTransferAutoStop = SDIF_CMD_SEND_AUTO_STOP_MASK, /*!< data transfer with auto stop at the end of */
kSDIF_WaitPreTransferComplete =
SDIF_CMD_WAIT_PRVDATA_COMPLETE_MASK, /*!< wait pre transfer complete before sending this cmd */
kSDIF_TransferStopAbort = SDIF_CMD_STOP_ABORT_CMD_MASK, /*!< when host issue stop or abort cmd to stop data transfer
,this bit should set so that cmd/data state-machines of CIU
can return to idle correctly*/
kSDIF_SendInitialization =
SDIF_CMD_SEND_INITIALIZATION_MASK, /*!< send initialization 80 clocks for SD card after power on */
kSDIF_CmdUpdateClockRegisterOnly =
SDIF_CMD_UPDATE_CLOCK_REGISTERS_ONLY_MASK, /*!< send cmd update the CIU clock register only */
kSDIF_CmdtoReadCEATADevice = SDIF_CMD_READ_CEATA_DEVICE_MASK, /*!< host is perform read access to CE-ATA device */
kSDIF_CmdExpectCCS = SDIF_CMD_CCS_EXPECTED_MASK, /*!< command expect command completion signal signal */
kSDIF_BootModeEnable = SDIF_CMD_ENABLE_BOOT_MASK, /*!< this bit should only be set for mandatory boot mode */
kSDIF_BootModeExpectAck = SDIF_CMD_EXPECT_BOOT_ACK_MASK, /*!< boot mode expect ack */
kSDIF_BootModeDisable = SDIF_CMD_DISABLE_BOOT_MASK, /*!< when software set this bit along with START_CMD, CIU
terminates the boot operation*/
kSDIF_BootModeAlternate = SDIF_CMD_BOOT_MODE_MASK, /*!< select boot mode ,alternate or mandatory*/
kSDIF_CmdVoltageSwitch = SDIF_CMD_VOLT_SWITCH_MASK, /*!< this bit set for CMD11 only */
kSDIF_CmdDataUseHoldReg = SDIF_CMD_USE_HOLD_REG_MASK, /*!< cmd and data send to card through the HOLD register*/
};

 

The SDIF_CMD_TRANSFER_MODE_MASK is 0x800.

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply