I flashed stock firmware using @remittor's facinstall tool. See this thread.
Short version:
- Get latest facinstall "ipk" from here
- In Luci, do System > Software > Upload package And upload facinstall_*_all.ipk
- You can ignore
luci-reload: not found
error, just reload uhttpd manually yourself. - Then flash .trx stock firmware from Luci like you would regular upgrade.
There should be a note from facinstall that image is recognized first.