Guide to cross compilation for Omega2 ?
-
Hi,
I am new to the world of IoT/embedded devices. I would like to get a cross compilation environment setup (preferably in a docker container), hoping that it will enable me to try out some Rust on the Omega2 (or failing that just some plain old C++)
So first thing is getting the cross-compilation toolchain:
I found https://wiki.onion.io/tutorials/cross-compile , but it seems to related to the Omega, not the Omega2plus? (at least it talks about Atheros AR7xxx/AR9xxx and not the MT-7688).
I also found https://docs.labs.mediatek.com/resource/linkit-smart-7688/en/downloads and https://github.com/simenkid/mt7688-cross but i was kind of hoping there would be an official guide/tutorial somewhere?
In order to compile with Rust i also need to know the correct target triple, i am guessing that it is either mips-unknown-linux-gnu or
mips-unknown-linux-musl , but it would be nice to know for sure.
-
I'd like to know as well so I can compile
golang
for my Omega2+.
-
This is probably something I am going to have to sort out. I have quite major investment in C++ code for the original Omega. This code was cross compiled on a kubuntu system using the toolchain from https://s3-us-west-2.amazonaws.com/onion-cdn/community/openwrt/OpenWrt-Toolchainar71xx-
generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2 - reference to this was originally obtained from the Omega admins over a year ago, though it can also be built from the OpenWrt repository referenced in https://wiki.onion.io/Tutorials/Cross-CompileWhile I am still waiting for my Omega2+ to arrive, I am guessing I am going to have to get hold of an equivalent toolchain for mt7688 -on initial investigation, it looks like I may be able to find something in the links provided by @Peter-Tiedemann
-
@Peter-Tiedemann said in Guide to cross compilation for Omega2 ?:
In order to compile with Rust i also need to know the correct target triple, i am guessing that it is either mips-unknown-linux-gnu or
mips-unknown-linux-musl , but it would be nice to know for sure.mipsel-openwrt-linux-musl
-
@Kit-Bishop said in Guide to cross compilation for Omega2 ?:
While I am still waiting for my Omega2+ to arrive, I am guessing I am going to have to get hold of an equivalent toolchain for mt7688 -on initial investigation, it looks like I may be able to find something in the links provided by @Peter-Tiedemann
You could also just do like I do and build LEDE, then you'll have an up-to-date toolchain.
-
@WereCatf Thanks- yes that's probably what I'll do
For the original Omega, I also built the toolchain for the ar71xx from the repository at git://git.openwrt.org/15.05/openwrt.git as referenced in https://wiki.onion.io/Tutorials/Cross-Compile
I also made the toolchain and available for others at https://github.com/KitBishop/Omega-ToolChain-SDKI will probably do the same for the MT7688 once I find the equivalent repository for LEDE - if you have a reference for this it would help and be much appreciated
-
@Kit-Bishop I uploaded the toolchain from my custom build of LEDE at https://dl.dropboxusercontent.com/u/11811685/lede-toolchain-ramips-mt7688_gcc-5.4.0_musl-1.1.15.Linux-x86_64.tar.bz2
-
@WereCatf Thanks for that
I have found what I believe to be the LEDE repository (https://github.com/Juiceman/apm82181-lede) and have cloned it and am in the process of building an image and the toolchain myself.
I note that the toolchain you listed in your message uses musl whereas the toolchain I previously had for the AR71XX for the original Omega uses uClibc
Do you know which should be used for the Omega2 (still don't have mine yet so can't check yet :-() Do you know if it matters?
-
@Kit-Bishop According to https://lede-project.org/downloads, LEDE repositories are https://git.lede-project.org/source.git and https://github.com/lede-project/source
-
@Pedro-Peña Thanks - after some digging and advice from @WereCatf I am now using https://git.lede-project.org/source.git
-
@Kit-Bishop yes, i saw the other thread after i wrote that
-
@Kit-Bishop said in Guide to cross compilation for Omega2 ?:
@Pedro-Peña Thanks - after some digging and advice from @WereCatf I am now using https://git.lede-project.org/source.git
-
Anyone had any success with this?
OPKG is missing
serialport
npm module for nodejs and was thinking of trying to build it myself.Thanks.
-
@simon with recent Go 1.8 release i was able to compile and run code (mux simple server) on my MacBook Pro late '15. So, there's no need to have
gccgo
toolchain or whatever you've need before.
Take a look at this https://github.com/denismakogon/OnionIoT-Omega2
-
@Denys-Makogon It was so subtle the line where you indicate the cross-compilation I missed it the first 2 reads. Nice cross-compilation from Go.