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.

AM335x eMMC flashing

Hi, 

I have built Arago by following http://processors.wiki.ti.com/index.php/Processor_SDK_Building_The_SDK . I can create a SD card with the images I built and boot from the SD card. I want to download all the image into eMMC. How should I flash the eMMC with my images? I found several discussion on the forum talking about update eMMC on Beaglebone black. I'm confused which method should be the right one.

Thank you,

M.Ho

     

  • ensure your eMMC's space is enough
  • Hi,

    There are several approaches:

    From U-boot:

    http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User's_Guide#Using_SD.2C_eMMC_or_USB_storage

    Preferred method for production:

    From Linux kernel prompt you can also partition, format, and write to the eMMC just like a standard SD card. Here is an example guide based on kernel v3.2:

    How to format and partition the eMMC flash.docx

  • Hi Biser,
    Thanks for the info. I will try "preferred method for production".

    Thank you,
    M Ho
  • Hi Biser,
    The production procedure does the work. I do need to tweak the procedure a little bit since I can not really boot from the zImage with initramfs. Can you please tell me how to do make the zImage correctly? Thank you.

    M Ho
  • Hello M Ho,

    Which processor SDK and flasher filesystem you use? I've just make and boot the zImage without any issues, using the latest processor SDK and the tiny flasher filesystem .

    Best regards,
    Kemal

  • Hi Kemal,
    I did make clean and rebuild again. It works now. The problem is the prebuilt root filesystem permission is not correct on my host machine. It can boot now.
    The next problem is by running flasher.sh to update eMMC. My u-boot can not boot. I will provide some more u-boot log later.

    Thank you,
    M Ho
  • Hi,
    Here is the uboot message I got when I run /etc/init.d/fetcher.sh from the small zImage.
    ------------
    U-Boot 2016.05-00230-g120a8a3-dirty (Jul 29 2016 - 10:52:17 -0700)

    Watchdog enabled
    I2C: ready
    DRAM: 512 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net: cpsw, usb_ether
    Press SPACE to abort autoboot in 2 seconds
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    switch to partitions #0, OK
    mmc1(part 0) is current device
    Scanning mmc 1:1...
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    ** File not found /boot/zImage **
    ## Error: "bootcmd_nand0" not defined
    starting USB...
    USB0: Port not available.
    link up on port 0, speed 100, full duplex
    BOOTP broadcast 1
    BOOTP broadcast 2
    BOOTP broadcast 3
    DHCP client bound to address 192.168.10.40 (1032 ms)
    Using cpsw device
    TFTP from server 0.0.0.0; our IP address is 192.168.10.40; sending through gateway 192.168.10.1
    Filename 'zImage'.
    Load address: 0x82000000
    Loading: *
    TFTP error: 'File not found' (1)
    Not retrying...
    missing environment variable: pxeuuid
    Retrieving file: pxelinux.cfg/01-d0-39-72-37-d9-b4
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A80A28
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A80A2
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A80A
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A80
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A8
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/default-arm-am33xx
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/default-arm
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/default
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Config file not found
    starting USB...
    USB0: Port not available.
    link up on port 0, speed 100, full duplex
    BOOTP broadcast 1
    DHCP client bound to address 192.168.10.40 (25 ms)
    Using cpsw device
    TFTP from server 0.0.0.0; our IP address is 192.168.10.40; sending through gateway 192.168.10.1
    Filename 'boot.scr.uimg'.
    Load address: 0x80000000
    Loading: *
    TFTP error: 'File not found' (1)
    Not retrying...
    =>

    ------------

    However, this does not happen when I run the flasher.sh (not via fetcher.sh to call flasher.sh) from my SD-card. (I did change "$DRIVE" to mmcblk1 since I'm using sdcard to boot.)
    Why there's such difference?

    Thank you,
    M Ho
  • According to the log, the U-Boot cannot fetch the kernel since the serverip is not set.

    TFTP error: 'File not found' (1)
    Not retrying...
    missing environment variable: pxeuuid
    Retrieving file: pxelinux.cfg/01-d0-39-72-37-d9-b4
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A80A28
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set

    You can refer to this wiki page regarding the manual network configuration.

  • Hi Kemal,
    I understand the error log. But, I don't understand why u-boot don't load the kernel from eMMC after I ran flasher.sh. This doesn't happen when the system is boot from SD card.
    The whole goal is to download the image into BBB and boot from eMMC. Did I miss any configuration?

    Thank you,
    M Ho
  • Hi,

         I really want to know why your download procedure led to the u-boot problem. Should I create a new post to separate from the original post?

    Thank you,

    M Ho

  • You probably have missed to apply the 0001-Change-finduuid-to-use-mmcdev.patch. Have you done step 2 from the Preparing the Images to be Flashed section?

  • Hi Kemal, 

         I did apply the patch. I also double checked the change is in my include/configs/ti_armv7_common.h. 

         The u-boot works when I run the flasher.sh to download from my SD-Card. When I run the same script with a prepared zImage, it can not boot. Both methods downloaded boot_partition.tar.gz from the same tftp server. The u-boot build info also indicates they are the same one. I just don't understand why it's different when I follow your procedure. I tried many times. They behavior for both successful and failed cases are consistent.  

    Here is the normal boot log when I use SD-card to download:

    =====================================================

    U-Boot SPL 2016.05-00230-g120a8a3-dirty (Jul 29 2016 - 10:52:17)
    Trying to boot from MMC2
    Card did not respond to voltage select!
    *** Warning - MMC init failed, using default environment

    reading u-boot.img
    reading u-boot.img


    U-Boot 2016.05-00230-g120a8a3-dirty (Jul 29 2016 - 10:52:17 -0700)

    Watchdog enabled
    I2C: ready
    DRAM: 512 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net: cpsw, usb_ether
    Press SPACE to abort autoboot in 2 seconds
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    switch to partitions #0, OK
    mmc1(part 0) is current device
    Scanning mmc 1:1...
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    3663424 bytes read in 220 ms (15.9 MiB/s)
    36841 bytes read in 28 ms (1.3 MiB/s)
    Kernel image @ 0x82000000 [ 0x000000 - 0x37e640 ]
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8fff4000, end 8fffffe8 ... OK

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Initializing cgroup subsys cpu
    [ 0.000000] Initializing cgroup subsys cpuacct

    ====================================

    Here is the failed one.

    ====================================

    U-Boot 2016.05-00230-g120a8a3-dirty (Jul 29 2016 - 10:52:17 -0700)

    Watchdog enabled
    I2C: ready
    DRAM: 512 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net: cpsw, usb_ether
    Press SPACE to abort autoboot in 2 seconds
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    switch to partitions #0, OK
    mmc1(part 0) is current device
    Scanning mmc 1:1...
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    switch to partitions #0, OK
    mmc1(part 0) is current device
    SD/MMC found on device 1
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    ** File not found /boot/zImage **
    ## Error: "bootcmd_nand0" not defined
    starting USB...
    USB0: Port not available.
    link up on port 0, speed 100, full duplex
    BOOTP broadcast 1
    BOOTP broadcast 2
    BOOTP broadcast 3
    DHCP client bound to address 192.168.10.50 (1039 ms)
    Using cpsw device
    TFTP from server 0.0.0.0; our IP address is 192.168.10.50; sending through gate1
    Filename 'zImage'.
    Load address: 0x82000000
    Loading: *
    TFTP error: 'File not found' (1)
    Not retrying...
    missing environment variable: pxeuuid
    Retrieving file: pxelinux.cfg/01-80-30-dc-59-18-7a
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A80A32
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A80A3
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A80A
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A80
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A8
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0A
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C0
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/C
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/default-arm-am33xx
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/default-arm
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Retrieving file: pxelinux.cfg/default
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    Config file not found
    starting USB...
    USB0: Port not available.
    link up on port 0, speed 100, full duplex
    BOOTP broadcast 1
    DHCP client bound to address 192.168.10.50 (8 ms)
    Using cpsw device
    TFTP from server 0.0.0.0; our IP address is 192.168.10.50; sending through gate1
    Filename 'boot.scr.uimg'.
    Load address: 0x80000000
    Loading: *
    TFTP error: 'File not found' (1)
    Not retrying...
    =>

    ====================================

    M Ho

  • I think you should compare the the two bootcmds.

    U-Boot# printenv bootcmd

    According to the first log it boots from the SD card and should contains this string: run mmcboot.
    As per the second log, the bootcmd is surely
    bootcmd=run findfdt; run getuenv; setenv autoload no;dhcp ;tftp ${loadaddr} zImage-am335x-evm.bin; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}
    and tries boot trough tftp but fails since the serverip is not set.
    To boot from an eMMC you can also refer to this thread.

  • Hi,

          Thanks for the information. Can you tell me at what stage the bootcmd is updated during the download procedure? I never change the u-boot env. Could you please help me to understand how this works?

    Thank you,

    M Ho

  • I compared all u-boot env. Here are the differences.

    The left hand side is successful one; right hand side is failed boot. FYI.

    uboot_env_comp.tiff

  • The bootfile environment variable in the right hand side should be zImage. Could you fix this and retry?

    U-Boot# setenv bootfile zImage
  • Hi Kemal,

        This does help And, I need to do saveenv to store it on eMMC. Again, I'm really curious about the difference when I download the image in two different way. I think I will stop digging that for now. I also checked u-boot source code. It seems a easy change for default bootfile value. 

    Thank you,

    M Ho