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.

Recovering u-boot

Other Parts Discussed in Thread: AM3517

I have the logicpd experimenter kit with the AM3517 chip.  I've accidentally overwrote the u-boot section of NAND, and now it doesn't boot anymore.  Does anyone know how to recover u-boot?

I should have asked this first before attempting to modify NAND, but is there a place I can find out the memory map for where x-loader, uboot, and linux is loaded to by default?

  • In the PSP release there is a scripts section a script for reflashing the board called reflash-micron.txt.  You can find the offsets of where to put the files here. This script assumes you already have u-boot running though.  Do you only need the memory map?

  • Thanks for the quick response.

    I was able to get into u-boot from booting from the mmc card following this guide:  http://processors.wiki.ti.com/index.php/AM35x_EVM_Boot_from_SD/MMC_card

    I will try to run the reflash-micron.txt script in u-boot now to see if everything will be restored

  • Gerald,

    Your last 2 posts did not make it into the thread.

    You said that your u-boot was corrupted, is the stored environment corrupted? Does u-boot work at all?

    The other post you had about root fs not mounting might point to a corrupted u-boot env. If you could, please post the results of the u-boot printenv command.

  • Hi,

    I'm just having trouble booting the linux kernel, mainly an issue with the rootfs not being linked properly to the filesystem used.

    Below are the error messages from booting the kernel, and my printenv of my u-boot parameters.

     

    modprobe: FATAL: Could not load /lib/modules/2.6.32/modules.dep: No such file or directory

    modprobe: FATAL: Could not load /lib/modules/2.6.32/modules.dep: No such file or directory

    0: mount: mounting rootfs on / failed: No such file or directory
    modprobe: FATAL: Could not load /lib/modules/2.6.32/modules.dep: No such file or directory

    0: mount: mounting usbfs on /proc/bus/usb failed: No such file or directory
    chown: unknown user/group root:root
    chown: unknown user/group root:root
    chown: unknown user/group root:root
    chown: unknown user/group root:root
    chown: unknown user/group root:root
    chown: unknown user/group root:root
    chown: unknown user/group root:root
    chown: unknown user/group root:root
    chown: unknown user/group root:root
    chown: unknown user/group root:root
    chown: unknown user/group root:root

     

     

    AM3517_EVM # printenv
    bootcmd=if mmc init; then if run loadbootscript; then run bootscript; else if ru                                                                                                 n loaduimage; then run mmcboot; else run nandboot; fi; fi; else run nandboot; fi
    bootdelay=10
    baudrate=115200
    bootfile=uImage
    loadaddr=0x82000000
    console=ttyS2,115200n8
    mmcargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 rw rootfstype=ext                                                                                                 3 rootwait
    nandargs=setenv bootargs console=${console} root=/dev/mtdblock4 rw rootfstype=jf                                                                                                 fs2
    loadbootscript=fatload mmc 0 ${loadaddr} boot.scr
    bootscript=echo Running bootscript from mmc ...; source ${loadaddr}
    loaduimage=fatload mmc 0 ${loadaddr} uImage
    nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr} 280000                                                                                                  400000; bootm ${loadaddr}
    dieid#=44c00000000000000154417b01020007
    ethact=DaVinci EMAC
    ethaddr=eth0
    serverip=192.168.1.100
    ipaddr=192.168.1.104
    rf_blank_ram=mw.b 0x82000000 0xff 0x2000000
    rf_er_xloader=nand erase 0 80000
    rf_er_uboot=nand erase 80000 1e0000
    rf_er_env=nand erase 260000 20000
    rf_er_kernel=nand erase 280000 500000
    rf_er_ramdisk=nand erase 780000 2000000
    rf_er_fs=nand erase 780000 2000000
    rf_get_xloader=tftpboot 0x82000000 images/boot-strap/am3517/x-load.bin.ift
    rf_get_uboot=tftpboot 0x82000000 images/u-boot/am3517/u-boot.bin
    rf_get_kernel=tftpboot 0x82000000 images/kernel/am3517/uImage
    rf_get_ramdisk=tftpboot 0x82000000 images/fs/am3517/ramdisk.gz
    rf_get_min_rd=tftpboot 0x82000000 images/fs/ramdisk-base.gz
    rf_get_fs=tftpboot 0x82000000 images/fs/am3517/rootfs.jffs2
    rf_wr_xloader=nandecc hw; nand write.i 0x82000000 0 80000
    rf_wr_uboot=nandecc sw; nand write.i 0x82000000 80000 1e0000
    rf_wr_kernel=nandecc sw; nand write.i 0x82000000 280000 500000
    rf_wr_ramdisk=nandecc sw; nand write.i 0x82000000 780000 2000000
    rf_wr_fs=nandecc sw; nand write.i 0x82000000 780000 2000000
    rf_ev=run rf_er_env
    rf_xl=run rf_blank_ram; run rf_er_xloader; run rf_get_xloader; run rf_wr_xloader
    rf_ub=run rf_blank_ram; run rf_er_uboot; run rf_get_uboot; run rf_wr_uboot
    rf_kn=run rf_blank_ram; run rf_er_kernel; run rf_get_kernel; run rf_wr_kernel
    rf_rd=run rf_blank_ram; run rf_er_ramdisk; run rf_get_ramdisk; run rf_wr_ramdisk
    rf_min_rd=run rf_blank_ram; run rf_er_ramdisk; run rf_get_min_rd; run rf_wr_ramd                                                                                                 isk
    rf_fs=run rf_blank_ram; run rf_er_fs; run rf_get_fs; run rf_wr_fs
    rf_all_rd=run rf_xl; run rf_ub; run rf_kn; run rf_rd
    rf_all_min_rd=run rf_xl; run rf_ub; run rf_kn; run rf_min_rd
    rf_all_fs=run rf_xl; run rf_ub; run rf_kn; run rf_fs
    mmcboot=mmc init; fatload mmc 0 0x80000000 uImage; bootm 0x80000000
    bootargs=mem=256M console=ttyS2,115200n8 noinitrd root=/dev/mtdblock4 rw rootfst                                                                                                 ype=jffs2 omapfb.rotate=1 omapfb.rotate_type=1 omap_vout.vid1_static_vrfb_alloc=                                                                                                 y
    stdin=serial
    stdout=serial
    stderr=serial

  • I also tried booting the kernel from the MMC card with the ramdisk image on the MMC card by issuing the following commands as suggested on the AM3517 user guide:

     

    mmc init
    $ fatload mmc 0 0x80000000 uImage
    $ fatload mmc 0 0x80000000 ramdisk.gz
    $ setenv bootargs 'mem=128M console=ttyS0,115200n8 root=/dev/ram0
    initrd=0x82000000,40M ramdisk_size=32768 ip=dhcp'
    $ bootm 0x80000000

    but it doesn't work.  I get an error message saying the kernel image couldn't be found, or loaded. 

    "Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    "

    What confuses me is that the loading address of both the uImage and ramdisk.gz are at the same memory locations, which I think is the reason why I'm getting this error.

  • In what was typed above, ramdisk.gz overwrote the kernel in memory. If you look at the bootargs you see initrd=0x82000000 that tells the kernel that the initial ramdisk is located at 0x82000000.  So instead, type in

    mmc init
    $ fatload mmc 0 0x80000000 uImage
    $ fatload mmc 0 0x82000000 ramdisk.gz
    $ setenv bootargs 'mem=128M console=ttyS0,115200n8 root=/dev/ram0
    initrd=0x82000000,40M ramdisk_size=32768 ip=dhcp'
    $ bootm 0x80000000

    And the board should boot.

    Steve K.