5 Replies Latest reply on Jul 5, 2016 3:08 PM by jpkotta

    Enable SD Card in U-Boot


      I want to be able to do an OTA update from the SD card.  To do this I need to make the SD card accessible from u-boot.  I've done basically the same thing as this guy: Researching how to do U-Boot OTA using the external SD card on the Intel Edison · GitHub .  My changes weren't correct and now u-boot hangs and resets after a few seconds (relevant error: "sdhci_reset: Reset 0x1 never completed"). 


      Has anyone gotten the SD card working in u-boot?


      How does one recover from a bad u-boot image?  I have a known good u-boot in mmcblk0p3.

        • 1. Re: Enable SD Card in U-Boot
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi jpkotta,

          It would be necessary to check the startup log of your Edison to see where the error is occurring exactly. Could you please provide a screenshot(s) of this? Please share your log from “PSH KERNEL VERSION: xxxxxxxx” to the point it gets stuck. Depending on where the software is hanging it should be possible to recover it.
          Also, what did you do wrong about the tutorial that you shared? You mentioned that your changes weren’t correct, we would like to know what the error was.


          • 2. Re: Enable SD Card in U-Boot


            PSH KERNEL VERSION: b0182b2b

              WR: 20104000




            SCU IPC: 0x800000d0  0xfffce92c



            PSH miaHOB version: TNG.B0.VVBD.0000000c



            microkernel built 11:24:08 Feb  5 2015



            ******* PSH loader *******

            PCM page cache size = 192 KB

            Cache Constraint = 0 Pages

            Arming IPC driver ..

            Adding page store pool ..

            PagestoreAddr(IMR Start Address) = 0x04899000

            pageStoreSize(IMR Size)          = 0x00080000



            *** Ready to receive application ***





            U-Boot 2014.04 (Jun 22 2016 - 16:39:32)



                  Watchdog enabled

            DRAM:  980.6 MiB

            MMC:  sdhci_reset: Reset 0x1 never completed.

            tangier_sdhci: 0, tangier_sdhci: 1

            In:    serial

            Out:  serial

            Err:  serial

            I found
            https://github.com/01org/edison-u-boot/tree/edison-v2015.10, which has code to enable the SD card, which I'm trying to backport to my version (2014.04).  That code has the correct invocation of tangier_sdhci_init(), but I was missing power_init_board(); I'm pretty sure that's why it's not working.  Here's a diff of the code:

            int board_mmc_init(bd_t * bis)


            - int index = 0;

            - unsigned int base = CONFIG_SYS_EMMC_PORT_BASE + (0x40000 * index);


            - return tangier_sdhci_init(base, index, 4);

            + int err;


            + err = tangier_sdhci_init(CONFIG_SYS_EMMC_PORT_BASE, 0, 4);

            + if (err) {

            + goto exit;

            + }


            + err = tangier_sdhci_init(0xff3fa000, 0, 4);

            + if (err) {

            + printf("sdcard init failed: %d\n", err);

            + err = 0;

            + }



            + return err;



            Anyway, before I hose any more Edisons, I'm trying to figure out how to test code without overwriting u-boot.  I'm pretty close to getting that working with http://www.denx.de/wiki/view/DULG/UBootStandalone.

            • 3. Re: Enable SD Card in U-Boot
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi jpkotta,

              From your log, it should be possible to flash the Edison image to recover it. If you’re unsure on how to proceed with this check this guide: https://communities.intel.com/docs/DOC-98643. I noticed that you already know what caused the issue, so after recovering your Edison you can continue with your testing (even if you’re already close to test without overwriting u-boot). This seems like a nice project, it would be nice to see your final results once you’re done with it.


              • 4. Re: Enable SD Card in U-Boot
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Hi jpkotta,

                Do you have updates on this case? Were you able to test with the AlexT repository?


                • 5. Re: Enable SD Card in U-Boot

                  I can flash over bad u-boot images with the FlashToolLite.  I was also able to get standalone programs working, but I was still missing something to enable the SD card controller.  So then I tried to just use the 2015.10 branch from the 01org github, and it works so far.


                  Here's my recipe, which may still need modifications:


                  # u-boot_2015.10.bb

                  require recipes-bsp/u-boot/u-boot.inc



                  PV = "2015.10-1"

                  S = "${WORKDIR}/git"



                  PACKAGE_ARCH = "${MACHINE_ARCH}"



                  SRC_URI = "git://github.com/01org/edison-u-boot.git;branch=edison-v2015.10"

                  #SRC_URI += "file://upstream_to_edison.patch"

                  SRC_URI += "file://${MACHINE}.env"

                  SRC_URI += "file://target_env/*.env"

                  SRCREV = "2e2b030bc6ed039b3b27225ee3486bd5b5d9f5a4"



                  require recipes-bsp/u-boot/u-boot-target-env.inc

                  require recipes-bsp/u-boot/u-boot-osip.inc



                  LICENSE = "GPLv2+"

                  LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"

                  1 of 1 people found this helpful