SD Card Issue - Custom S7G2 board

We are currently facing some issues with SD Card on our custom S7G2 board.
The SD Card works fine on Dev Kit (DK-S7G2) but with the same configuration and code it does not work on our custom board.
On Custom board, we are getting "WRITE_PROTECT" error even though the SD Card is unlocked but If i change the "Media Type" from "CARD" to "EMBEDDED" in Synergy config then it works fine. As we are using the same SD chip on custom board I don't know why there is a need for difference in Media Type between DK and Custom board, but I do know changing from "CARD" to "EMBEDDED" would bypass the CARD DETECT I/O line. Also, I don't know if that is recommended way of making it work on custom board. From what I have seen so far, "Embedded" Media Type is recommended only for eMMC memory type.

From hardware side, the Card detect I/O line looks good.


SSP version 1.1.3
e2 Studio Version 5.4.0.015

 

Any help on this issue is greatly appreciated. Thanks.

  • Hello Sam,

    Please make sure that the WP pin on pins tab is connected to the SDHI peripheral - otherwise the module won't be able to determine the write protection state.

    Regards
  • In reply to Renesas Karol:

    Hi Karol,

    Thanks for your response. It does look like the WP pin is tied up correctly to the SDHI peripheral.

    Please see attached image below. Thanks.

     

  • In reply to Sam:

    Hi Sam,

    Are you sure all hardware connections are correct? Have you compared it with DK-S7G2 design?

    U114 is a bus switch and most likely it isn't required.

    Regards,
    adboc

  • In reply to adboc:

    Hi Adboc,

    Yes, the hardware connections are correct. We are not using the bus switch as it's not required. Below is the SD Card design and its similar to DK-S7G2.

     

  • In reply to Sam:

    Hi Sam,

    Please check also if all SDHI pins have Drive Capacity set to High.

    Regards,
    adboc
  • In reply to adboc:

    Hi Adboc,
    As suggested, I have changed all SDHI pins Drive Capacity to High, Saved the Change, Generate Project Content, Recompiled the code.
    Still get the same write protect error on fx_file_create, when media type is card.
    Also tried cleaning up the entire project, and re-compile. Still no luck.
  • In reply to Sam:

    Hello Sam,

    Do you have another card you can try this with? "Write Protect" is a mechanical feature so if your card is damaged it may confuse the SDHI on Synergy device. Can you check the state of the WP line before and after the card is inserted?

    Regards
  • In reply to Renesas Karol:

    I just got back again on this SD card issue.
    Karol,
    I tried with another card still the same issue.
    The WP line state remains 3.3VDC either ways (before and after the card is inserted)

    Thanks,
    Sam

  • In reply to Sam:

    Hello Sam,

    If WP line is high, then the driver correctly informes the card is write-protected. You may check if the line is changing by disabling SDHI, enabling P414 as an input and checking its state when the card is inserted/removed. If it doesn't change, there is something wrong between the connector and the card.

    Regards,
    adboc
  • In reply to adboc:

    Hi Adboc,
    I tried the above and the state doesn't change either ways. Please see the below snippet on what I tried:
    1. Disabled SDHI, and re-configured P414 as General purpose input.
    2. Always stays high in both cases (card inserted/removed)

    while(1)
    {
    uint8_t wp_high=2;

    g_ioport.p_api->pinRead(IOPORT_PORT_04_PIN_14, &DI_SW_WP);

    if(IOPORT_LEVEL_LOW == DI_SW_WP)
    {
    wp_high=0; //breakpoint 1
    }
    else if(IOPORT_LEVEL_HIGH == DI_SW_WP)
    {
    wp_high=1; //breakpoint 2
    }

    ............................. }

    P414 always reported high and I am not seeing anything incorrect between the card and the connector by looking at it.

    Regards,
    Sam

  • In reply to Sam:

    Hi Sam,

    If it remains at high state, the driver correctly informs the card is write-protected. It is connector's role to change WP state.

    Changing media type to embedded is safe even if SD card is used.

    Regards,
    adboc