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.

AM3357: BeagleBone Black: can't boot from SD card having only bootloader

Part Number: AM3357

Hello,

I've tried two different default configurations while building u-boot:

  • am335x_boneblack_vboot_defconfig
  • am335x_evm_defconfig

I formatted sd-card with this script:
https://github.com/PacktPublishing/Mastering-Embedded-Linux-Programming-Second-Edition/blob/master/format-sdcard.sh
Then I copied MLO and u-boot.img into the boot partition.
Here is boot log for am335x_boneblack_vboot_defconfig case (for am335x_evm_defconfig it's similar):

U-Boot SPL 2020.10-rc3 (Aug 28 2020 - 10:16:38 +0200)
WDT: Not found! 
Trying to boot from MMC1 
Loading Environment from FAT... *** Warning - bad CRC, using default environment 
Loading Environment from MMC... *** Warning - bad CRC, using default environment
 U-Boot 2020.10-rc3 (Aug 28 2020 - 10:16:38 +0200)
 CPU : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black 
DRAM: 512 MiB 
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 
Loading Environment from FAT... *** Warning - bad CRC, using default environment 
Loading Environment from MMC... *** Warning - bad CRC, using default environment
 <ethaddr> not set. Validating first E-fuse MAC
Net: eth2: ethernet@4a100000, eth3: usb_ether 
Press SPACE to abort autoboot in 2 seconds 
switch to partitions #0, OK 
mmc0 is current device 
SD/MMC found on device 0 
Failed to load 'boot.scr' 
Failed to load 'uEnv.txt' 
switch to partitions #0, OK 
mmc0 is current device 
Scanning mmc 0:1... 
switch to partitions #0, OK 
mmc0 is current device 
SD/MMC found on device 0 
Failed to load '/boot/zImage' 
switch to partitions #0, OK 
mmc1(part 0) is current device 
Scanning mmc 1:1... 
Found /boot/extlinux/extlinux.conf

As you see, it tries to boot from MMC1 (I suppose that it's sd-card), it fails to boot from MMC1, then it switches to eMMC (where is full Linux, i.e. boot + kernel) and boots successfully from eMMC.

There are warnings: "bad CRC". Probably this is the cause of boot failure ?
Could it be problem of copying of u-boot files ... or erroneous formatting of sd-card.
Have someone an idea how to check these issues.
Thanks.
Sincerely,
Pavel.

  • Here is boot log when using u-boot files, originated from u-boot build where am335x_evm_defconfig file was used as default configuration :

    U-Boot SPL 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 11:40:17 +0200)
    Trying to boot from MMC1
    U-Boot 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 11:40:17 +0200)
    CPU : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM: 512 MiB
    WDT: Started with servicing (60s timeout)
    NAND: 0 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... *** Warning - bad CRC, using default environment
    <ethaddr> not set. Validating first E-fuse MAC
    Net: eth2: ethernet@4a100000, eth3: usb_ether
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    Failed to load 'boot.scr'
    Failed to load 'uEnv.txt'
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    Failed to load '/boot/zImage'
    switch to partitions #0, OK
    mmc1(part 0) is current device
    Scanning mmc 1:1...
    Found /boot/extlinux/extlinux.conf

    The last line Found /boot/extlinux/extlinux.conf signifies, that boot process from sd-card failed and BBB switched to eMMC (where extlinux.conf indeed does exist) and then successfully boots from eMMC.

    What's wrong with SD card content ?

    Thanks.

  • Hi Pavel,

    You would want to copy kernel/dtb/filesystem… to the 2nd partition of SD card using <copy-yoctoproject-image-to-sdcard.sh> or something similar.

    The link below is on how to create sd card with AM335x SDK package.

    https://software-dl.ti.com/processor-sdk-linux/esd/docs/06_03_00_106/AM335X/linux/Overview/Processor_SDK_Linux_create_SD_card_script.html#linux-sd-card-creation-guide

    Best,

    -Hong

  • Hi Hong,

    Thanks.

    I used script create-sdcard.sh. Works well, but along with boot files it copies also kernel.

    Is it possible to copy only boot files in order to have U-boot# prompt after booting from sd-card.

    Probably I have to modify some parameters while following through create-sdcard.sh options.

    Here is log of the session:

    pavel@ALABAMA:~/ti-processor-sdk-linux-am335x-evm-06.03.00.106/bin$ sudo ./create-sdcard.sh
    [sudo] password for pavel:

    ################################################################################

    This script will create a bootable SD card from custom or pre-built binaries.

    The script must be run with root permissions and from the bin directory of
    the SDK

    Example:
     $ sudo ./create-sdcard.sh

    Formatting can be skipped if the SD card is already formatted and
    partitioned properly.

    ################################################################################

    Available Drives to write images to:

    #  major   minor    size   name
    1:   8        0   15558144 sda
     
    Enter Device Number or n to exit: 1
     
    sda was selected

    /dev/sda is an sdx device
    Unmounting the sda drives
     unmounted /dev/sda1
     unmounted /dev/sda2
    Current size of sda1 65536 bytes
    Current size of sda2 1048576 bytes

    ################################################################################

        Select 2 partitions if only need boot and rootfs (most users).
        Select 3 partitions if need SDK & other content on SD card.  This is
            usually used by device manufacturers with access to partition tarballs.

        ****WARNING**** continuing will erase all data on sda

    ################################################################################

    Number of partitions needed [2/3] : 2

     
    Now partitioning sda with 2 partitions...
     

    ################################################################################

            Now making 2 partitions

    ################################################################################

    1024+0 records in
    1024+0 records out
    1048576 bytes (1,0 MB, 1,0 MiB) copied, 0,284389 s, 3,7 MB/s
    DISK SIZE - 15931539456 bytes

    ################################################################################

            Partitioning Boot

    ################################################################################
    mkfs.fat 4.1 (2017-01-24)
    mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows

    ################################################################################

            Partitioning rootfs

    ################################################################################
    mke2fs 1.44.1 (24-Mar-2018)
    Creating filesystem with 3867392 4k blocks and 967232 inodes
    Filesystem UUID: d28faf5e-a76c-4221-816b-0a255a1f6a37
    Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (16384 blocks): done
    Writing superblocks and filesystem accounting information: done   



    ################################################################################

       Partitioning is now done
       Continue to install filesystem or select 'n' to safe exit

       **Warning** Continuing will erase files any files in the partitions

    ################################################################################


    Would you like to continue? [y/n] : y

     
     
    Mount the partitions
     
    Emptying partitions
     

    Syncing....

    ################################################################################

        Choose file path to install from

        1 ) Install pre-built images from SDK
        2 ) Enter in custom boot and rootfs file paths

    ################################################################################

    Choose now [1/2] : 1

     
    Will now install from SDK pre-built images
    now installing:  ti-processor-sdk-linux-am335x-evm-06.03.00.106

    ################################################################################

       Multiple rootfs Tarballs found

    ################################################################################

         1:tisdk-rootfs-image-am335x-evm.tar.xz
         2:tisdk-docker-rootfs-image-am335x-evm.tar.xz

    Enter Number of rootfs Tarball: 1
     
    ################################################################################

        Copying files now... will take minutes

    ################################################################################

    Copying boot partition



    MLO copied


    u-boot.img copied


    Copying rootfs System partition
                                                                                                                    

     
    Syncing...
     
    Un-mount the partitions
     
    Remove created temp directories
     
    Operation Finished
     
    pavel@ALABAMA:~/ti-processor-sdk-linux-am335x-evm-06.03.00.106/bin$

    Sincerely,

    Pavel.

  • Hi Pavel,

    It is good to know you were able to create your SD card, and get it boot on your setup.

    Pavel Yermolenko1 said:

    Is it possible to copy only boot files in order to have U-boot# prompt after booting from sd-card.

    You can select (2), and follow the instructions.

    Pavel Yermolenko1 said:

    ################################################################################

        Choose file path to install from

        1 ) Install pre-built images from SDK
        2 ) Enter in custom boot and rootfs file paths

    ################################################################################

    Best,

    -Hong

  • Hi Hong,

    Thanks. The only location in SDK, where I've found boot files (MLO and .img) is

    ~/ti-processor-sdk-linux-am335x-evm-06.03.00.106/board-support/prebuilt-images/

    But script refuses it:

    ################################################################################

        Choose file path to install from

        1 ) Install pre-built images from SDK
        2 ) Enter in custom boot and rootfs file paths

    ################################################################################

    Choose now [1/2] : 2

     

    ################################################################################

      For U-boot and MLO

      If files are located in Tarball write complete path including the file name.
          e.x. $:  /home/user/MyCustomTars/boot.tar.xz

      If files are located in a directory write the directory path
          e.x. $: /ti-sdk/board-support/prebuilt-images/

      NOTE: Not all platforms will have an MLO file and this file can
            be ignored for platforms that do not support an MLO.

      Update: The proper location for the kernel image and device tree
              files have moved from the boot partition to the root filesystem.

    ################################################################################

    Enter path for Boot Partition : ~/ti-processor-sdk-linux-am335x-evm-06.03.00.106/board-support/prebuilt-images

    Invalid path make sure to include complete path
    Enter path for Boot Partition : ~/ti-processor-sdk-linux-am335x-evm-06.03.00.106/board-support/prebuilt-images/

    Invalid path make sure to include complete path
    Enter path for Boot Partition :

    Where I've been mistaken ?

    Sincerely,

    Pavel.

  • Hi Pavel,

    You would need to give the absolute path of the booting file dir. or "pwd" of "$sdk-install/board-support/prebuilt-images".

    Best,

    -Hong

  • Hi Hong,

    Yes, it was the case.

    But further it asks for kernel ... something that I don't want to install.

    How to proceed ?

    Sincerely,

    Pavel.

    Invalid path make sure to include complete path
    Enter path for Boot Partition : /home/pavel/ti-processor-sdk-linux-am335x-evm-06.03.00.106/board-support/prebuilt-images

    Directory exists

    This directory contains:
    MLO-am335x-evm                  am335x-boneblack-wireless-am335x-evm.dtb  am335x-evm.dtb                  am335x-icev2.dtb
    am335x-bone-am335x-evm.dtb          am335x-boneblack-wireless.dtb            am335x-evmsk-am335x-evm.dtb              am335x-pocketbeagle-am335x-evm.dtb
    am335x-bone.dtb                  am335x-boneblack.dtb                am335x-evmsk.dtb                  am335x-pocketbeagle.dtb
    am335x-boneblack-am335x-evm.dtb          am335x-boneblue-am335x-evm.dtb        am335x-icev2-am335x-evm.dtb              am335x-sancloud-bbe-am335x-evm.dtb
    am335x-boneblack-iot-cape-am335x-evm.dtb  am335x-boneblue.dtb                am335x-icev2-pru-excl-uio-am335x-evm.dtb  am335x-sancloud-bbe.dtb
    am335x-boneblack-iot-cape.dtb          am335x-bonegreen-am335x-evm.dtb        am335x-icev2-pru-excl-uio.dtb          u-boot-am335x-evm.img
    am335x-boneblack-pru-adc-am335x-evm.dtb   am335x-bonegreen-wireless-am335x-evm.dtb  am335x-icev2-prueth-am335x-evm.dtb          u-boot-spl.bin-am335x-evm
    am335x-boneblack-pru-adc.dtb          am335x-bonegreen-wireless.dtb            am335x-icev2-prueth-pps-am335x-evm.dtb    zImage-am335x-evm.bin
    am335x-boneblack-prusuart-am335x-evm.dtb  am335x-bonegreen.dtb                am335x-icev2-prueth-pps.dtb
    am335x-boneblack-prusuart.dtb          am335x-evm-am335x-evm.dtb            am335x-icev2-prueth.dtb

    Is this correct? [y/n] : y


    ################################################################################

       For Kernel Image and Device Trees files

        What would you like to do?
         1) Reuse kernel image and device tree files found in the selected rootfs.
         2) Provide a directory that contains the kernel image and device tree files
            to be used.

    ################################################################################

    Choose option 1 or 2 :

     

  • Hi Pavel,

    If you only want to update MLO/u-boot.img in boot partition of SD card, simple way to do it

    cd to DIR where MLO/u-boot.img located

    cp -p MLO DIR_BOOT_SD, where "DIR_BOOT_SD" is from "mount" showing boot partition of your SD card.

    Best,

    -Hong

  • Hi Hong,

    I proceeded as you suggested,

    First I copied 2 files MLO-am335x-evm and u-boot-am335x-evm.img into boot partition on sd-card.

    pavel@ALABAMA:~/ti-processor-sdk-linux-am335x-evm-06.03.00.106/board-support/prebuilt-images$ cp -v MLO-am335x-evm u-boot-am335x-evm.img /media/pavel/boot/
    'MLO-am335x-evm' -> '/media/pavel/boot/MLO-am335x-evm'
    'u-boot-am335x-evm.img' -> '/media/pavel/boot/u-boot-am335x-evm.img'
    pavel@ALABAMA:~/ti-processor-sdk-linux-am335x-evm-06.03.00.106/board-support/prebuilt-images$

    It doesn't work: I inserted sd-card in BBB and on Power ON I observed CCCCCCCC.. in terminal.

    Then I renamed them in MLO and u-boot.img.

    The initial situation (that I evoked in my 1st message) was repeated: first BBB tried to boot from SD card and, failing to boot from SD-card, has changed to eMMC.

    Here is log.

    Sincerely,

    Pavel.

    CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
    U-Boot SPL 2019.01-g333c3e72d3 (Apr 19 2020 - 11:21:12 +0000)
    Trying to boot from MMC1


    U-Boot 2019.01-g333c3e72d3 (Apr 19 2020 - 11:21:12 +0000)

    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net:   eth0: ethernet@4a100000
    Warning: usb_ether MAC addresses don't match:
    Address in ROM is          de:ad:be:ef:00:01
    Address in environment is  94:e3:6d:d4:ae:88
    , eth1: usb_ether
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** File not found /boot/zImage **
    switch to partitions #0, OK
    mmc1(part 0) is current device
    Scanning mmc 1:1...
    Found /boot/extlinux/extlinux.conf
    Retrieving file: /boot/extlinux/extlinux.conf
    256 bytes read in 0 ms
    1:    Linux 4.19.94-ti-r42
    Retrieving file: /boot/vmlinuz-4.19.94-ti-r42
    10095592 bytes read in 650 ms (14.8 MiB/s)
    append: console=ttyO0,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet
    Retrieving file: /boot/dtbs/4.19.94-ti-r42/am335x-boneblack.dtb
    59483 bytes read in 6 ms (9.5 MiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8ffee000, end 8ffff85a ... OK

    Starting kernel ...

    [    0.000767] timer_probe: no matching timers found
    [    0.115140] l4_wkup_cm:clk:0010:0: failed to disable
    [    8.729927] omap_voltage_late_init: Voltage driver support not added

    Debian GNU/Linux 10 beaglebone ttyS0

    BeagleBoard.org Debian Buster IoT Image 2020-04-06

    Support: elinux.org/Beagleboard:BeagleBoneBlack_Debian

    default username:password is [debian:temppwd]

    beaglebone login: debian
    Password:
    Last login: Tue Sep  1 10:22:54 UTC 2020 on ttyS0

    The programs included with the Debian GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.

    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    debian@beaglebone:~$

     

  • Hi Patel,

    At u-boot prompt, what is the output from

    $md.l 0x44E10040 1

    Best,

    -Hong

  • Hi Hong,

    The problem I can't get u-boot prompt.

    As I mentioned before, when I try to boot from an SD card which only contains u-boot files (MLO and u-boot.img), on power-up (with S2 pushed) , BBB almost immediately switches to eMMC and boots from eMMC.

    And finally I get Linux prompt, not u-boot prompt.

    Sincerely,

    Pavel.

    P.S. Here is as it looks:

    U-Boot SPL 2019.01-g333c3e72d3 (Apr 19 2020 - 11:21:12 +0000)
    Trying to boot from MMC1


    U-Boot 2019.01-g333c3e72d3 (Apr 19 2020 - 11:21:12 +0000)

    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net:   Could not get PHY for ethernet@4a100000: addr 0
    eth0: ethernet@4a100000
    Warning: usb_ether MAC addresses don't match:
    Address in ROM is          de:ad:be:ef:00:01
    Address in environment is  94:e3:6d:d4:ae:88
    , eth1: usb_ether
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** File not found /boot/zImage **
    switch to partitions #0, OK
    mmc1(part 0) is current device
    Scanning mmc 1:1...
    Found /boot/extlinux/extlinux.conf
    Retrieving file: /boot/extlinux/extlinux.conf
    256 bytes read in 0 ms
    1:    Linux 4.19.94-ti-r42
    Retrieving file: /boot/vmlinuz-4.19.94-ti-r42
    10095592 bytes read in 650 ms (14.8 MiB/s)
    append: console=ttyO0,115200n8 root=/dev/mmcblk1p1 ro rootfstype=ext4 coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet
    Retrieving file: /boot/dtbs/4.19.94-ti-r42/am335x-boneblack.dtb
    59483 bytes read in 6 ms (9.5 MiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8ffee000, end 8ffff85a ... OK

    Starting kernel ...

    [    0.000762] timer_probe: no matching timers found
    [    0.115132] l4_wkup_cm:clk:0010:0: failed to disable
    [    8.729922] omap_voltage_late_init: Voltage driver support not added

    Debian GNU/Linux 10 beaglebone ttyS0

    BeagleBoard.org Debian Buster IoT Image 2020-04-06

    Support: elinux.org/Beagleboard:BeagleBoneBlack_Debian

    default username:password is [debian:temppwd]

    beaglebone login:

  • I have explored two SD cards with fdisk:

    • left column: full linux image, generated with create-sdcard.sh script from SDK
    • right column: sd-card was prepared using this scenario (until p.3 in "Writing Boot Files to the SD Card")

    As you can see physical location of boot partition is different on two cards (in bold red).

    Probably the problem is here ?

    Sincerely,

    Pavel.

    Compare two sd-cards

    Command (m for help): p

    Disk /dev/sda: 14,9 GiB, 15931539456 bytes, 31116288 sectors

    Units: sectors of 1 * 512 = 512 bytes

    Sector size (logical/physical): 512 bytes / 512 bytes

    I/O size (minimum/optimal): 512 bytes / 512 bytes

    Disklabel type: dos

    Disk identifier: 0x5edeae1f

    Device Boot Start End Sectors Size Id Type

    /dev/sda1 * 2048 145407 143360 70M c W95 FAT32 (LBA)

    /dev/sda2 145408 31084543 30939136 14,8G 83 Linux

    Command (m for help): i

    Partition number (1,2, default 2): 1

    Device: /dev/sda1

    Boot: *

    Start: 2048

    End: 145407

    Sectors: 143360

    Cylinders: 71

    Size: 70M

    Id: c

    Type: W95 FAT32 (LBA)

    Start-C/H/S: 0/32/33

    End-C/H/S: 9/13/4

    Attrs: 80

    Command (m for help): i

    Partition number (1,2, default 2): 2

    Device: /dev/sda2

    Start: 145408

    End: 31084543

    Sectors: 30939136

    Cylinders: 15108

    Size: 14,8G

    Id: 83

    Type: Linux

    Start-C/H/S: 9/13/5

    End-C/H/S: 1023/254/63

    Command (m for help):

    Command (m for help): p

    Disk /dev/sda: 14,9 GiB, 15931539456 bytes, 31116288 sectors

    Units: sectors of 1 * 512 = 512 bytes

    Sector size (logical/physical): 512 bytes / 512 bytes

    I/O size (minimum/optimal): 512 bytes / 512 bytes

    Disklabel type: dos

    Disk identifier: 0xbf33e393

    Device Boot Start End Sectors Size Id Type

    /dev/sda1 * 2048 133119 131072 64M c W95 FAT32 (LBA)

    /dev/sda2 133120 31116287 30983168 14,8G 83 Linux

    Command (m for help): i

    Partition number (1,2, default 2): 1

    Device: /dev/sda1

    Boot: *

    Start: 2048

    End: 133119

    Sectors: 131072

    Cylinders: 65

    Size: 64M

    Id: c

    Type: W95 FAT32 (LBA)

    Start-C/H/S: 1/0/1

    End-C/H/S: 64/63/32

    Attrs: 80

    Command (m for help): i

    Partition number (1,2, default 2): 2

    Device: /dev/sda2

    Start: 133120

    End: 31116287

    Sectors: 30983168

    Cylinders: 15129

    Size: 14,8G

    Id: 83

    Type: Linux

    Start-C/H/S: 65/0/1

    End-C/H/S: 857/31/32

    Command (m for help):

  • HI Patel,

    At kennel prompt, what is output from

    $devmem2 0x44E10040

    Best,

    -Hong

  • Hi Hong,

    Here it is:

    root@am335x-evm:~# devmem2 0x44E10040
    /dev/mem opened.
    Memory mapped at address 0xb6f29000.
    Read at address  0x44E10040 (0xb6f29040): 0x00400338
    root@am335x-evm:~#

    By the way I also tried when booted from eMMC ...

    debian@beaglebone:~$ devmem2 0x44E10040
    -bash: devmem2: command not found
    debian@beaglebone:~$

    Sincerely,

    Pavel.

  • Hi Pavel,

    Which SW are you testing with on which board?

    If you use pre-built binaries from TI SDK package, and copy only MLO/u-boot.img to boot partition of SD card, have you tried hitting any key during u-boot boot process?

    FYI: in the log you posted earlier:

    Hit any key to stop autoboot:  0 

    Pavel Yermolenko1 said:
    root@am335x-evm:~# devmem2 0x44E10040
    /dev/mem opened.
    Memory mapped at address 0xb6f29000.
    Read at address  0x44E10040 (0xb6f29040): 0x00400338
    root@am335x-evm:~#

    => SYSBOOT[4:0] = 11000b  => boot order as SPI0 MMC0 USB0 UART0, and it should work for booting from SD card.

    Best,

    -Hong

     

     

  • Hi Hong,

    Which SW are you testing with on which board?

    Board: BBB, SW: image, transferred on sd-card while executing create_sdcard.sh from SDK.

     

    have you tried hitting any key during u-boot boot process?

    I have no keyboard, attached to BBB. Will it work when hitting on host ?

     

    => SYSBOOT[4:0] = 11000b  => boot order as SPI0 MMC0 USB0 UART0, and it should work for booting from SD card.


    According to documentation, BBB boot from SD card when button S2 is pushed on power on. And it's indeed the case: when S2 is pushed, BBB is booted from SD card, but only if there is full linux on SDK. It doesn't boot when there is only boot files on SD card. What I trying to resolve: how to boot from SD card which has only u-boot files.

    Sincerely,

    Pavel.

  • Hi Pavel,

    Pavel Yermolenko1 said:

    have you tried hitting any key during u-boot boot process?

    I have no keyboard, attached to BBB. Will it work when hitting on host ?

    Have you tried hitting any key from serial dump terminal on host?

  • Yes, I've got this:

    U-Boot SPL 2019.01-g333c3e72d3 (Apr 19 2020 - 11:21:12 +0000)
    Trying to boot from MMC1


    U-Boot 2019.01-g333c3e72d3 (Apr 19 2020 - 11:21:12 +0000)

    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net:   eth0: ethernet@4a100000
    Warning: usb_ether MAC addresses don't match:
    Address in ROM is          de:ad:be:ef:00:01
    Address in environment is  94:e3:6d:d4:ae:88
    , eth1: usb_ether
    Hit any key to stop autoboot:  0
    => md.l 0x44E10040 1
    44e10040: 00400338                               8.@.
    =>

    I'm not sure that I've got u-boot prompt. Anyway I've tried suggested command (i.e. md.l).

    Sincerely,

    Pavel.

  • Hi Pavel,

    Pavel Yermolenko1 said:
    Hit any key to stop autoboot:  0
    => md.l 0x44E10040 1
    44e10040: 00400338  

    Yes, u-boot prompt is reached as shown above.

    If you load SD card with your own SPL/u-boot build binary, time stamp shown in SPL/u-boot log banner would be updated accordingly.

    Would you go ahead close the ticket as "resolved".

    Best,

    -Hong

  • Hi Hong,

    Here in attachment, excerpt from the book Mastering Embedded Linux Programming, 2nd Ed. (By Chris Simmonds). In this excerpt, the author shows his approach how to boot from SD card, having only u-boot files (i.e. without kernel). I tried to replicate this on my BBB, but failed. I did exactly what Chris Simmonds suggested in his book. The purpose of this poste was to solve the problem of my failure where Chris Simmonds succeeded. The only difference between our cases was that Mr. Simmonds was using the v2017 branch to build u-boot while I was using the master branch. Why what was possible in 2017 is no longer possible in 2020. Also, not only in Chris Simmonds' book, but also somewhere on TI's website (I can find the link), the prompt u- boot is present as U-boot #, but not as =>. Or U-boot # is the old one, and => is it modern?

    Sincerely,

    Pavel

    extraced_pages.pdf

  • Hi Pavel,

    Yes, “=>” is u-boot prompt.

    From there typing “help” would list all u-boot cmds supported.

    Best,

    -Hong

  • Hi Hong,

    Thanks.

    Can you give your opinion why I did not succeed in booting from SD card where there were only 2 u-boot files ... the operation that Chris Simmonds did 3 years ago. What has changed during these 3 years?

    Sincerely,

    Pavel.

  • Hi Pavel,

    From your early shared log:

    >>>>

    Hit any key to stop autoboot:  0
    => md.l 0x44E10040 1
    44e10040: 00400338  

    <<<

    you booted to u-boot prompt "=>". Have you tried to type in "help" at u-boot prompt.

    Best,

    -Hong

  • Hi Hong,

    Yes I tried help and I'm assured that when I type at the start of boot, I switch to u-boot prompt.

    But according to Chris Simmonds, if on the SD card there is no kernel (i.e. only u-boot files), the user does not need to type when powering on and the system alone manages to switch to u-boot prompt - operation I failed to reproduce.

    Have you any explanation on this ?

    Another issue: in his book Chris Simmonds uses some commands that I didn't find in "help" list. One of them nand command, e.g.

    nand read 82000000 200000 400000

    Does exist a document that compares "old" and "modern" versions of u-boot ?

    Sincerely,

    Pavel.

  • Hi Pavel, 

    You’ll find many online reference guide covering more details on on u-boot/Linux… 

    For your specific questions:

    1. How to disable autoboot in u-boot.

    u-boot is normally configured, and built with autoboot with timeout of few seconds.

    For your quick test w/o rebuilding u-boot. run below cmds at u-boot prompt, and then power-cycle your board. This would let u-boot stops at u-boot prompt.

    Hit any key to stop autoboot:  0
    => printenv bootdelay
    bootdelay=2
    => setenv bootdelay -1
    => printenv bootdelay
    bootdelay=-1
    => saveenv
    Saving Environment to FAT... OK
    =>
    

    2. u-boot prompt

    It is customizable by user define via “CONFIG_SYS_PROMPT”, i.e. “#u-boot”, “=>”, or whatever “#u-boot_xyz”. 

    3. u-boot cmds

    u-boot cmd set supported depends on how u-boot is built for specific configuration and boards etc…

    Best,

    -Hong

    PS: if your original questions are addressed, please go ahead close the e2e thread.

  • Hi Hong,

    You’ll find many online reference guide covering more details on on u-boot/Linux…

    PS: if your original questions are addressed, please go ahead close the e2e thread.

    I really appreciated your help and your skills. The only issue (which in my opinion is closely related to this thread) that remains unresolved is:

    How should BBB behave upon Power On when S2 button is pressed and on the SD card there are only 2 files in the boot partition (MLO and u-boot.img) ... without any actions from user ?

    Do you consider that I can get an answer to this issue in this thread, or should I create a new one?

    u-boot cmd set supported depends on how u-boot is built for specific configuration and boards etc…

    Does it mean that I could find a document (probably somewhere on the web) that lists all commands of a particular release of u-boot (2017 in my case) ?

    Or should I build u-boot v2017 to see its set of commands ?

    Sincerely,

    Pavel.

  • Hi Pavel,

    Pavel Yermolenko1 said:
    How should BBB behave upon Power On when S2 button is pressed and on the SD card there are only 2 files in the boot partition (MLO and u-boot.img) ... without any actions from user ?

    Based on your log, u-boot booted from mmc0(SD), try to load kennel from mmc0(SD) w/o success, then switch to mmc1 (eMMC)... This booting sequence is configured in environment variable built into the u-boot you're using.

    Have you tried cmds in my previous post to disable u-boot autoload? or you can build your u-boot to disable autoload.

    mmc0 is current device 
    SD/MMC found on device 0 
    Failed to load '/boot/zImage' 
    switch to partitions #0, OK 
    mmc1(part 0) is current device 
    Scanning mmc 1:1... 
    Found /boot/extlinux/extlinux.conf

    Pavel Yermolenko1 said:

    Does it mean that I could find a document (probably somewhere on the web) that lists all commands of a particular release of u-boot (2017 in my case) ?

    Or should I build u-boot v2017 to see its set of commands ?

    The u-boot cmd set supported depends on u-boot release, configuration used for building u-boot...

    Best,

    -Hong

  • Hi Hong,

    Thanks !!!

    It's what I looked for.

    Perhaps in the case of Chris Simmonds (2017's u-boot release) there was some option that stops at u-boot if it doesn't find kernel.

    Sincerely,

    Pavel.