OpenWrt Forum Archive

Topic: [Solved] Can't find any loadb command in uboot-1.1.4. Any alternative?

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

Hi,
I am playing with a TP-link TL-WR741nd v4.3 router. Right now the only port working is the serial port and I have access to u-boot 1.1.4. As per instruction u-boot should have command "loadb" to load binary files through serial port using kermit. However, I can't find any loadb in this uboot. Am I missing something? Can't find loady for minicom either. How can I load the firmware through serial port?

hornet>  loadb 0x81000000

Unknown command 'loadb' - try 'help'
hornet> 

hornet> help

?       - alias for 'help'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootvx  - Boot vxWorks from an ELF image
cp      - memory copy
erase   - erase FLASH memory
help    - print online help
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nm      - memory modify (constant address)
ping.- send ICMP ECHO_REQUEST to network host
printenv- print environment variables
progmac - Set ethernet MAC addresses
reset   - Perform RESET of the CPU
setenv  - set environment variables
tftpboot- boot image via network using TFTP protocol
version - print monitor version
hornet> 

Regards,
M

(Last edited by mmrasheed on 28 Nov 2014, 19:46)

wow! pgid69 and his python script finalyl saved my day! Thanks!

For tp-link routers, where "hornet> " is the prompt, a little change in code's line would do-

change the line- 
if (buf.endswith(b"=> ")):
to-
 if (buf.endswith(b"> ")):  

Running the python script with --verbose showed exactly what was being copied to the memory.

 python ubootwrite.py --verbose --serial=/dev/cu.usbserial --write=openwrt-tl-wr741nd.bin --addr=0x81000000

It takes long time to copy the firmware in the RAM, partly because of the serial port speed. At some point, the script stopped with error. I tried again from the beginning and it ended up with an error at some other point. So, I modified the firmware to match the part the script copied successfully and then modified the address (--addr) and it resumed. After successful copy, I used the following code in serial console to copy the file from RAM to flash and then reboot. done!

erase 0x9f020000 +0x3c0000
cp.b 0x81000000 0x9f020000 0x3c0000
bootm 9f020000

The discussion might have continued from here.