RT5350F - update to the factory partition

Started by bugmaker, November 09, 2016, 12:32:15 PM

Previous topic - Next topic

bugmaker

I share this hoping can be useful for someone else.

Recently, Olimex released an update to address some minor problem on Olinuxino-RT5350F.
It is a change to some parameters into the factory partition (/dev/mtd2).

You can find it on https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/RT5350F/Prebuilt%20images/mtd2%20recovery

This update should resolve a small but continuous packet loss that can be observed on the wireless interface.

I've tried this fix on Olinuxino RT5350F hardware revision "C", and it works well. I suppose can work on following HW revisions, but I have not tested.

Unfortunately, the proposed file "rt5350f_factory.eeprom" doesn't work on the previous hardware revision "B" (with these new parameters, the Wi-Fi interface doesn't come up).

Anyway, if you have some hardware rev. "B" board, you can still apply a fix as herein described.

1) Follow the instructions on the above link to unlock the factory partition and make it writable (step 2.1).
Please, note that the "mtd write ... firmware" command do NOT save your configuration files.
(Alternatively: edit the /etc/sysupgrade.conf file and use the "sysupgrade [-F] ..." command. If you have a custom openwrt image you can recompile it with the factory partition writable, just commenting out the appropriate line "read-only;" into the dts file).

2) Obtain a file with a copy of the original factory partition of your board:
    cat /dev/mtd2 > /tmp/mtd2.original.bin
(for the purists: dd if=/dev/mtd2 of=/tmp/mtd2.original.bin bs=1)
This should be a binary file of 65536 bytes length.
(Put a copy of this file in a safe place, it can be useful if something goes wrong...).
Make a copy of this file and change the byte at address 0x34 (dec 52) from 0x22 to 0x11.
If you want to work directly on the olinuxino board, you can use these commands:
    cp /tmp/mtd2.original.bin /tmp/mtd2.new.bin
    echo -e -n "\x11" | dd of=/tmp/mtd2.new.bin seek=52 bs=1 count=1
    dd if=/tmp/mtd2.original.bin of=/tmp/mtd2.new.bin skip=53 seek=53 bs=1

The final length of new file must be 65536, test the result with
    cmp -l /tmp/mtd2.original.bin /tmp/mtd2.new.bin
and you should obtain "53  42  21".

(Do not change anything else unless you know what you are doing!).

3) Write back this new file to the factory partition, with the command
    mtd write /tmp/mtd2.new.bin factory
then restore your original firmware image.