Xiaomi WiFi Router 3G

So you say that it is a gcc compiler issue?

if you share this build image with all menus in english will be good idea.. :-/

Yeah looks like it. I have ~21 hours on an mt7621 unit with no errors yet.

No idea, but gcc7.3 and -O3 optimization flag put into 'additional compiler options' and 'target options' seem to workaround data corruption issue

Update: now I recall that gcc6.3 and -O3 also didn't suffer from the issue. Maybe it's smth special with O3 flag.

Maybee stupid question but how to upgrade gcc cross-compiler and add O3 flag to makefile? My build from todays commit is builded with gcc 5.5 and I have hdd bug.

Luci is english and the additional web page also english but sometimes it contain hungarian texts, but not most. It was develeoped for the older routers which doesn't have. Just 8 mb flash so it is not so descriptive but i think it is understandable. Screenshot_20180304-191027

For example this is the hdd format page. And there is a test site which is a little bit older version.susteopenwrt.ipdns.hu/9092_test/cgi-bin/webcommander.html

-Os is fine as well.

Strange, -O2 causes the issue.

Interesting. But what exactly are you then changing to workaround the bug?
Is it only changing the
"Toolchain Options" -> "GCC compiler version" = "gcc 7.x"

"Target Options" already have "-Os" as standard but do you add "-Os" to "Toolchain Options" -> "Additional gcc configure options" or anywhere else?

Are you using standard kernel 4.9 or have you switched to 4.14 by changing the Makefile ?

4.14 but it should work with 4.9 as well.

I'm only changing the compiler to 7.3. I don't touch any other settings.

24 hours uptime. I used to encounter the problem within ~15 hours but now it seems to be good.

Her you go.. latest master with requested addons built-in

Thanks.
Just did a compile with kernel 4.9 and gcc 7.x. This causes LuCI to respond with "bad gateway" and I also lost internet connectivity but I did not investigate why. It could be Unbound being broken due to gcc 7.x. If I under "Target Options" replace -Os with -O3 these errors seems to disappear.
Exactly the samme happen when I compile with kernel 4.14. I have to replace -Os with -O3 to get a proper functioning router.

Can't compile with gcc 7.x. It stops during gcc compiling (error 2). Target Options changed to -O3. Now I'm trying 6.x. Still building.

So you don't have issues running gcc7.3 + O3 + k4.14?

Update: nvm, didn't notice you were talking about 'target options'. These don't affect kernel itself.

I did not test for the HDD issue yet to be honest.

If "Target Options" only affects how "packages" are build - how do I then change the flags when building the kernel?

I'm sorry if this is a stupid question : some of you are talking here about improvements and fixes to the firmware (for the 2,4Ghz etc...). But are those fixes included in https://downloads.lede-project.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-mir3g-squashfs-sysupgrade.tar ?
Thanks :slight_smile:

You should modify it in the kernel_menuconfig.
run
make kernel_menuconfig

1 Like

Edit 'additional compiler options' as well, it's right above 'target options'

It's working for me. I will be looking after this longer of course, but for now it looks fine.

My build: gcc 6.3 (can't compile toolchain with 7.3, I don't know why), Target Options changed to -O3, kernel settings changed to optimize for performance not size. Kernel 4.9.85.

Maybe this explains why it works for @neheb on 4.14 as it by default optimizes for performance and not size.
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=46c49d83815a84225c1bfcb54fd96b9f73c7c2cb