OpenWrt Forum Archive

Topic: WRT54g hangs when flashing via mtd command

The content of this topic has been archived on 28 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

for my Freifunk-Firmware project, I offer a web based "Firmware Upgrade" button realized with the mtd command which is part of both the Linksys and the OpenWRT suites. With one of my devices (a WRT45G V2.0) sometimes the flashed TRX/BIN file generated with the OpenWRT toolchain will hang during bootup. Serial console states "Header checksum does not match". OK - no problem since TFTP is active without boot_wait in this state.

This occurs with the Linksys original web GUI update button as well as with a trx file manually written to flash using the mtd command.

If I rerun the trx utility manually, the next TRX/BIN file generated eventually is OK. This is likely a CRC calculation mismatch between this specific PMON/CFE and the trx tool (both OpenWRT trx and Linksys original trx tool show this behavior). N.B. If the trx file is OK, the BIN files always works.

So every time, I want to publish a new Freifunk-Firmware version, I am sitting there reflashing new BIN files until the CRC calculation matches.

Anybody heard about this? Workarounds?

Regards, Sven-Ola

I've had a few instances where it failed to flash correctly using the mtd util. It seems to be an issue with using mtd to reflash; when it failed I was able to send the exact same firmware through the bootloader's tftp.

Are you sure these crc errors you're claiming aren't just caused by a partial write?

I'am sure this is no partial write. And yes - the same file works with TFTP. It is always working with TFTP. I have checked several times (with single write op and with segmented write ops because not enough mem) to flash the same wrong TRX with mtd, but once wrong - ever wrong. I need to reissue the trx command to pack a new trx file -> sometimes it's ok. Because the cramfs inside the trx will have a date stamp, a new crc will be calculated and sometimes this crc matches the crc calculated by PMON/CFE. I'am pretty sure this is no "file offsets" issue. File offsets of bad/good trx are the same...

The discussion might have continued from here.