Flashing your MG35 is a potentially DANGEROUS operation, and will probably VOID THE WARRANTY of your device.
Warning! You may kill your MG-35 if you connect anything incorrectly or if you type the wrong command.
You may even kill it if you get everything right. Advance with caution!
Never turn the device off during a flash upgrade until told to.
Never connect via NDAS, FTP or telnet before or during a flash upgrade.
Do not flash the MG-35 with the same firmware that is already loaded.
The upgrade will take about 2 minutes in total. Be sure not to power off the MG35 until the upgrade process tells you to do so.
The safest procedure to flash the firmware is:
First, you will need a "ROMFS" image in the format that the MG-35 expects to see. The MG-35 "ROMFS" image is not a standard, linux style "ROMFS" image. Instead it consists of a 4 byte header followed by a gzipped linux kernel followed by a standard CramFS image. The 4 byte header is an offset to the location of the cramfs image in the flash memory.
The simplest way to create an MG-35 compliant "ROMFS" image is to start with a valid ".upgrade" file. Open the file in a hex editor and delete everything from the start of the file until 4 bytes before the gzipped linux kernel. Or to put it another way, search for the "ROFS" string and then delete everything up to and including this string and also the next 12 bytes.
The more difficult way would be to concatenate "linux.gz" and "cramfs.img", then insert 4 bytes at the beginning of the file. This 4 byte header is calculated as follows:
Header = 0x40000 + (Length of linux.gz) + 4
The 4 byte header is then inserted in front of "linux.gz" in little-endian format.
And for those who aren't comfortable with hex editors, and in the style of Blue Peter, here is one I made earlier. romfs.m35 This file is a version of an original English release of the MG-35 firmware, and is nothing fancy, but should get you back to a state where you can once again upload more up to date firmware.
Once you have the MG-35's "ROMFS" file ready, you can upload it to the device and write it to the flash using the following commands:
download serial romfs
flash romfs
After the first command, you will need to tell your terminal program to upload the romfs via via ymodem. The upload will take 17-18 minutes. You can speed this up by using the serial loader's config command to change the serial speed (and also change at the PC end) but how often do you plan to brick your M-35?
Once you are returned to the "boot>" prompt, you can unplug the MG-35 to turn it off. Once you plug it back in and turn it on, it should boot with your newly flashed kernel and cramfs image.
Serial is a bit slow, and if you're developing some new firmware you might brick your MG-35 fairly often, so here is an experimental way to speed up the process.
You need to perform the serial loader console boot as normal but then configure the MG-35's ethernet port. To do this use the commands "net config" (it prompts you for the required information) and then "net up" You will then need to configure a tftp server on a PC to serve from the directory /home/tftp. Remember that tftp requires the directory to be world readable and writeable. You then need to create a subdirectory in /home/tftp called bigmo and place the romfs.m35 in here. You can't change any of these paths/names without editing and reflashing the serial loader, and no-one has dared to try this yet!
First you need to configure your bootloader: my tftp server is 192.168.2.23.
Welcome to JASPER boot loader boot> config net Protocol : (0) None (1) Static IP (2) BOOTP (3) DHCP : (1) MAC Address : (00:02:a8:xx:xx:xx) IP Address : (192.168.2.167) Netmask : (255.255.255.0) Gateway : (192.168.2.1) DNS : (192.168.2.1) Server : (192.168.2.23) boot> config file boot loader filename : (loader.bin) ROM filesystem filename : (romfs.ok) Kernel filename : (linux.bin) Image filename : (romfs.new) |
Now you need to initialize the network interface and download the image:
boot> net up DM9000 open Networking is enabled boot> net arp 192.168.2.23 192.168.2.23 00:xx:xx:xx:xx:xx boot> download net romfs Connecting... ARP for 1, 192.168.2.23 Receiving : .............. |
The MG-35 will try and read the file "/home/tftp/bigmo/romfs.m35" from your tftp server. Check your tftp server's logs if this doesn't work. You can also try a tftp client on another machine as this may give better error messages.
The command to flash is:
flash romfs |
For now, we don't know if this is at all possible, but some work is done in this direction
This page has been viewed times.