[beagleboard] HELP with USB recovery, minicom and kermit UART upload options

Hi, I have bricked my beagle board trying to install musb gadget u-boot in NAND.

Recovery from SD card doesn’t work, no matter what I do, following http://elinux.org/BeagleBoardRecovery. I don’t even get the …40T… string on minicom (1152008N1, on /dev/ttyUSB0 using FTDI serial USB converter). I tried pressing user button on powerup, using USB or DC supply power, etc … to no avail. Previously working SDcards don’t work anymore, and reformatting from scratch, using MLO_restore written first on the SD, etc … doesn’t work either. Hence I’m left with USB recovery. That, at least, seems to work for first step : getting U-boot V2 prompt. I can download the enclosed uboot.bin file (binary from http://groups.google.com/group/beagleboard/browse_thread/thread/be194f345b55a887?pli=1, following the link on beagle recovery page). I get u-boot prompt, but can’t upload u-boot (V1) via UART as indicated in the tutorial.
First, help command doesn’t work. Second, loadb works, with option -f instead of -d. Probably a slightly different version. I then get stuck trying to upload u-boot.bin (V1) via minicom and kermit (installed both gkermit and ckermit). When I lauch the ctrl-A S command, selecting kermit and then file u-boot.bin, there is no activity on the serial line (I have leds on the usb-serial converter) and I have to kill the transfer using ctrl-c. I copied the whole minicom log below.
I suspect my kermit and minicom options are not correct (I am not all that familiar with those tools). Could someone help me with those ?? I suspect one has to set minicom “transfer protocols” option G for minicom, and possibly some modem options too in minicom, and the .kermrc file.
I thank you in advance for your help and concern.

Laurent

My kermit version is the following :
C-Kermit 8.0.211, 10 Apr 2004, for Linux
Copyright © 1985, 2004,
Trustees of Columbia University in the City of New York.
Type ? or HELP for help.

USB boot (I have to sudo it for it to work).
perseus@perseus:~/tmp/omap3_usb/host$ sudo ./omap3_usbload uboot.bin
then try to upload
TI OMAP3 USB boot ROM tool, version 0.1
© 2008 Martin Mueller <martinmm@pfump.org>

found device!
download ok

Then in minicom (run as root, just in case) :

U-Boot 2.0.0-rc5-git-00309-g716b432 (Sep 9 2008 - 16:25:32)

Board: Texas Instrument’s Beagle
Malloc space: 0x87bfff10 → 0x87ffff10 (size 4 MB)
Stack space : 0x87bf7f10 → 0x87bfff10 (size 32 kB)
running /env/bin/init…
not found
X-load Beagle>help
Unknown command ‘help’ - try ‘help’
X-load Beagle>help loadb
Unknown command ‘help’ - try ‘help’
X-load Beagle>devinfo
devices:

----uart3
----ram0
----filesystem: /
----filesystem: /dev

drivers:
serial_ns16550
ramfs
devfs
ram
X-load Beagle>loadb -d/dev/ram0
loadb: invalid option – d
loadb returned with -2
X-load Beagle>loadb -f/dev/ram0

Ready for binary (kermit) download to 0x00000000 offset on /dev/ram0 device at 115200 bps…

Stuck here, pressing ctrl-C

Total Size = 0x00000000 = 0 Bytes

Binary (kermit) download aborted

uboot.bin (35.8 KB)

Hi,

I’m not really sure I have understood where is your pb :

  • you can’t boot anything ?
  • when you boot the uboot on your SD card that doesn’t work ?
  • something else ??

For the first pb you can try to boot from the serial port and reflash your NAND from there, you can follow the explanation on :
http://github.com/nmenon/omap-u-boot-utils/tree/master

for the second, are you sure you have built correctly the last uboot version and signed it ?

for the 3rd,sorry If this was useless to you

cheers,

Maxime

maxime louvel said the following on 01/29/2009 04:38 AM:

Hi,

I'm not really sure I have understood where is your pb :
- you can't boot anything ?
- when you boot the uboot on your SD card that doesn't work ?
- something else ??

For the first pb you can try to boot from the serial port and reflash
your NAND from there, you can follow the explanation on :
http://github.com/nmenon/omap-u-boot-utils/tree/master

or maybe look for prebuilt images here:
http://code.google.com/p/omap-u-boot-utils/

    Hi, I have bricked my beagle board trying to install musb gadget
    u-boot in NAND.

    Recovery from SD card doesn't work, no matter what I do, following
    http://elinux.org/BeagleBoardRecovery. I don't even get the
    ....40T...... string on minicom (1152008N1, on /dev/ttyUSB0 using
    FTDI serial USB converter). I tried pressing user button on
    powerup, using USB or DC supply power, etc .. to no avail.
    Previously working SDcards don't work anymore, and reformatting
    from scratch, using MLO_restore written first on the SD, etc ..
    doesn't work either. Hence I'm left with USB recovery. That, at
    least, seems to work for first step : getting U-boot V2 prompt. I
    can download the enclosed uboot.bin file (binary from
    http://groups.google.com/group/beagleboard/browse_thread/thread/be194f345b55a887?pli=1,
    following the link on beagle recovery page). I get u-boot prompt,
    but can't upload u-boot (V1) via UART as indicated in the tutorial.
    First, help command doesn't work. Second, loadb works, with option
    -f instead of -d. Probably a slightly different version. I then
    get stuck trying to upload u-boot.bin (V1) via minicom and kermit
    (installed both gkermit and ckermit). When I lauch the ctrl-A S
    command, selecting kermit and then file u-boot.bin, there is no
    activity on the serial line (I have leds on the usb-serial
    converter) and I have to kill the transfer using ctrl-c. I copied
    the whole minicom log below.
    I suspect my kermit and minicom options are not correct (I am not
    all that familiar with those tools). Could someone help me with
    those ?? I suspect one has to set minicom "transfer protocols"
    option G for minicom, and possibly some modem options too in
    minicom, and the .kermrc file.
    I thank you in advance for your help and concern.

                Laurent

    My kermit version is the following :
    C-Kermit 8.0.211, 10 Apr 2004, for Linux
     Copyright (C) 1985, 2004,
      Trustees of Columbia University in the City of New York.
    Type ? or HELP for help.

    USB boot (I have to sudo it for it to work).
    perseus@perseus:~/tmp/omap3_usb/host$ sudo ./omap3_usbload uboot.bin
     then try to upload
    TI OMAP3 USB boot ROM tool, version 0.1
    (c) 2008 Martin Mueller <martinmm@pfump.org
    <mailto:martinmm@pfump.org>>

    ......................................

    found device!
    download ok

    Then in minicom (run as root, just in case) :

    U-Boot 2.0.0-rc5-git-00309-g716b432 (Sep 9 2008 - 16:25:32)

    Board: Texas Instrument's Beagle
    Malloc space: 0x87bfff10 -> 0x87ffff10 (size 4 MB)
    Stack space : 0x87bf7f10 -> 0x87bfff10 (size 32 kB)
    running /env/bin/init...
    not found
    X-load Beagle>help
    Unknown command 'help' - try 'help'
    X-load Beagle>help loadb
    Unknown command 'help' - try 'help'
    X-load Beagle>devinfo
    devices:
    >----uart3
    >----ram0
    >----filesystem: /
    >----filesystem: /dev

    drivers:
    serial_ns16550
         ramfs
         devfs
           ram
    X-load Beagle>loadb -d/dev/ram0
    loadb: invalid option -- d
    loadb returned with -2
    X-load Beagle>loadb -f/dev/ram0
    ## Ready for binary (kermit) download to 0x00000000 offset on
    /dev/ram0 device at 115200 bps...
    Stuck here, pressing ctrl-C
    ## Total Size = 0x00000000 = 0 Bytes
    ## Binary (kermit) download aborted

you could try using ucmd, ukermit as in omap-uboot-utils.. also see the
steps which I believe should work in
http://nishanthmenon.blogspot.com/2008/12/towards-creating-beagleboard-nand.html

$1=/dev/ttyS0
pserial -p $1 -f images/u-boot-v2-serial.bin
#OR use pusb for doing downloading u-boot v2 .
ucmd -p $1 -c "loadb -f /dev/ram0" -e "bps..."
ukermit -p $1 -f images/u-boot-v1.bin
ucmd -p $1 -c "go 0x80000000" -e "autoboot"
ucmd -p $1 -c "help" -e "#"

#write u-boot.bin to nand flash:
ucmd -p $1 -c "nandecc sw" -e "#"
ucmd -p $1 -c "nand erase 80000 80000" -e "#"
ucmd -p $1 -c "nand write.i 80000000 80000 80000" -e "#"

#now load up x-loader to write to flash.
ucmd -p $1 -c "loadb 0x80000000" -e "bps..."
ukermit -p $1 -f images/x-load.bin.ift
#flash x-loader.bin.ift
ucmd -p $1 -c "nand unlock" -e "#"
ucmd -p $1 -c "nandecc hw" -e "#"
ucmd -p $1 -c "nand erase 0 80000" -e "#"
ucmd -p $1 -c "nand write.i 80000000 0 80000" -e "#"

once u-boot-v1 changes done are integrated to the mainline, I will try
and create a shell script for running this which could be run at command
prompt.. mebbe koen or someone could help write a recipe for the
individual components sometime?

Regards,
Nishanth Menon

Hi I had the same problem and fixed it with that script that I
made ::::::

I had to run the script two times ?? I'm checking that right now. I
think that for example if I run it with first partition ended to 50 it
failed and 51 (echo 51 fdisk option ) it passed. I was doing some test
with it and it seem that if I change to 50 try into beagle it failed,
change to 51 try it to beagle it failed and rerun the script with 51,
try it to beagle it works. I think that I have a bad understanding of
fdisk. I mean that if I change the partition size then remount should
I do a sync or something different before remounting... If I found the
problem I will tell you.

I post those details in that post but I don't now why it is not
publish yet?
http://groups.google.com/group/beagleboard/browse_thread/thread/472abb7bf6e87b8e/839d70f87b6f244d?lnk=gst&q=latest+u-boot#

That script help me to run on the SD musb_gadget-u-boot.bin by holding
USER button to switch to MMC boot mode.

I download files from
http://code.google.com/p/beagleboard/downloads/list

#!/bin/sh

# Environment variables
SD_PATH="/dev/mmcblk0"
SD_P1_PATH="/dev/mmcblk0p1"
SD_P2_PATH="/dev/mmcblk0p2"

# SD validation.
SD_INSERT="SD insert test: "

if [ -e $SD_PATH ]
then
    echo "--> ${SD_INSERT} OK"
else
    echo "--> ${SD_INSERT} FAILED"
    echo "--> SD not inserted!"
    exit $?
fi

# Mount validation for p1.
MOUNT_P1="SD P1 mount test: "

if [ -n "`mount | grep /dev/mmcblk0p1`" ]
then
    echo "--> ${MOUNT_P1} FAILED"
    echo "--> sudo umount ${SD_P1_PATH}"
    sudo umount $SD_P1_PATH
else
    echo "--> ${MOUNT_P1} OK"
fi

# Mount validation for p1.
MOUNT_P2="SD P2 mount test: "

if [ -n "`mount | grep /dev/mmcblk0p2`" ]
then
    echo "--> ${MOUNT_P2} FAILED"
    echo "--> sudo umount ${SD_P2_PATH}"
    sudo umount $SD_P2_PATH
else
    echo "--> ${MOUNT_P2} OK"
fi

# Disk /dev/mmcblk0: 1977 MB, 1977614336 bytes
# 1977614336/255/63/512 = 240.431248055 = FLOOR = 240
# Create partition backup: sfdisk -H 255 -S 63 -C 240 --d /dev/mmcblk0

sd-beagleboard-partition.out

# Create partition
# echo "--> Create SD partition: sfdisk -H 255 -S 63 -C 240 --force /
dev/mmcblk0 < sd-beagleboard-partition.out"
# sfdisk -H 255 -S 63 -C 240 --force /dev/mmcblk0 < sd-beagleboard-
partition.out

fdiskCommands()
{
   echo d
   echo 1
   echo d
   echo 2
   echo n
   echo p
   echo 1
   echo
   echo 51
   echo t
   echo c
   echo a
   echo 1
   echo n
   echo p
   echo 2
   echo
   echo
   echo t
   echo 2
   echo 83
   echo w
}

echo "--> Create partitions on SD card."
fdiskCommands | fdisk -C 240 -H 255 -S 63 /dev/mmcblk0

# Format the partitions
echo "--> Format SD P1 into FAT32: sudo mkfs.msdos -F 32 /dev/
mmcblk0p1 -n boot"
sudo mkfs.msdos -F 32 /dev/mmcblk0p1 -n boot

echo "--> Format SD P2 into ext3: sudo mkfs.ext3 -L rootfs /dev/
mmcblk0p2"
sudo mkfs.ext3 -L rootfs /dev/mmcblk0p2

# Mount newly formated partition:
echo "--> Mount newly formated partition"
sudo mount /dev/mmcblk0p1 /mnt/boot
sudo mount /dev/mmcblk0p2 /mnt/rootfs

# IMPORTANT TO DO THIS BEFORE ANY OTHER FILES ARE COPIED:
# Copy the MLO file that you downloaded to the Beagle_Boot partition.
# The MLO file must be the first file copied to the partition after re-
formatting.
echo "--> Copy MLO to boot partition."
sudo cp /home/kapare/beagleboard/sd/boot/MLO_restore /mnt/boot/MLO

echo "--> Copy u-boot to boot partition."
# sudo cp /home/kapare/beagleboard/sd/boot/u-boot.bin_autoflash /mnt/
boot/u-boot.bin
sudo cp /home/kapare/beagleboard/sd/boot/musb_gadget-u-boot.bin /mnt/
boot/u-boot.bin

echo "--> umount partitions."
sync
sudo umount /dev/mmcblk0p1 /dev/mmcblk0p2

Hi, in fact, the problem is that I can't transfer files via UART to Beagle using Minicom and Kermit. I need that for USB recovery. Hence I would like someone to give me the correct settings and procedure on Minicom and Kermit (or any other serial tools) to upload binary files to Beagle .

As for my board, it doesn't boot on its own, over NAND or SD, but I can get a limited u-boot V2 (light, and without NAND support) prompt on minicom, with u-boot V2 loaded to SRAM using usb boot. I need minicom and kermit to upload from there the "normal" u-boot.bin (V1) to ram, after running a loadb command on the beagle ... To be able to reformat flash and complete recovery.

I will also try the methods by kpare and maxime louvel, SD or serial boot SHOULD work.
Thank you for your help.

      Laurent

-----Message d'origine-----

A) use ckermit to do it:
from u-boot/tools/scripts/send_image: (modified): copy the following
to a script send_image, chmod +x send_image
#!/usr/bin/kermit +
# usage: send_image FILE_NAME
# e.g. send_image output.bin
set line /dev/ttyS0
set speed 115200
set serial 8N1
set carrier-watch off
set handshake none
set flow-control none
robust
set file type bin
set file name lit
set rec pack 1000
set send pack 1000
set window 5
set prompt Kermit>
send \%1
out \13
quit
exit 0

open minicom -> run command loadb -f "/dev/ram0"
then press ctrl+a, q to quit without reset.
then:
./send_image u-boot.v1.bin

B) use omap-uboot-utils:

ucmd -p /dev/ttyS0 -c "loadb -f /dev/ram0" -e "bps..."
ukermit p /dev/ttyS0 -f u-boot-v1.bin
it will run loadb command and should download u-boot.v1.bin file.
Regards,
Nishanth Menon

Thank you very much to maxime louvel, Nisnanth and kapare for the suggestions and scripts. I successfully unbricked my board thanks to your help. I don’t know what exactly was wrong with my MMC formatting, possibly just proper syncing and unmounting, but now it works … and serial transfers also do.
Thanks again

Laurent

2009/1/29 Nishanth Menon <menon.nishanth@gmail.com>

Thank you very much to maxime louvel, Nisnanth and kapare for the suggestions and scripts. I successfully unbricked my board thanks to your help. I don’t know what exactly was wrong with my MMC formatting, possibly just proper syncing and unmounting, but now it works … and serial transfers also do.
Thanks again

Laurent

Summarizing the process on a wiki page for others to follow would be greatly appreciated.

Hi Jason,

I can do this and others can verify and validate the doc. Where do you
suggest to do this eLinux or http://code.google.com/p/beagleboard/w/list.
Maybe simply by adding more details in http://elinux.org/BeagleBoardRecovery

Regards

kap

Would suggest adding more details to http://elinux.org/BeagleBoardRecovery
since that is people go and will run into the same issues.

-Atin

Would suggest adding more details tohttp://elinux.org/BeagleBoardRecovery
since that is people go and will run into the same issues.

I agree this is the best approach. Once things are more stable, then
an entry in the code.google.com site would make sense.

Done!
http://elinux.org/BeagleBoardRecovery#MMC_recovery_Troubleshooting

kap