I'm using the latest stable release of OpenWrt on TPLink Archer C6u V1. It has the vendor provided U-Boot build from 2020. There are some odd env vars and uboot complains about it:
I was thinking of buildling a new version of U-Boot from their official repository (They have a dedicated page for MT7621) and flashing it to my router using mtd write or serial (kermit).
Is this a bad idea ? I do have backups of all the mtd partitions, so flashing the Winbond SPI Chip using a CH341 or similar flasher is doable in the worst case scenario.
Definitely be very careful with this. Frequently, the vendors will add custom extensions, drivers, features, and support that won’t work “out of the box” on the official, vanilla U-Boot. Some hardware designs require further customized device trees and patches simply to provide basic functionality.
For example, I once attempted to do this for the old Seagate GoFlex Home a number of years back in order to resolve a few quirks in how U-Boot was operating at the time. Although the vanilla tree had support for some Kirkwood-based devices, the code simply couldn’t address device-specific critical components and so it couldn’t even boot far enough to provide serial output. For me, I got lucky; The Kirkwood platform is able to accept a new bootloader over serial and the device didn’t overwrite critical data on the attempt, so I didn’t brick it by trying. However, not everyone will be so lucky and not every device provides that level of flexibility.
Recent MediaTek chips seem to be forgiving about this, but make sure this individual device is. The mtk_uartboot tool might be able to offer this device a bootloader over the serial port, but it does still rely on the chip being flashed with support for it and it also relies on the tool recognizing and communicating properly with this chip.
For anyone reading along who is curious and really wants to build and flash a custom U-Boot to a device, make absolutely sure you have a low-level way of restoring good data to the device if something goes wrong. Even today, not every device provides such an option. While some have platform-specific functionality within the hard-burned stages of the boot chain, it’s not a universal solution. This often means you’ll need to make sure there is a working JTAG port, you’ll need to know how to use it, and you’ll need to have a copy of the original bootloader and potentially a whole flash image prior to any attempt. Pay close attention to any partitions or data that isn’t open source or available online. Some devices still require additional data partitions that you can’t download from anywhere, and some are even specific to each and every individual unit. If your custom bootloader were to somehow damage that data and you don’t have a recovery copy…
There is nothing odd in these variables. These are settings for boot partition, boot command, TFTP recovery, serial UART. Some are necessary at each boot, so following @frollic 's advice : don't mess with them