Linksys wrt3200acm sysupgrade not working

I am trying to update my OpenWrt 19.07.3 to 19.07.5 this does not work.
After the automaticly reboot from the sysupgrade procedure I can still see that I am on version 19.07.3
I did try with CLI and with the GUI. I did also try to update from 19.07.3 to 19.07.4. No errors are visible during the updates and as soon as the reboot finishes then I see still the old v.19.07.3.

# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='19.07.3'
DISTRIB_REVISION='r11063-85e04e9f46'
DISTRIB_TARGET='mvebu/cortexa9'
DISTRIB_ARCH='arm_cortex-a9_vfpv3-d16'
DISTRIB_DESCRIPTION='OpenWrt 19.07.3 r11063-85e04e9f46'
DISTRIB_TAINTS=''

This device has a double partition system, and will switch back to the old firmware if the new fails to boot three times in a row. Perhaps the new version is being installed, but it fails to work.

Please, check that you have the correct image file for your device, it must be a "sysupgrade" file, not a "factory" one.

Also, check whether you have installed additional packages and configurations that might make the device fail to boot.

1 Like

Thks for the tip.

I did try to install
openwrt-19.07.5-mvebu-cortexa9-linksys_wrt3200acm-squashfs-sysupgrade.bin
and
openwrt-19.07.4-mvebu-cortexa9-linksys_wrt3200acm-squashfs-sysupgrade.bin

Here the console output:
There is an "sysupgrade successful" message.


Sending KILL to remaining processes ...
Switching to ramdisk...
[ 2971.361838] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" stops
[ 2971.422414] UBIFS (ubi0:1): un-mount UBI device 0
Performing system upgrade...
Read error on /dev/mtd1: No error information
Error: can't write fw_env to flash
Unlocking kernel1 ...

Writing from <stdin> to kernel1 ...
[ 2972.189085] ubi2: attaching mtd6
[ 2972.383360] ubi2: scanning is finished
[ 2972.391328] ubi2: attached mtd6 (name "rootfs1", size 74 MiB)
[ 2972.397112] ubi2: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 2972.404016] ubi2: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 2972.410837] ubi2: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 2972.417831] ubi2: good PEBs: 592, bad PEBs: 0, corrupted PEBs: 0
[ 2972.423863] ubi2: user volume: 2, internal volumes: 1, max. volumes count: 12  8
[ 2972.431120] ubi2: max/mean erase counter: 4/2, WL threshold: 4096, image sequ  ence number: 140946296
[ 2972.440209] ubi2: available PEBs: 0, total reserved PEBs: 592, PEBs reserved   for bad PEB handling: 40
[ 2972.449476] ubi2: background thread "ubi_bgt2d" started, PID 22777
UBI device number 2, total 592 LEBs (75169792 bytes, 71.6 MiB), available 0 LEBs   (0 bytes), LEB size 126976 bytes (124.0 KiB)
Volume ID 0, size 26 LEBs (3301376 bytes, 3.1 MiB), LEB size 126976 bytes (124.0   KiB), dynamic, name "rootfs", alignment 1
Set volume size to 66281472
Volume ID 1, size 522 LEBs (66281472 bytes, 63.2 MiB), LEB size 126976 bytes (12  4.0 KiB), dynamic, name "rootfs_data", alignment 1
[ 2973.319577] UBIFS (ubi2:1): default file-system created
[ 2973.325214] UBIFS (ubi2:1): background thread "ubifs_bgt2_1" started, PID 228  55
[ 2973.357290] UBIFS (ubi2:1): UBIFS: mounted UBI device 2, volume 1, name "root  fs_data"
[ 2973.365167] UBIFS (ubi2:1): LEB size: 126976 bytes (124 KiB), min./max. I/O u  nit sizes: 2048 bytes/2048 bytes
[ 2973.375132] UBIFS (ubi2:1): FS size: 65011712 bytes (62 MiB, 512 LEBs), journ  al size 3301376 bytes (3 MiB, 26 LEBs)
[ 2973.385617] UBIFS (ubi2:1): reserved for root: 3070663 bytes (2998 KiB)
[ 2973.392261] UBIFS (ubi2:1): media format: w4/r0 (latest is w5/r0), UUID CFBB7  A0A-89D3-4301-8B98-F4AD56D8AA56, small LPT model
[ 2973.464726] UBIFS (ubi2:1): un-mount UBI device 2
[ 2973.469471] UBIFS (ubi2:1): background thread "ubifs_bgt2_1" stops
sysupgrade successful
umount: can't unmount /dev: Resource busy
[ 2973.644869] UBIFS (ubi1:0): un-mount UBI device 1
[ 2973.649601] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" stops
umount: can't unmount /tmp: Resource busy

BootROM - 1.73
Booting from NAND flash

General initialization - Version: 1.0.0
AVS selection from EFUSE disabled (Skip reading EFUSE values)
mvSysEnvIsFlavourReduced: TWSI Read of 'flavor' failed
Detected Device ID 6820
High speed PHY - Version: 2.0

Init RD NAS topology Serdes Lane 3 is USB3
Serdes Lane 4 is SGMII
board SerDes lanes topology details:
 | Lane # | Speed|    Type     |
 ------------------------------|
 |   0    |  6   |  SATA0      |
 |   1    |  5   |  PCIe0      |
 |   2    |  6   |  SATA1      |
 |   3    |  5   |  USB3 HOST1 |
 |   4    |  5   |  PCIe1      |
 |   5    |  0   |  SGMII2     |
 -------------------------------
:** Link is Gen1, check the EP capability
PCIe, Idx 0: Link upgraded to Gen2 based on client cpabilities
:** Link is Gen1, check the EP capability
PCIe, Idx 1: remains Gen1
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.46.0
mvSysEnvGetTopologyUpdateInfo: TWSI Read failed
DDR3 Training Sequence - Switching XBAR Window to FastPath Window
DDR3 Training Sequence - Ended Successfully
Not detected suspend to RAM indication
BootROM: Image checksum verification PASSED


U-Boot 2013.01 (Sep 25 2017 - 11:42:52) Marvell version: 2015_T1.QA.0p16

Boot version : v1.0.0

Board: RD-NAS-88F6820-DDR3
SoC:   MV88F6820 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1866 [MHz]
       L2     @ 933 [MHz]
       TClock @ 200 [MHz]
       DDR3    @ 933 [MHz]
       DDR3 32 Bit Width,FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  512 MiB
NAND:  256 MiB
MMC:   mv_sdh: 0


#### auto_recovery ####
[u_env] get auto_recovery == yes
[u_env] get auto_recovery == yes
[u_env] get boot_part == 2
[u_env] get boot_part_ready == 3
auto_recovery enabled:1, boot_part:2, boot_part_ready:3

[boot_count_read] block:0x220000, size:128KB, records:64
[boot_count_read_record] boot_count:0, next_record:10

[boot_count_write] erase:0, auto_recovery->block_offset:0x220000 offset=0x225000

Updating boot_count ...
[boot_count_write] offset:0x225000 , length:2048
done

PCI-e 0 (IF 0 - bus 0) Root Complex Interface, Detected Link X1, GEN 2.0
PCI-e 1 (IF 1 - bus 1) Root Complex Interface, Detected Link X1, GEN 1.1
USB2.0 0: Host Mode
USB3.0 1: Host Mode
USB3.0 0: Host Mode

That error message sounds like the sysupgrade process fails to write the boot partition indicator to the uboot environment. So , even if the actual sysupgrade write succeeds otherwise, the router still boots from the current old partition.

Thks for the answer. But if i am using the cat command then I can see that the mtd0 is the boot partition.....

cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00020000 "u-boot"
mtd1: 00020000 00020000 "u_env"
mtd2: 00040000 00020000 "s_env"
mtd3: 00040000 00020000 "devinfo"
mtd4: 001e0000 00020000 "sysdiag"
mtd5: 05000000 00020000 "kernel1"
mtd6: 04a00000 00020000 "rootfs1"
mtd7: 05000000 00020000 "kernel2"
mtd8: 04a00000 00020000 "ubi"
mtd9: 05600000 00020000 "syscfg"
mtd10: 005c0000 00020000 "unused_area"c# 

But it appears that the upgrade process is not able to write back the new uboot env settings indicating what kernel (2?) to boot. Can you write things manually.

bootTaOther
#!/bin/sh
#hacked from /lib/upgrade/linksys.sh

cur_boot_part=`/usr/sbin/fw_printenv -n boot_part`
target_firmware=""
if [ "$cur_boot_part" = "1" ]
then
    target_firmware="kernel2"
    fw_setenv boot_part 2
    fw_setenv bootcmd "run altnandboot"
elif [ "$cur_boot_part" = "2" ]
then
    target_firmware="kernel1"
    fw_setenv boot_part 1
    fw_setenv bootcmd "run nandboot"
fi
# re-enable recovery so we get back if the new firmware is broken
fw_setenv auto_recovery yes
echo "$target_firmware"
reboot

But the error is about mtd1 that is the u_env, the boot environment variables.

Here the output from the script

# ./script.sh
Read error on /dev/mtd1: No error information
Error: can't write fw_env to flash
Read error on /dev/mtd1: No error information
Error: can't write fw_env to flash
Read error on /dev/mtd1: No error information
Error: can't write fw_env to flash
kernel1
# Connection to tomatoeg.lan closed by remote host.

And the console output (begin with start now)

start now
[86147.670238] mvneta f1034000.ethernet eth0: Link is Down
[86147.790286] mvneta f1070000.ethernet eth1: Link is Down
[86148.856787] UBIFS (ubi1:0): un-mount UBI device 1
[86148.861529] UBIFS (ubi1:0): background thread "ubifs_bgt1_0" stops
acpid: exiting
[86149.265895] ieee80211 phy1: staid 1 deleted
[86149.480026] ieee80211 phy0: staid 1 deleted
[86149.496925] ieee80211 phy0: staid 3 deleted
[86149.514889] ieee80211 phy0: change: 0x40
[86149.613818] ieee80211 phy0: change: 0x100
[86149.645038] ieee80211 phy1: staid 2 deleted
[86149.665330] ieee80211 phy1: change: 0x40
[86149.744880] ieee80211 phy1: change: 0x100

BootROM - 1.73
Booting from NAND flash

General initialization - Version: 1.0.0
AVS selection from EFUSE disabled (Skip reading EFUSE values)
mvSysEnvIsFlavourReduced: TWSI Read of 'flavor' failed
Detected Device ID 6820
High speed PHY - Version: 2.0

Init RD NAS topology Serdes Lane 3 is USB3
Serdes Lane 4 is SGMII
board SerDes lanes topology details:
 | Lane # | Speed|    Type     |
 ------------------------------|
 |   0    |  6   |  SATA0      |
 |   1    |  5   |  PCIe0      |
 |   2    |  6   |  SATA1      |
 |   3    |  5   |  USB3 HOST1 |
 |   4    |  5   |  PCIe1      |
 |   5    |  0   |  SGMII2     |
 -------------------------------
:** Link is Gen1, check the EP capability
PCIe, Idx 0: Link upgraded to Gen2 based on client cpabilities
:** Link is Gen1, check the EP capability
PCIe, Idx 1: remains Gen1
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.46.0
mvSysEnvGetTopologyUpdateInfo: TWSI Read failed
DDR3 Training Sequence - Switching XBAR Window to FastPath Window
DDR3 Training Sequence - Ended Successfully
Not detected suspend to RAM indication
BootROM: Image checksum verification PASSED


U-Boot 2013.01 (Sep 25 2017 - 11:42:52) Marvell version: 2015_T1.QA.0p16

Boot version : v1.0.0

Board: RD-NAS-88F6820-DDR3
SoC:   MV88F6820 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1866 [MHz]
       L2     @ 933 [MHz]
       TClock @ 200 [MHz]
       DDR3    @ 933 [MHz]
       DDR3 32 Bit Width,FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  512 MiB
NAND:  256 MiB
MMC:   mv_sdh: 0


#### auto_recovery ####
[u_env] get auto_recovery == yes
[u_env] get auto_recovery == yes
[u_env] get boot_part == 2
[u_env] get boot_part_ready == 3
auto_recovery enabled:1, boot_part:2, boot_part_ready:3

[boot_count_read] block:0x220000, size:128KB, records:64
[boot_count_read_record] boot_count:0, next_record:12

[boot_count_write] erase:0, auto_recovery->block_offset:0x220000 offset=0x226000

Updating boot_count ...
[boot_count_write] offset:0x226000 , length:2048
done

PCI-e 0 (IF 0 - bus 0) Root Complex Interface, Detected Link X1, GEN 2.0
PCI-e 1 (IF 1 - bus 1) Root Complex Interface, Detected Link X1, GEN 1.1
USB2.0 0: Host Mode
USB3.0 1: Host Mode
USB3.0 0: Host Mode

Map:   Code:                    0x1feab000:0x1ff75c30
       BSS:                     0x1ffef564
       Stack:                   0x1f9aaf20
       Heap:                    0x1f9ab000:0x1feab000
       U-Boot Environment:      0x00200000:0x00220000 (NAND)

Board configuration detected:
mvEthE6171SwitchBasicInit init
Net:
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   RGMII   |     0x01     |
| egiga1 |   SGMII   |     0x00     |
| egiga2 |   SGMII   |   In-Band    |
egiga0 [PRIME], egiga1, egiga2
auto_recovery_check changes bootcmd: run altnandboot
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x5a00000, size 0x600000
 6291456 bytes read: OK
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   ARM OpenWrt Linux-4.14.180
   Created:      2020-05-16  18:32:20 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2513066 Bytes = 2.4 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Looks like there is something wrong with your device...

Thks yes it looks strange.
Is there an good way to analyse or recover the contents of this /dev/mtd1 partion ?

It looks good now I did the following steps
restart with "reboot" and interrupt with the space button as soon as the booting message "Hit anykey to stop autoboot" are appearing on the console screen, so that I can reach the Marvell prompt.
Then I did follow the procedure to "Corrupt Environment Recovery" in the
https://openwrt.org/toh/linksys/wrt_ac_series

Issue the following at the Marvell ยป prompt:

env default -a
saveenv
reset

And after that I can see an see an successful update on the motd welcome screen.
"OpenWrt 19.07.4, r11208-ce6496d796"
And also on the GUI Overview I can see version Frimware Version
"OpenWrt 19.07.4 r11208-ce6496d796 / LuCI openwrt-19.07 branch git-20.247.75781-0d0ab01"

Here the "detail steps"

Marvell>>  env default -a
## Resetting to default environment
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...
Writing to Nand... done
Marvell>> reset
resetting ...

BootROM - 1.73
Booting from NAND flash

General initialization - Version: 1.0.0
AVS selection from EFUSE disabled (Skip reading EFUSE values)
mvSysEnvIsFlavourReduced: TWSI Read of 'flavor' failed
Detected Device ID 6820
High speed PHY - Version: 2.0

Init RD NAS topology Serdes Lane 3 is USB3
Serdes Lane 4 is SGMII
board SerDes lanes topology details:
 | Lane # | Speed|    Type     |
 ------------------------------|
 |   0    |  6   |  SATA0      |
 |   1    |  5   |  PCIe0      |
 |   2    |  6   |  SATA1      |
 |   3    |  5   |  USB3 HOST1 |
 |   4    |  5   |  PCIe1      |
 |   5    |  0   |  SGMII2     |
 -------------------------------
:** Link is Gen1, check the EP capability
PCIe, Idx 0: Link upgraded to Gen2 based on client cpabilities
:** Link is Gen1, check the EP capability
PCIe, Idx 1: remains Gen1
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.46.0
mvSysEnvGetTopologyUpdateInfo: TWSI Read failed
DDR3 Training Sequence - Switching XBAR Window to FastPath Window
DDR3 Training Sequence - Ended Successfully
Not detected suspend to RAM indication
BootROM: Image checksum verification PASSED


U-Boot 2013.01 (Sep 25 2017 - 11:42:52) Marvell version: 2015_T1.QA.0p16

Boot version : v1.0.0

Board: RD-NAS-88F6820-DDR3
SoC:   MV88F6820 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1866 [MHz]
       L2     @ 933 [MHz]
       TClock @ 200 [MHz]
       DDR3    @ 933 [MHz]
       DDR3 32 Bit Width,FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  512 MiB
NAND:  256 MiB
MMC:   mv_sdh: 0


#### auto_recovery ####
[u_env] get auto_recovery == yes
[u_env] get auto_recovery == yes
[u_env] get boot_part == 1
[u_env] get boot_part_ready == 3
auto_recovery enabled:1, boot_part:1, boot_part_ready:3

[boot_count_read] block:0x220000, size:128KB, records:64
[boot_count_read_record] boot_count:1, next_record:15

[boot_count_write] erase:0, auto_recovery->block_offset:0x220000 offset=0x227800

Updating boot_count ...
[boot_count_write] offset:0x227800 , length:2048
done

PCI-e 0 (IF 0 - bus 0) Root Complex Interface, Detected Link X1, GEN 2.0
PCI-e 1 (IF 1 - bus 1) Root Complex Interface, Detected Link X1, GEN 1.1
USB2.0 0: Host Mode
USB3.0 1: Host Mode
USB3.0 0: Host Mode

Map:   Code:                    0x1feab000:0x1ff75c30
       BSS:                     0x1ffef564
       Stack:                   0x1f9aaf20
       Heap:                    0x1f9ab000:0x1feab000
       U-Boot Environment:      0x00200000:0x00220000 (NAND)

Board configuration detected:
mvEthE6171SwitchBasicInit init
Net:
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   RGMII   |     0x01     |
| egiga1 |   SGMII   |     0x00     |
| egiga2 |   SGMII   |   In-Band    |
egiga0 [PRIME], egiga1, egiga2
auto_recovery_check changes bootcmd: run nandboot
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0xa00000, size 0x600000
 6291456 bytes read: OK
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   ARM OpenWrt Linux-4.14.195
   Created:      2020-09-06  16:19:39 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2513858 Bytes = 2.4 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...
...
...
...
...
   73.373109] ieee80211 phy1: staid 4 deleted
[  114.911289] ieee80211 phy1: staid 3 deleted
[  121.859754] ieee80211 phy1: staid 1 deleted



BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.4, r11208-ce6496d796
 -----------------------------------------------------
#

And now I am trying to reach 19.07.5 an guess.......the same error again with
Read error on /dev/mtd1: No error information
Error: can't write fw_env to flash

...
...
Sending KILL to remaining processes ...
Switching to ramdisk...
[ 1987.107330] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" stops
[ 1987.168466] UBIFS (ubi0:1): un-mount UBI device 0
Performing system upgrade...
Read error on /dev/mtd1: No error information
Error: can't write fw_env to flash
Unlocking kernel2 ...

Writing from <stdin> to kernel2 ...
[ 1987.929691] ubi2: attaching mtd8
[ 1988.122784] ubi2: scanning is finished
...
...

This time (update from 19.07.4 to 19.07.5 ) I did have to do the following steps

-1-
restart with "reboot" and interrupt with the space button as soon as the booting message "Hit anykey to stop autoboot" are appearing on the console screen, so that I can reach the Marvell prompt.
-2-
Marvell>> run altnandboot

After that I reached the 19.07.5 version.
I now have:
OpenWrt 19.07.5 r11257-5090152ae3 / LuCI openwrt-19.07 branch git-20.341.57626-51f55b5

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.