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.

uboot loops before booting

Saw this on the default starterkit as well as our own custom uboot for a 3352 board.

It loops several times before finally loading the kernel from SD. Spends about 30 seconds of a 45 second total boot just looping.

We're only using mmc boot, how do I remove any extra attempts?

Thanks!

  • I've increased the autoboot timeout to 10 seconds, and it will loop at around 8 seconds left every time. 

  • How is it looping? Can you post a the output from the console? Or do you mean that is it trying other boot media beforr trying SD Card? Check your u-boot environment variables. Particularily the bootcmd variable.

  • here's the bootcommand from source. I'm cloning my sd right now, so I can't give a good copy/paste until that's done

    #define CONFIG_BOOTCOMMAND \

    "if mmc rescan ${mmcdev}; then " \
    "echo SD/MMC found on device ${mmcdev};" \
    "if run loadbootenv; then " \
    "echo Loaded environment from ${bootenv};" \
    "run importbootenv;" \
    "fi;" \
    "if test -n $uenvcmd; then " \
    "echo Running uenvcmd ...;" \
    "run uenvcmd;" \
    "fi;" \
    "if run loaduimagefat; then " \
    "run mmcboot;" \
    "elif run loaduimage; then " \
    "run mmcboot;" \
    "else " \
    "echo Cound not find ${bootfile} ;" \
    "fi;" \
    "else " \
    "echo run nandboot;" \
    "fi;" \

  • We're only ever going to boot from mmc, it's like mmc isn't ready or something until the last instance?

    SD/MMC found on device 0
    reading uEnv.txt

    ** Unable to read "uEnv.txt" from mmc 0:1 **
    reading uImage

    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    OMAP SD/MMC: 0
    reading
    ing u-boot.

    U-Boot 2012.10-00075-g161 (Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev

    phydev: pâæx£ú

    phydev: pâæø£x£ú
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæx£úú£

    phydev: pâæxâ£ú

    phydev: pâæx£úú£
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-adtrap (Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæxâ£ú

    phydev: pâæx£úú£

    phydev: pâæxâ£ú
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-adtrap (Feb 25 2013 - 12:17:58)
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæx£úú£

    phydev: pâæxâ£ú

    phydev: pâæx£úú£
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63- (Feb 25 2013 - 12:17:58)
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæxâ£ú

    phydev: pâæx£úú£

    phydev: pâæxâ£ú
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæx£úú£

    phydev: pâæxâ£ú

    phydev: pâæx£úú£
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæxâ£ú

    phydev: pâæx£úú£

    phydev: pâæxâ£ú
    cpsw
    Hit any key to stop autoboot: 0
    devname: cpsw
    addr: 00
    devname: cpsw
    addr: 01
    devname: cpsw
    addr: 00
    devname: cpsw
    addr: 01
    devname: cpsw
    addr: 00
    devname: cpsw
    addr: 01
    SD/MMC found on device 0
    reading uEnv.txt

    ** Unable to read "uEnv.txt" from mmc 0:1 **
    reading uImage

    2486584 bytes read
    Booting from mmc ...
    ## Booting kernel from Legacy Image at 80007fc0 ...

  • I'm not familiar with the 3352 processor. Some guesses until more knowledgable folks can comment. Looks like you have stripped down u-boot as the first bootloader. That one looks to be fairly consistent. The double prints of "reading u-boot.img" is a bit of a concern but I will assume it's a printing glitch.

    Most of the time, the second u-boot does not appear to even get to executing the bootcmd. The first line of the bootcmd is to echo "SD/MMC found on device 0". The spontaneous restart back to the first bootloader has all the appearances of a watchdog resetting the processor. I suspect too much time is spent bringing up the network driver - phydev and cpsw. Maybe try disabling the watchdog in the second u-boot. Or maybe try removing the network component from the second u-boot.

  • awesome, that makes sense. thanks! i'm going to copy the wdt kickoff to earlier in the code, it's pretty high up in s_init 

  • added a printf so I can verify when the function was called that contains the wdt reset.  And it's loading right as SPL loads.

    I'm going to have to say that it's not WDT unless the ti provided reset code isn't correct.

    /* WDT1 is already running when the bootloader gets control
    * Disable it to avoid "random" resets
    */

    printf("am33xx_spl_board_init wdt\n");
    /* WDT1 is already running when the bootloader gets control
    * Disable it to avoid "random" resets
    */
    writel(0xAAAA, &wdtimer->wdtwspr);
    while (readl(&wdtimer->wdtwwps) != 0x0)
    ;
    writel(0x5555, &wdtimer->wdtwspr);
    while (readl(&wdtimer->wdtwwps) != 0x0)
    ;



    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    am33xx_spl_board_init wdt
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæÀâ£ú

    phydev: pâæÀ£úú£

    phydev: pâæÀâ£ú
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    am33xx_spl_board_init wdt
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæÀ£úú£

    phydev: pâæÀâ£ú

    phydev: pâæÀ£úú£
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    am33xx_spl_board_init wdt
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæÀâ£ú

    phydev: pâæÀ£úú£

    phydev: pâæÀâ£ú
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    am33xx_spl_board_init wdt
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæÀ£úú£

    phydev: pâæÀâ£ú

    phydev: pâæÀ£úú£
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    am33xx_spl_board_init wdt
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæÀâ£ú

    phydev: pâæÀ£úú£

    phydev: pâæÀâ£ú
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    am33xx_spl_board_init wdt
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63- (Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæÀ£úú£

    phydev: pâæÀâ£ú

    phydev: pâæÀ£úú£
    cpsw
    Hit any key to stop autoboot: 1
    U-Boot SPL 2012.10-00075-g1611a63-(Feb 25 2013 - 12:17:58)
    am33xx_spl_board_init wdt
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2012.10-00075-g1611a63- (Feb 25 2013 - 12:17:58)

    I2C: ready
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Using default environment

    Net: board.c phydev: 0

    phydev: pâæÀâ£ú

    phydev: pâæÀ£úú£

    phydev: pâæÀâ£ú
    cpsw
    Hit any key to stop autoboot: 0

  • Maybe the second u-boot is reenabling the watchdog. Is is possible to remove the network driver from the second u-boot? Those lines of phydev with garbage characters look iffy. Uninitialized buffer? Something's not quite right. Maybe the network driver need to board to be plugged into the network. Shouldn't need to though.

  • those phydev lines are printfs i havent removed yet.  both phys are connected,  the log doesnt show it, but its in the autoboott countdown when it cycles, past the net init. 

  • Okay...read up a bit to talk the same lingo. The first u-boot is called MLO and has SPL in it's banner. The second u-boot is the usual u-boot. I don't see many ways for u-boot to vector off to the MLO other than by a reset or reboot. An exception in the code might I guess. Depends on how the exception is handled. Floating reset pin? Probably not. Once booted into Linux, presumably you don't see spontaneous resets. That's all I got.

  • i understand the lingo just fine.  Thats where I'm at with it too, I'm going to jtag and code step it out. I was hoping that somebody here would already know since the am355x starter kit does the same thing.