This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCU-PLUS-SDK-AM243X: CMD55 can't send out in MMCSD_initSD() when initialize SD device

Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: AM2434, SYSCONFIG

We design our new hardware board with AM2434 ALX, now we are debugging SD card on our own board, and I have a problem.

When I call MMCSD_initSD() to initialize SD device, CMD55 cannot be send out, and the transfer complete interrupt will not happen all the time, so the program is always in MMCSD_initSD(), and will never exit.

 

The details are as follows:

SDK: mcu_plus_sdk_am243x_08_01_00_25

SD type: SDIO of SDMMC1

example: I use "mmcsd_file_io" example which is in mcu_plus_sdk_am243x_08_01_00_25, I only changed the pin config.

SD card: the card is from AM243X GP board box that I bought from TI website, and the SD card work well when running "mmcsd_file_io" example with AM243X GP board. 

 

Steps:

  • Step1: board initialize ok,  SD card can be detected.
  • Step2: send CMD0 ok, the oscilloscope can capture the send data.
  • Step3: send CMD8 ok, the oscilloscope can capture the send data and response data.
  • Step4: send CMD55 failed, the oscilloscope cannot capture the send data and response data, the program is waiting for transfer complete interrupt all the time in MMCSD_transfer().

I didn’t change anything in MMCSD_initSD().

I don’t know why can’t the data be send out?

  • Hi Li,

    You mentioned the original example runs fine on AM243x GP EVM, so I assume the issue is related to the pinmux changes. Did you change the pinmux using the SysConfig (example.syscfg)? What are the pinmux changes you made for your board?

    You also mentioned that you are using the micro SD card come with the AM243x GP EVM. I assume it is 16GB, so it is a HC card. Is it possible to use a non HC micro SD card like 2GB? The CMD55 is used to identify the HC or non HC card.

    Best regards,

    Ming  

  • Hi Ming,

    I only changed the pinmux of original example, we use SysConfig tool to config the pinmux. we designed based on AM243X_ALX.

    the SD card is 16GB HC class10 card, and work well when I execute the original example in AM243X GP EVM.

    I used another SD card with4GB class4 HC, but it shows the same problem.

    I tried to short SDCD to simulate that the SD card has been inserted, but actually I don't insert the card, and send command again.

    • SD card can be detected.
    • send CMD0 ok, the oscilloscope can capture the send data.
    • send CMD8 ok, the oscilloscope can capture the send data, no response data, because no SD card
    • send CMD55 failed, the oscilloscope cannot capture the send data and response data, the program is waiting for transfer complete interrupt all the time in MMCSD_transfer().

    it seems that this is not SD card's problem.

  • Hi Ming,

    I just tried to test SD card with SD connector of AM243X LP, but met the same problem.

  • Hi Li,

    I will do the same on our EVM and get back to you soon.

    Best regards,

    Ming

  • Hi Li,

    I did the same test on AM243x EVM for two different micro SD cards: 16GB SanDisk edge and 8GB Ultra. The mmcsd_file_io_am64x-evm_r5fss0-0_nortos_ti-arm-clang passed in both case.

    I noticed the pin changes you made in SysConfig are all not "pull up". As I recall, all data pins for SD card should have been pulled up. Can you try that?

    Best regards,

    Ming  

  • I did the same test on AM243x EVM for two different micro SD cards: 16GB SanDisk edge and 8GB Ultra. The mmcsd_file_io_am64x-evm_r5fss0-0_nortos_ti-arm-clang passed in both case.

    what is AM243X EVM? Is it AM243X GP EVM or AM243X LP EVM?

    you know AM243X GP EVM has SD card slot, but AM243X LP EVM only has SD connector.

    for AM243X GP EVM: I use the original example to test SD card on AM243X GP EVM, the case passed.

    for AM243X LP EVM: our hardware engineer use some cables to connect SD card slot and SD connector of AM243X LP EVM, and I run my case to test, the result is the same problem, CMD55 can't be send out.

    I noticed the pin changes you made in SysConfig are all not "pull up". As I recall, all data pins for SD card should have been pulled up. Can you try that?

    yes, all pin in SysConfig didn't "pull up", but I did it in my code. the test result is base on my code.

  • Hi Li,

    I was using the AM243x GP EVM, not the AM243x LaunchPad  (LP). I will try to get a AM243x LP to try out the test cases. It may take a few days. I will get back to you ASAP. Mean while can you make sure the wiring from SD connector to SD slot on AM243x LP is correct. 

    Best regards,

    Ming

  • the hardware design of SD is referenced to AM243X GP EVM. if the hardware is incorrect, I think the SD card will not response CMD8 correctly.

    the initialization workflow uses the original initialize function MMCSD_initSD() of mcu_plus_sdk_am243x_08_01_00_25.

  • Hi Li,

    Got it. I will try it on AM243x LP and get back to you soon.

    Best regards,

    Ming

  • Hi Li,

    I got a AM243x LP and a booster pack for SD card. When I plug in the booster pack for SD card, the AM243x LP can boot from the SD card and the mmcsd_file_io_am243x-evm_r5fss0-0_nortos_ti-arm-clang runs fine too. So my guess is that the connection between the SD connector and the SD slot is the root cause of the problem. Attached please find the schematics of our SD card booster pack.

    AM243x_LP_TEST_JIG_SCH_REVA.pdf

    Best regards,

    Ming

  • Hi Ming,

    I tried today, but the problem is the same.

    our hardware engineer checked the diagram again, but they found nothing.

    I think there was another thing that maybe case this problem, that was the SD config parameters.

    I can't config MMCSD interface of AM243X LP EVM and generate code  through SysConfig, so I use the same config of AM243X GP EVM, maybe there was some different. Please help to check the config parameters.

    ti_drivers_config.c:

    /* MMCSD attributes */
    static MMCSD_Attrs gMmcsdAttrs[CONFIG_MMCSD_NUM_INSTANCES] =
    {
        {
            .ctrlBaseAddr = CSL_MMCSD1_CTL_CFG_BASE,
            .ssBaseAddr = CSL_MMCSD1_SS_CFG_BASE,
            .inputClkFreq = 200000000U,
            .intrNum = 166U,
            .intrEnable = FALSE,
            .enableDma = TRUE,
            .phyType = MMCSD_PHY_TYPE_SW_PHY,
            .busWidth = MMCSD_BUS_WIDTH_4BIT,
            .supportedModes = MMCSD_SUPPORT_SD_DS | MMCSD_SUPPORT_SD_HS,
            .tuningType = MMCSD_PHY_TUNING_TYPE_AUTO,
        },
    };
    /* MMCSD objects - initialized by the driver */
    static MMCSD_Object gMmcsdObjects[CONFIG_MMCSD_NUM_INSTANCES];
    /* MMCSD driver configuration */
    MMCSD_Config gMmcsdConfig[CONFIG_MMCSD_NUM_INSTANCES] =
    {
        {
            &gMmcsdAttrs[CONFIG_MMCSD0],
            &gMmcsdObjects[CONFIG_MMCSD0],
        },
    };

    uint32_t gMmcsdConfigNum = CONFIG_MMCSD_NUM_INSTANCES;

    ti_driver_open_close.c:

    FF_Disk_t gFFDisks[CONFIG_FF_NUM_INSTANCES];

    /* FreeRTOS+FAT MMCSD Configs */
    FF_MMCSD_Config gFFMmcsdConfig[CONFIG_FF_NUM_INSTANCES] =
    {
        {
             .mediaType = MMCSD_CARD_TYPE_SD,
             .mmcsdInstance = CONFIG_MMCSD0,
         },
    };

    /* FreeRTOS+FAT partitions */
    FF_MMCSD_PartitionId gFFPartitionIds[CONFIG_FF_NUM_INSTANCES] =
    {
        {
            .partitionNumber = 0,
            .partitionName = "/sd0",
        },
    };

  • Hi Li,

    I was using the mmcsd file I/O example from the AM243x MCU+ SDK 08.01.00.36. Here is the SD card sysconfig:

    Here is the mmcsd file I/O example in AM64x MCU+SDK 08.01.00.36. They look the same:

    So I think the pinmux for SD card on AM243x LP and AM64x EVM is the same. The syscfg generated files (including ti_drivers_config.c and ti_driver_open_close.c) are the same too.

    Best reagrds,

    Ming

  • Hi Li

    I also tried different SD cards on the AM243x LP with the SD card booster pack. They are worked fine on boot from and mmcsd file I/O example

    This is the SD card BP I used:

     .

    Best regards,

    Ming

  • Hi Ming,

    Can you give me a SD card example that can run on AM243X LP EVM? This can help us to find problem quickly.

  • Hi Li,

    I just imported the mmcsd_file_io_am243x-evm_r5fss0-0_nortos_ti-arm-clang from the AM243x MCU+ SDK 08.01.00.36. Attached please find the Debug build binary file.

    Best regards,

    Minghttps://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/mmcsd_5F00_file_5F00_io.Debug.map

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/mmcsd_5F00_file_5F00_io_5F00_am243x_2D00_evm_5F00_r5fss0_2D00_0_5F00_nortos_5F00_ti_2D00_arm_2D00_clang.out

  • Hi Ming,

    I tried your example, the SD test passed.

    I found the root cause, I didn't use the MMC1_CLKLB in ti_pinmux_config.c, because our hardware engineer didn't use this pin.