OpenWrt Forum Archive

Topic: Help in flashing/loading openwrt to Broadcom router

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

I am reposting this from the "hardware hacking" section to here.

So I have a no-name chinese router with a BCM4706 I want to experiment with but I have no idea how to flash openwrt on to it!
I have a serial port attached and can ctrl-C to get to the CFE prompt.  From there I have the following commands available:

CFE> help
Available commands:
show clocks         Show current values of the clocks.
nvram               NVRAM utility.
reboot              Reboot.
flash               Update a flash memory device
batch               Load a batch file into memory and execute it
go                  Verify and boot OS image.
boot                Load an executable file into memory and execute it
load                Load an executable file into memory without executing it
save                Save a region of memory to a remote file via TFTP
ping                Ping a remote IP host.
arp                 Display or modify the ARP Table
ifconfig            Configure the Ethernet interface
help                Obtain help for CFE commands
For more information about a command, enter 'help command-name'
*** command status = 0

So I have tried about everything I can think of without any success, and can't find much documentation.  I have a valid/working tftp server up, but issuing the following command just hangs:

CFE> ifconfig eth0 -addr=192.0168.100.237
Device eth0:  hwaddr C8-3A-35-40-C1-A8, ipaddr 192.168.100.237, mask 255.255.255.0
        gateway not set, nameserver not set
*** command status = 0
CFE> boot -raw 192.168.100.161:openwrt-squashfs.bin
Loader:raw Filesys:tftp Dev:eth0 File:192.168.100.161:openwrt-squashfs.bin Options:(null)
Loading:

Anybody have any wisdom they can pass along?

So the CFE command example I gave was just one example of not getting this thing to do anything.  I suppose that it should have been a 'flash' rather than 'boot' but regardless I can't get CFE to do anything.

However... I have been able to gain access to the root login so I have the following info on this thing:

# cat /proc/partitions
major minor  #blocks  name

  31     0       8192 mtdblock0
  31     1        128 mtdblock1
  31     2       7616 mtdblock2
  31     3        320 mtdblock3
  31     4         64 mtdblock4
  31     5         64 mtdblock5

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00800000 00010000 "All"
mtd1: 00020000 00010000 "Bootloader"
mtd2: 00770000 00010000 "KernelFS"
mtd3: 00050000 00010000 "WebFS"
mtd4: 00010000 00010000 "CFM"
mtd5: 00010000 00010000 "nvram"

So at this point I am trying to figure out how to move a .bin file to the router and then erase and write it to flash. 

Can this be done through the linux command line or am I back trying to figure out what CFE command to issue to make this work?

So I suppose that this was just too much of a noob question for anyone to answer... so I'll post the answer I came up with in case anyone else runs across it.

To flash openwrt to a generic Broadcom router:

CFE> flash -noheader <tftp server address>:openwrt-brcm-2.4-squashfs.trx flash1.trx

And thats really all there is to it.  This information is probably somewhere in the wiki but I couldn't seem to find it.

The discussion might have continued from here.