Cross Compiler only

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Llwy
Posts: 34
Joined: Thu Mar 10, 2016 7:43 am

Cross Compiler only

Post by Llwy » Tue Aug 23, 2016 11:32 am

Hello,
When the binaries became public, I stopped compiling myself from source and deleted the bloated Vagrant VM which I had built following the Adafruit tutorial.

Now I would like to start experimenting again with frozen/precompiled modules and I am wondering: would it be possible to install and run only the cross-compiler on its own without having to install the whole toolchain for firmware compilation?
Since Ubuntu command line is now included in Windows 10 after the last update, I now have the possibility to install some parts of the toolchain without having to create yet another full fledged-VM.

Any pointers as to which elements are required for a cross-compiler-only use would be appreciated.

Llwy

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Cross Compiler only

Post by Roberthh » Tue Aug 23, 2016 12:23 pm

mpy-cross is independent form any target device. For trial, I just built it on Windows 7/mingw, and it compiled and works. So yes, you can create mpy-cross separately. The other aspect is running the compiled files on esp8266. In the official build, the precompiled files atre packed into flash. For that, you have to install the complete toolchain (dang).
But you can also have esp8266 executing compiled Python scrips directly from the file system. Unfortunately, this requires changing mpconfigport.h and py/emitglue.c and creating a new binary (see viewtopic.php?f=16&t=1962&p=11014) , which means: you are trapped again. Maybe @pfalcon could enable support of .mpy files as standard feature.

Regards

Llwy
Posts: 34
Joined: Thu Mar 10, 2016 7:43 am

Re: Cross Compiler only

Post by Llwy » Tue Aug 23, 2016 12:41 pm

Dear Robert.
Thank you for your quick answer.
I had forgotten about the need to edit emitglue.c and mpconfigport.h...
I now remember since you were the one to tell me about those files in the first place.

OK so there is nothing much I can do right now to experiment with .mpy files if I do not wish to install and maintain a complete firmware compilation toolchain.

I'll keep my eyes open in case the .mpy support from flash becomes a standard feature.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Cross Compiler only

Post by Roberthh » Tue Aug 23, 2016 1:41 pm

Hello Llwy, I could pack you the recent binary with these patches. I'll send y note this evening.

Llwy
Posts: 34
Joined: Thu Mar 10, 2016 7:43 am

Re: Cross Compiler only

Post by Llwy » Tue Aug 23, 2016 5:33 pm

That's awfully nice of you Robert, thank you for the offer.
I will gladly take it.
Llwy

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Cross Compiler only

Post by pythoncoder » Tue Aug 23, 2016 5:42 pm

My approach is to get the toolchain from here http://www.kaltpost.de/~wendlers/micropython/ and use it to compile the current source. This saves a load of hassle and disk space; nor any need to edit sourcefiles. You can then quickly produce and deploy a build with modules frozen as bytecode.
Peter Hinch
Index to my micropython libraries.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Cross Compiler only

Post by Roberthh » Tue Aug 23, 2016 6:59 pm

@Llwy: I have placed an actual build with mpy file support from the command line here: https://github.com/robert-hh/Shared-Stuff.git
All files that used to be in the scripts directory have been moved to the modules directory, and are thus compiled, and there is also a copy of upysh.py and pye.py included there (It's just my standard set). See if it works for you. But finally, I think that you will reinstall the tool chain, like pythoncoder suggested. With Windows10/bash it could/should work. I tried the standard toolchain for the ARM version, but not the esp toolchain.
Best Regards, Robert

Llwy
Posts: 34
Joined: Thu Mar 10, 2016 7:43 am

Re: Cross Compiler only

Post by Llwy » Thu Aug 25, 2016 6:21 am

Dear Robert,
I flashed your binary successfully.
I will try to install the cross compiler only on Windows Bash this weekend.

Llwy

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Cross Compiler only

Post by Roberthh » Thu Aug 25, 2016 7:32 am

Hello Llwy, once you're in bash, just run:

Code: Select all

apt-get install build-essential
That will install almost all tools needed for SW building.

jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Re: Cross Compiler only

Post by jms » Thu Aug 25, 2016 12:51 pm

Use this as has been said.

http://www.kaltpost.de/~wendlers/micropython/

You shouldn't even need build-essential just "make" and the SDK.

The new Windows 10 thing is just a shell and some other bits and pieces in fact a lot like Cygwin. I somewhat doubt it'll actually run Linux binaries, for which you'll want a little virtual machine, but am happy to be corrected. Looks like I am corrected though cracks in emulation still might dictate use of a proper VM.

Jon

Post Reply