Second (external) SD card

Discussion in 'Troubleshooting' started by Dusan, Jun 3, 2015.

  1. Dusan

    Dusan New Member

    Joined:
    Jun 3, 2015
    Messages:
    2
    Likes Received:
    0
    Hi,
    Just wondering if anybody managed to make external SD card working. I believe I set everything correct in kernel configuration, recompiled it, but nothing... I was also unable to find anything usable on the internet except that secondary SD card is possible to connect on header pins. I even recorded with signal analizer if anything is happening at boot (CLK, D0...D3), but there is absolutely no activity.

    UDOO quad, udoobuntu 12.04, What am I missing ?
     
  2. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi there Dusan,
    would you be able to post the schema of how you attached it?Also, can you post the changes you made to the kernel?
     
  3. Dusan

    Dusan New Member

    Joined:
    Jun 3, 2015
    Messages:
    2
    Likes Received:
    0
    Hi,

    Somehow I made it work... still not entirely sure about CD signal, still experimenting...

    kernel\arch\arm\mach-mx6\

    Changes in board-mx6qd_seco_UDOO.h

    Enabled pins
    MX6Q_PAD_SD1_CLK__USDHC1_CLK,
    MX6Q_PAD_SD1_DAT0__USDHC1_DAT0,
    MX6Q_PAD_SD1_DAT1__USDHC1_DAT1,
    MX6Q_PAD_SD1_CMD__USDHC1_CMD,
    MX6Q_PAD_SD1_DAT3__USDHC1_DAT3,
    MX6Q_PAD_SD1_DAT2__USDHC1_DAT2,
    MX6Q_PAD_GPIO_1__USDHC1_CD,

    Disabled GPIO mode for these pins

    Changes in board-mx6_seco_UDOO.c

    added definition for SD1
    #define MX6_SECO_UDOO_SD1_CD IMX_GPIO_NR(1, 1) //not 100% sure if correct

    /* SD_external */
    static const struct esdhc_platform_data mx6q_seco_UDOO_sd1_data __initconst = {
    .cd_gpio = MX6_SECO_UDOO_SD1_CD,
    .always_present = 1,
    .keep_power_at_suspend = 1,
    };

    added initialization

    imx6q_add_sdhci_usdhc_imx(0, &mx6q_seco_UDOO_sd1_data);

    Still have some problems (assuming) with wire lengths, new PCB in production...

    Regards
     
  4. fetcher

    fetcher Member

    Joined:
    Mar 9, 2014
    Messages:
    166
    Likes Received:
    20
    I had to go with software/driver-controlled CD signal as well, in order for hot-swapping of cards to work (leaving the chosen pin as a GPIO), not being able to get the i.MX6's internal CD function to work for some reason... at least, not on SD1. From board-mx6_seco_UDOO.c --

    Code:
    static const struct esdhc_platform_data mx6q_seco_UDOO_sd1_data __initconst = {
      .cd_gpio = MX6_SECO_UDOO_SD1_CD,   
      .always_present = 0,
      .keep_power_at_suspend = 1,
      .cd_type = ESDHC_CD_GPIO,
    };
    
    It should be possible to set the ".cd gpio" pointing to any GPIO signal at all, in case SD1_CD conflicts with another use you'd like to make of that mux pad. You should end up with two IRQs showing as 'mmc1' in /proc/interrupts, one for the SD controller itself and the other for that GPIO pin used as card-detect:
    Code:
    jnh@imp:~/src$ cat /proc/interrupts  |grep mmc
     54:  546  0  0  0  GIC  mmc1
     56:  21992  0  0  0  GIC  mmc0
    392:  0  0  0  0  GPIO  mmc1
    
    yes, wire lengths as short as possible, yet also as close to equal as you can get should help. Also put a decoupling capacitor between +3.3V and ground on the SD socket.
     

Share This Page