Skip to content

Downgrade Firmware

Alex X edited this page Nov 9, 2020 · 31 revisions

Original author @serrj-sv and community. Discuss here.

Gateway keeps the previous firmware before the update and you can be loaded from it.
If you update twice to a bad firmware, this method does not work.
If you have bad firmware from the factory - this method does not work.

Solder UART

  1. Open Gateway

  2. Solder USB UART adapter (GND to GND, RX to TX, TX to RX)

  3. Connect adapter to USB. UART setting: 38400 8n1, disable flow control (rts/cts)

  4. Power gateway with build-in USB power

  5. Сheck if boot is OK and there are no artifacts in console. If there are artifacts - check the wires, change the USB UART.

Go to bootloader

  1. Turn off gateway power

  2. Connect TP17 to ground (example USB case)

    Don't solder TP17. It may brake UART data.

  3. Power gateway with build-in USB power

  4. Remove TP17/GND wire after <RealTek> shows in console.

Switch boot to old firmware

Attention: ALWAYS keep all UART logs and/or backups!

  1. Enable flash

    <RealTek>snwbi

  2. Read boot_info from nand to memory

    <RealTek>snwbrecc a0000000 140 800

  3. Display boot_info in memory

    <RealTek>db a0000000 40

    You will get something similar:

     [Addr]   .0 .1 .2 .3 .4 .5 .6 .7 .8 .9 .A .B .C .D .E .F
    A0000000: 7C 91 00 00 E4 58 01 01 01 01 00 20 EC 04 C8 CF     |....X..... ....
    A0000010: 00 00 20 EC 04 CB 19 00 00 82 80 04 62 C6 00 00     .. .........b...
    A0000020: 9A 40 04 72 E8 00 00 00 01 31 2E 30 2E 32 2E 30     [email protected]
    A0000030: 30 35 00 00 00 00 00 FF FF FF FF FF FF FF FF FF     05..............
    
  4. Copy data to this calculator.

    Scroll down to Swapped bootinfo dump section

    It should change 4 bytes for first line:

    A0000000: __ __ __ __ XX XX __ __ YY YY __ __ __ __ __ __

  5. Enter first command from Bootinfo patch commands section:

    <RealTek>eb A0000000 7C 91 00 00 E5 59 01 01 00 00 00 20 EC 04 C8 CF

    You usually don't need to use the rest of the commands because they don't change anything.

  6. Check changes. Repeat step 3

    All lines must match Swapped bootinfo dump section from the calculator!

  7. Clear nand before write

    <RealTek>snwbeb 140

  8. Write boot_info from memory to nand

    <RealTek>snwbwecc a0000000 140 800

  9. Reboot gateway (power off/on)

    Gateway should starts with previous firmware.

Useful links

Clone this wiki locally