Fixing sdcard hardware connector

Post Reply
brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Fixing sdcard hardware connector

Unread post by brad » Sun Dec 30, 2018 11:29 am

Hi all,
I am having some issues connecting the sdcard to the Odroid C2 which appears to be withing the sd connector itself. (Card's not detected, or detected then IO errors later)

I can solve it temporarily by pulling the back of the sdcard up from the board (maybe by jamming a bit of cardboard under it also)

Any ideas on a solution (I use sdcard's when developing quiet a bit).

I thoughts to try so far

- Soak the connector / board in contact cleaner to try to clean it
- make a dummy sdcard out of sandpaper to try to *polish the terminals*
- Try to resolder / reflow the sd card connector on the board (This looks difficult as it close to the cpu and no access - also are the pins soldered or a touch fit to the PCB under that connector)
- Mechanical force (force bend the upper part of the sd connector down to decrease the clearance on the pins)
- Produce and adaptor for the 2nd SD interface on the GPIO pins
- Buy more emmc cards and forget about sd

User avatar
odroid
Site Admin
Posts: 30028
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Fixing sdcard hardware connector

Unread post by odroid » Mon Dec 31, 2018 10:10 am

If the contact spring pins were damaged physically, it is not easy to fix it until replace the connector. :(
We may have a chance to send you a spare C2 board within a few weeks. ;)

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Mon Dec 31, 2018 10:32 am

I think I will buy a replacement board as they are low cost and I can re-purpose this one for other things using only emmc.

I did take a look at sd adaptors to use for the 2nd sdcard interface - this looks easy to use if it works - https://makerfabs.com/index.php?route=p ... duct_id=65 Otherwise I might find a micro sd socket which is easy enough to solder up an adaptor.

A question, the S905 will read bootloader from both emmc (0xD0074000) & boards normal sd slot (0xD0072000) - Would it also boot from mmc interface detected on sdio pins (0xD0070000)? Questions for hardkernel / amlogic I guess as its a closed a sourced bootloader. Drivers exist in mainline linux and uboot to support the sdio port its just the booting from arm BL1 im not sure of.

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Mon Dec 31, 2018 10:38 am

odroid wrote:
Mon Dec 31, 2018 10:10 am
If the contact spring pins were damaged physically, it is not easy to fix it until replace the connector. :(
We may have a chance to send you a spare C2 board within a few weeks. ;)
I have a bit of a list of things I need to buy from hard-kernel for the new year, I will make an order later this week and include a new C2. Thanks & Happy New Year Odroid!

User avatar
tobetter
Posts: 2810
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Contact:

Re: Fixing sdcard hardware connector

Unread post by tobetter » Mon Dec 31, 2018 10:42 am

brad wrote:
Mon Dec 31, 2018 10:32 am
A question, the S905 will read bootloader from both emmc (0xD0074000) & boards normal sd slot (0xD0072000) - Would it also boot from mmc interface detected on sdio pins (0xD0070000)? Questions for hardkernel / amlogic I guess as its a closed a sourced bootloader. Drivers exist in mainline linux and uboot to support the sdio port its just the booting from arm BL1 im not sure of.
SDIO port is not a part of boot media, as far as I know. Only possible boot media are SPI, uSD, eMMC and NAND for S905.

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Mon Dec 31, 2018 10:54 am

tobetter wrote:
Mon Dec 31, 2018 10:42 am
SDIO port is not a part of boot media, as far as I know. Only possible boot media are SPI, uSD, eMMC and NAND for S905.
Hi tobetter,
S905 eMMC module includes 3 interfaces emmc, sd & sdio, It boots from emmc & sd so was hoping it would also boot sdio (well sdio in sd mode with extra interrupt disabled).

Wishful thinking I guess but looking at bootloader log it shows "mmc@72000: 0, mmc@74000: 1". I would need it to see mmc@70000 which BL1 might find if a card is present there.

Code: Select all

GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:0;READ:0;CHK:0;▒MMC:   mmc@72000: 0, mmc@74000: 1
Thanks,
Brad.

User avatar
tobetter
Posts: 2810
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Contact:

Re: Fixing sdcard hardware connector

Unread post by tobetter » Mon Dec 31, 2018 11:05 am

brad wrote:
Mon Dec 31, 2018 10:54 am
tobetter wrote:
Mon Dec 31, 2018 10:42 am
SDIO port is not a part of boot media, as far as I know. Only possible boot media are SPI, uSD, eMMC and NAND for S905.
Hi tobetter,
S905 eMMC module includes 3 interfaces emmc, sd & sdio, It boots from emmc & sd so was hoping it would also boot sdio (well sdio in sd mode with extra interrupt disabled).

Wishful thinking I guess but looking at bootloader log it shows "mmc@72000: 0, mmc@74000: 1". I would need it to see mmc@70000 which BL1 might find if a card is present there.

Code: Select all

GXBB:BL1:08dafd:0a8993;FEAT:EDFC318C;POC:3;RCY:0;EMMC:0;READ:0;CHK:0;▒MMC:   mmc@72000: 0, mmc@74000: 1
Thanks,
Brad.
Hi Brad,

Well, I've checked my email box regarding SDIO whether or not it can boot on S905 but negative on this.
I can double check with AMLogic if you like to do. :)

Thanks.

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Mon Dec 31, 2018 11:46 am

tobetter wrote:
Mon Dec 31, 2018 11:05 am
Well, I've checked my email box regarding SDIO whether or not it can boot on S905 but negative on this.
I can double check with AMLogic if you like to do. :)
I think I will buy a new board to work around the sd socket problem so all is well there. It would still be very nice for my current board to know from Amlogic is the SDIO bootable from BL1. I was going to fire up the soldering iron at some stage and make a test adaptor out of sd-micro to sd adaptor which I can run to GPIO pins (2nd attempt)

Happy New Year tobetter!

User avatar
mad_ady
Posts: 5426
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Contact:

Re: Fixing sdcard hardware connector

Unread post by mad_ady » Mon Dec 31, 2018 3:14 pm

If it can boot from spi flash, you can put uboot there and it should be able to access the second sd card more easily.

User avatar
tobetter
Posts: 2810
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Contact:

Re: Fixing sdcard hardware connector

Unread post by tobetter » Mon Dec 31, 2018 4:42 pm

brad wrote:
Mon Dec 31, 2018 11:46 am
tobetter wrote:
Mon Dec 31, 2018 11:05 am
Well, I've checked my email box regarding SDIO whether or not it can boot on S905 but negative on this.
I can double check with AMLogic if you like to do. :)
I think I will buy a new board to work around the sd socket problem so all is well there. It would still be very nice for my current board to know from Amlogic is the SDIO bootable from BL1. I was going to fire up the soldering iron at some stage and make a test adaptor out of sd-micro to sd adaptor which I can run to GPIO pins (2nd attempt)

Happy New Year tobetter!
Let me double check if SDIO can be boot from.
Happy New Year, Brad...

User avatar
tobetter
Posts: 2810
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Contact:

Re: Fixing sdcard hardware connector

Unread post by tobetter » Mon Dec 31, 2018 4:52 pm

mad_ady wrote:
Mon Dec 31, 2018 3:14 pm
If it can boot from spi flash, you can put uboot there and it should be able to access the second sd card more easily.
I doubt SPI flash can be attached to ODROID-C2 since not sure SPI pads can access SPI flash memory, BL1 can access the flash memory for booting. :)
I would need a double check.
Happy New Year, @mad_ady. :)

User avatar
mad_ady
Posts: 5426
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Contact:

Re: Fixing sdcard hardware connector

Unread post by mad_ady » Mon Dec 31, 2018 4:55 pm

Happy new year to you too! :)
I forgot spi is used for ethernet on the c2.

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Wed Jan 02, 2019 12:19 pm

tobetter wrote:
Mon Dec 31, 2018 4:42 pm
Let me double check if SDIO can be boot from.
Happy New Year, Brad...
I performed some initial testing by soldering some wires to a microsd to sd converter and powering via the boards 3.3v volt supply.

There was no signs of detection from the S905 at boot (ie: it could not find the SD card on sdio port)

I was able to add the sdio config to mainline linux (4.20) and the sd card was successfully detected although it was read only (I suspect I have something a miss with the wiring and the read only switch on the sd card adaptor)

Given that sdio works in mainline linux I suspect it would not be hard to add uboot support as well so this would just leave the S905 boot missing. (S905 detecting the card and finding BL1 on it)

I think I am out of luck now as the functionality is in the ROM in the S905 which cannot be modified (unless there is some trick that could make it work but as code is closed source I have no ideas)

It was a good test though as it shows sdio interface can work in mainline linux which opens up some expansion options for the C2. A while ago a looked at 3.14.y sdio support but the driver has mostly been commented out due to irq's being to difficult to make work - I never looked at boot support until now.

Thanks for helping to look at this for me, I suspect amlogic will say that boot is not possible for sdio.

cheers,
Brad.

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Wed Jan 02, 2019 12:28 pm

mad_ady wrote:
Mon Dec 31, 2018 4:55 pm
Happy new year to you too! :)
I forgot spi is used for ethernet on the c2.
I took a look at the datasheet / c2 schematics at other boot options and yes it looks like SPI is routed to ethernet module and NAND is routed to emmc connector. It might be possible to boot via UART or JTAG (but I somehow doubt it) but would be very complicated and no worth the hassle I believe.

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Fri Jan 04, 2019 6:15 pm

Even though it appears boot from sdio is not available, the sd will still be very useful in uboot / linux so I took a look at some sdio adaptors / breakout boards to test a more permanent solution.

The sdio pins are fully exposed on the 40 pin header (all 4 bits worth) but I have only tested spi sd mode (1 bit) with my less than impressive home made adaptor. Maybe I can take a picture.

I think I can run the sd powered from the 3.3v C2 board supply (as in my initial test) with no issues but if I were to try out a cheap realtek sdio wifi do you think the board 3.3v would be ok?

For speed hopefully I can connect the data lines directly (be they SPI mode or 4 bit mode lines) or should I still be using linear shift to adjust voltage? Mainline linux can maybe also offer 1.8v on the data pins to allow SD low voltage signaling mode but I am unsure how this would react with detection from the driver.

Lastly if I hook up a cheap realtek sdio wifi what would be the best antenna setup, I would have a ground and antenna pin to work with and a 50ohm target impedance.

This is only for fun and experimentation I will buy another C2 board to solve the issue with my sdcard connector on my the C2 :) The current one has had sd card inserted 100's of times (probably thousands) and had some heavy use over close to 3 years.

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Sat Jan 12, 2019 7:50 am

I'm waiting for Australian exchange rate to move a bit higher before I make order from hardkernel for new board :(

I have ordered some cheap breakout boards to test sd card / wifi in the sdio port. Might take some time to arrive.

sd boards
https://www.ebay.com.au/itm/New-Blue-Si ... 2749.l2649
https://www.ebay.com.au/itm/TF-Card-Mod ... 2749.l2649

Wifi - RTL8723BS
https://www.ebay.com.au/itm/1PCS-RTL872 ... 2749.l2649

Wifi - RTL8189ES
https://www.ebay.com.au/itm/RTL8189ES-F ... 2749.l2649

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Wed Jan 16, 2019 9:05 pm

brad wrote:
Sat Jan 12, 2019 7:50 am
I have ordered some cheap breakout boards to test sd card / wifi in the sdio port. Might take some time to arrive.
So I ordered a new C2 which should arrive next week! In the meantime a microsd breakout board I ordered arrived so I hooked it up to the sdio port.

GPIOX_0 (p29) = D0
GPIOX_1 (p24) = D1
GPIOX_2 (p23) = D2
GPIOX_3 (p22) = D3
GPIOX_4 (p21) = CLK
GPIOX_5 (p18) = CMD
3,3v (p17) - VCC
GND (p30) - GND

I added in a sd_emmc_a config to the mainline kernel device tree (not much more that a copy and paste from meson-gxbb-vega-s95.dtsi file). It needs work to optimise for modern sdcard

Code: Select all

/* SDIO (SD Card config) */
&sd_emmc_a {
        status = "okay";
        pinctrl-0 = <&sdio_pins &sdio_irq_pins>;
        pinctrl-1 = <&sdio_clk_gate_pins>;
        pinctrl-names = "default", "clk-gate";
        #address-cells = <1>;
        #size-cells = <0>;

        bus-width = <4>;
        cap-sd-highspeed;
        max-frequency = <100000000>;

        non-removable;
        disable-wp;

        mmc-pwrseq = <&sdio_pwrseq>;

        vmmc-supply = <&vcc3v3>;
        vqmmc-supply = <&vcc1v8>;
};

/* SD */
&sd_emmc_b {
        status = "okay";
        pinctrl-0 = <&sdcard_pins>;
        pinctrl-1 = <&sdcard_clk_gate_pins>;
        pinctrl-names = "default", "clk-gate";

        bus-width = <4>;
        cap-sd-highspeed;
        max-frequency = <100000000>;
        disable-wp;

        cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
        cd-inverted;

        vmmc-supply = <&tflash_vdd>;
        vqmmc-supply = <&tf_io>;
};

/* eMMC */
&sd_emmc_c {
        status = "okay";
        pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
        pinctrl-1 = <&emmc_clk_gate_pins>;
        pinctrl-names = "default", "clk-gate";

        bus-width = <8>;
        max-frequency = <100000000>;
        non-removable;
        disable-wp;
        cap-mmc-highspeed;
        mmc-ddr-1_8v;
        mmc-hs200-1_8v;

        mmc-pwrseq = <&emmc_pwrseq>;
        vmmc-supply = <&vcc3v3>;
        vqmmc-supply = <&vcc1v8>;
};
I was lazy and also left a dummy reset gpio signal..

Code: Select all

        sdio_pwrseq: sdio-pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&gpio GPIOX_9 GPIO_ACTIVE_LOW>,
                                <&gpio GPIOX_11 GPIO_ACTIVE_LOW>;
The cards work quiet well (but no boot from S905) and report running 4bit mode 1.8v mode. (1st is sdio, 2nd the emmc & 3rd my empty broken sd connector port)

Code: Select all

root@odroid:~# cat /sys/kernel/debug/mmc0/ios
clock:          50000000 Hz
actual clock:   50000000 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      2 (4 bits)
timing spec:    2 (sd high-speed)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)
root@odroid:~# cat /sys/kernel/debug/mmc1/ios
clock:          100000000 Hz
actual clock:   100000000 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    9 (mmc HS200)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)
root@odroid:~# cat /sys/kernel/debug/mmc2/ios
clock:          0 Hz
vdd:            0 (invalid)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     0 (off)
bus width:      0 (1 bits)
timing spec:    0 (legacy)
signal voltage: 0 (3.30 V)
driver type:    0 (driver type B)
Speed is a bit slow on initial test but Ill play with device tree and I have a fast UHS-I card on the way to test hopefully it works, a 64G SanDisk extreme pro A2

brad
Posts: 818
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1
Location: Australia
Contact:

Re: Fixing sdcard hardware connector

Unread post by brad » Mon Jan 28, 2019 10:01 am

An update on this I was only able to get the sdio port working in 3.3v modes as either my wires are a bit long or my linear converter setup was not good enough for 1.8v.

I received a new C2 and also a new 64Gb SanDisk Extreame Pro UHS-I A2 card. By default in mainline linux there was no UHS-I support for the sd card slot but add it to device tree and it works well. I needed to increase the max-frequency for the sd port though to 200000000 to allow the card to work in SDR104 mode. I'm not yet sure if it would cause compatibility issues with other cards.

Code: Select all

/* SD */
&sd_emmc_b {
        status = "okay";
        pinctrl-0 = <&sdcard_pins>;
        pinctrl-1 = <&sdcard_clk_gate_pins>;
        pinctrl-names = "default", "clk-gate";

        bus-width = <4>;
        cap-sd-highspeed;
        sd-uhs-sdr25;
        sd-uhs-sdr50;
        sd-uhs-sdr104;
        max-frequency = <200000000>;
        disable-wp;

        cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
        cd-inverted;

        vmmc-supply = <&tflash_vdd>;
        vqmmc-supply = <&tf_io>;
};
And a quick test in SDR104 mode (Performance is good :)

Code: Select all

root@odroid:/home/brad# dd if=/dev/mmcblk2 of=/dev/null bs=32M oflag=dsync status=progress
25635586048 bytes (26 GB, 24 GiB) copied, 313 s, 81.9 MB/s^C
766+0 records in
765+0 records out
25669140480 bytes (26 GB, 24 GiB) copied, 314.266 s, 81.7 MB/s

root@odroid:/home/brad# cat /sys/kernel/debug/mmc2/ios
clock:          208000000 Hz
actual clock:   200000000 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      2 (4 bits)
timing spec:    6 (sd uhs SDR104)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest