wrtu54g-tm:uboot
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wrtu54g-tm:uboot [2010/11/13 23:04] – neutronscott | wrtu54g-tm:uboot [2023/11/04 22:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== U-Boot ====== | ====== U-Boot ====== | ||
- | Okay, we can attempt a TFTP download if and only if $serverip is alive on WAN. Here is example, executed at serial console: | + | The WRT54G and like Broadcom devices seem to allow a boot_wait option where we can fix any broken flash remotely by TFTP without opening the router. Currently our only solution is opening the device and installing a serial connection, with use of a TTL RS232 converter. |
+ | |||
+ | An easier solution to the serial add-on is to acquire a USB-Serial converter such as that built into a typical e-bay Nokia CA-42 clone cable and use that to do the level conversion. You will need to hook up TX, RX and GND - see [[wrtu54g-tm: | ||
+ | |||
+ | U-boot has no TFTP server. It only has a client. U-Boot maintainers like it this way and see no point in a server. Well, they' | ||
+ | |||
+ | Note that the built in tftp client in Windows and OSX won't work - TFTPD32 for Windows and TFTPServer for OSX do work. | ||
+ | |||
+ | ===== Just to replace firmware ===== | ||
+ | |||
+ | If you're just looking to replace the firmware that is on the device and did create the necessary serial port connections, | ||
+ | You can set the PC to IP 192.168.0.250, | ||
+ | |||
+ | ===== Figuring it out ===== | ||
+ | If we issue a ' | ||
ADM8668 # set if_tftp 'ping $(serverip)' | ADM8668 # set if_tftp 'ping $(serverip)' | ||
Line 80: | Line 94: | ||
Well, seems like it'll get out of the tftp loop, but it still tried to boot from 0x600000. This is because that command wasn't part of a magic ' | Well, seems like it'll get out of the tftp loop, but it still tried to boot from 0x600000. This is because that command wasn't part of a magic ' | ||
+ | |||
+ | ===== Best Solution ===== | ||
ADM8668 # set netretry no | ADM8668 # set netretry no | ||
ADM8668 # set if_pingable 'ping $(serverip)' | ADM8668 # set if_pingable 'ping $(serverip)' | ||
ADM8668 # set if_tftp_success ' | ADM8668 # set if_tftp_success ' | ||
- | ADM8668 # set do_upgrade 'erase $(kernel_addr) +2fffff; cp 600000 | + | ADM8668 # set do_upgrade 'erase $(kernel_addr) +$(filesize); cp.b $(fileaddr) |
ADM8668 # set bootcmd 'run if_pingable if_tftp_success do_upgrade; bootm $(kernel_addr)' | ADM8668 # set bootcmd 'run if_pingable if_tftp_success do_upgrade; bootm $(kernel_addr)' | ||
ADM8668 # saveenv | ADM8668 # saveenv | ||
- | Seems the memory copy command **cp** deals correctly with flash. yay! one thing goes right. ;) | + | Seems the memory copy command **cp** deals correctly with flash. yay! one thing goes right. ;) Also, the bootm command is ran regardless of outcome of previous commands. So failing the upgrade in the ping/tftp parts, we'll still boot what's in flash (or at least try heh). I found that $fileaddr and $filesize are set after any tftp transfer, so we only erase enough of flash memory to make file fit now as well. |
+ | |||
+ | Note that by default, the device will want to have 192.168.0.10 with the TFTP server at 192.168.0.250, | ||
- | Here is an abbreviated successful upgrade: | + | Here is an abbreviated successful upgrade |
ADM8668 # run bootcmd | ADM8668 # run bootcmd | ||
Line 109: | Line 127: | ||
- If host is alive, but doesn' | - If host is alive, but doesn' | ||
- If host is alive, and serves TFTP image, but first try has 10 timeouts (happens a lot for me), then it doesn' | - If host is alive, and serves TFTP image, but first try has 10 timeouts (happens a lot for me), then it doesn' | ||
+ | |||
+ | Guess we can deal with these. Now, to include the uboot-envtools into an image, and set this up from within Linux.... Stay tuned... Even better would be to chainload a newer U-boot with netconsole support! :) | ||
+ | |||
+ | ===== Enabling from Linux ===== | ||
+ | I compiled u-boot environmental utilities and posted binary (sorry not packaged yet) at http:// |
wrtu54g-tm/uboot.1289689460.txt.gz · Last modified: 2023/11/04 22:29 (external edit)