Improved Flash Utility for WGR614L 0.3
This utility is can be used to modify the board data and boot loader checksum information on a WGR614L.
=== Boot Checksum ===
When the WGR614L starts up it reads a length and checksum from 0x3afff8 and 0x3afffc respectively (both in flash). The boot loader then calculates a checksum over that many bytes starting at 0xBC020000. If the calculated checksum is equal to that stored in the flash the system boots. If not then you most likely end up running tftpd (flashing power light).
The main use of this utility is to allow you to modify these values. Here are a few examples:
Read the checksum and length and print them out.
$ ngr-flash -c
=== Updating the Checksum ===
Upgrading the firmware on the WGR614L requires you to correctly set the checksum for the new firmware image. This utility now supports setting the checksum from a TRX file, or from a TRX image in flash.
To update the checksum to match the TRX image currently in flash (perhaps after doing an "mtd write image.trx liunx") use the following:
$ ngr-flash -u
If you wish to set the checksum to match a TRX file on disk, use:
$ ngr-flash -t image.trx
=== Checking the Checksum ===
In general it makes sense for the checksum to be calculated over the TRX stored in flash. However when first installing an image it is possible for the CHK length to be greater than the TRX length. An example of this is OpenWRT which appends a jffs2 marker to the end of the image; here a problem occurs on the second boot as the marker is replaced, thus invalidating the checksum.
The following command will ensure that the checksum length is equal to length of the TRX. If they differ then the checksum will be recalculated over the length indicated in the TRX header.
$ ngr-flash -a
=== Verifying the Checksum ===
Verify that the checksum is correct. This preforms the same operation as the boot loader; it reads the length, calculates the checksum, and checks it against the checksum stored in flash.
$ ngr-flash -v
The tool can also be used to set the checksum for a given length. Here the tool calculates the checksum for the requested number of bytes and then sets it. You can optionally force the checksum to a specific value with the -s switch.
$ ngr-flash -n LENGTH
=== Board Data ===
There is additional support for reading and writing the board data. This includes the WAN and LAN MAC addresses, and the board identity. This is the same identity that is used in CHK files, and checked by the boot loader when tftp'ing. I have not fully tested all this code, you have been warned.
RSS
