OpenWrt Forum Archive

Topic: uboot / defekt image

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,
i am using 2 AccesPoint . They use uboot to boot there image, but one of them will not successfully boot.

The Bootlog looks like this:

Setting 0x181162c0 to 0x274e2100
Hit any key to stop autoboot:  2  1  0 
## Booting image at 9f050000 ...
   Image Name:   MIPS OpenWrt Linux-3.10.49
   Created:      2017-03-31   9:42:31 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    979111 Bytes = 956.2 kB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x9f050040 ...OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
mem=126M## Giving linux memsize in bytes, 132120576
enable watchdog
feed the  watchdog with 0xffffffff

I can connect to them with serialcable.
Now i would like to know if it is possible to donwload the image from the functional AP and transfer it to the other one.
But i don't know how to transfer the image stored at 9f050000. I tried tftp but it didnt work.
Maybee s.o. can help?

Thanks a lot
Tobias

Uboot doesn't really support a bulk transfer out of the device.  There are scripts that use repeated md commands and convert to binary.

If you have shell access to the one that works, use OpenWrt to copy the firmware partition to a file.

Thanks for your replay,
could you please tell me how to copy it with openwrt?

Thanks a lot

tobias

First find out which mtd partition is the firmware:

root@WA-701:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00010000 "u-boot"
mtd1: 00132e2c 00010000 "kernel"
mtd2: 00e9d1d4 00010000 "rootfs"
mtd3: 00c80000 00010000 "rootfs_data"
mtd4: 00010000 00010000 "art"
mtd5: 00fd0000 00010000 "firmware"

Then block copy the firmware to a file on the RAM disk:

cat /dev/mtd5 > /tmp/firmware.bin

Then you would scp the firmware.bin to your PC and set up a TFTP server so you can use uboot to move it into the other router.

Thanks a lot, but i can not use cat:
The commands i can use are:

ath> cat /procUnknown command 'cat' - try 'help'
ath> ??       - alias for 'help'
autoscr - run script from memory
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp.- boot image via network using BootP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dhcp.- invoke DHCP client to obtain IP/boot params
echo    - echo args to console
erase   - erase FLASH memory
ethreg  - Switch/PHY Reg rd/wr  utility
exit    - exit script
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print online help
iminfo  - print header information for application image
itest.- return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
mct   - simple RAM test
md      - memory display
mii     - MII utility commands
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nfs.- boot image via network using NFS protocol
nm      - memory modify (constant address)
partool     - Partool utility commands
pci     - list and access PCI Configuration Space
ping.- send ICMP ECHO_REQUEST to network host
pll cpu-pll dither ddr-pll dither - Set to change CPU & DDR speed
pll erase
pll get
printenv- print environment variables
progmac - Set ethernet MAC addresses
progmac2 - Set ethernet MAC addresses
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
version - print monitor version

The Version is:

ath> version
U-Boot 1.1.4.v1.2 (Aug 30 2016 - 16:00:23)

The envirements are:

ath> printenv
bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init 
bootcmd=bootm 0x9f050000
bootdelay=2
baudrate=115200
ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
dir=
lu=tftp 0x80060000 "hos-r21-boot.bin" && erase 0x9f000000 +$filesize && cp.b 0x80060000 0x9f000000 $filesize
ls=tftp 0x80060000 "hos-r21-sysupgrade.bin" && erase 0x9f050000 +0xd90000 && cp.b 0x80060000 0x9f050000 0xd90000
ethact=eth0
ipaddr=192.168.1.1
serverip=192.168.1.100
lk=tftp 0x80060000 hos-r21-kernel.bin && erase 0x9f050000 +0x180000 && cp.b 0x80060000 0x9f050000 0x180000
lf=tftp 0x80060000 hos-r21-rootfs.bin && erase 0x9f1d0000 +0xc10000 && cp.b 0x80060000 0x9f1d0000 0xc10000
stdin=serial
stdout=serial
stderr=serial

Environment size: 702/65532 bytes

Best regards

Tobias

(Last edited by tsaenger on 22 Jun 2017, 06:31)

You would do it on the one that works-- after it boots-- in Linux not the bootloader.

The discussion might have continued from here.