Building MicroPython firmware

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
JumpZero
Posts: 54
Joined: Mon Oct 30, 2017 5:54 am
Location: Arcachon - France

Building MicroPython firmware

Post by JumpZero » Thu Dec 14, 2017 7:18 pm

Hello,

After having unsuccessfully tried to get this “cron-like” scheduler: https://github.com/rguillon/schedule running and got many memory errors, I understood that the only way was frozen module.
And it works! Very nice, I can now program my plant watering system with smart commands like:

Code: Select all

schedule.every().wednesday.at("13:15").do(job)
So I’m happy with that.
To freeze modules, I have installed the Espressif SDK and MicroPython following buid instructions here: https://github.com/micropython/micropyt ... ts/esp8266
Everything worked as described, excepted I didn’t buid the MicroPython cross-compiler with

Code: Select all

$ make -C mpy-cross 
as instructed, I forgot, but despite that I do have the mpy-cross executable and my modules are successffully pre-compiled.
Is this step not anymore nececessary? Is the cross-compiler built with MicroPython?
And last question: I undrestand that from time to time I must update the Espressif sdk and the MicroPython source code how do I do that: a

Code: Select all

git pull 
command from within the respective directory? Nothing more?

Thanks
--
Jmp0

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Building MicroPython firmware

Post by SpotlightKid » Thu Dec 14, 2017 10:14 pm

$ make -C mpy-cross

as instructed, I forgot, but despite that I do have the mpy-cross executable and my modules are successffully pre-compiled.
Is this step not anymore nececessary? Is the cross-compiler built with MicroPython?
The "mpy-cross" cross-compiler is built by default by the "all" target of the Makefile of some ports (e.g the "stm32" port), so you might have built "mpy-cross" already earlier by building the firmware for some other port.
git pull

command from within the respective directory? Nothing more?
To be totally sure you've updated everything, you should do:

Code: Select all

git pull
git pull --tags
git submodule update --init
make clean
And then do the normal build process (i.e. "make").

Please take note that after a "make clean" it takes a long time (>30 min on my laptop) to rebuild the toolchain.

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

Re: Building MicroPython firmware

Post by pythoncoder » Fri Dec 15, 2017 7:02 am

My understanding is that updating the Espressif toolchain is only necessary when the MicroPython maintainers do so. This is done infrequently and in a controlled fashion and is announced.

In the early days it was a regular chore.
Peter Hinch
Index to my micropython libraries.

JumpZero
Posts: 54
Joined: Mon Oct 30, 2017 5:54 am
Location: Arcachon - France

Re: Building MicroPython firmware

Post by JumpZero » Fri Dec 15, 2017 12:36 pm

@SpotlightKid & @pythoncoder: Thanks for your answers
I'll keep my Espressif sdk + MicroPython source code up to date
cheers

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

Re: Building MicroPython firmware

Post by pythoncoder » Mon Dec 18, 2017 6:57 am

By all means update the MicroPython source but use the same version of the SDK as the maintainers, not Espressif's hot-off-the-press latest. See https://github.com/micropython/micropyt ... /README.md.
Peter Hinch
Index to my micropython libraries.

JumpZero
Posts: 54
Joined: Mon Oct 30, 2017 5:54 am
Location: Arcachon - France

Re: Building MicroPython firmware

Post by JumpZero » Tue Dec 19, 2017 1:54 pm

Thanks for pointing this out, pythoncoder. I'll do.

zedtech
Posts: 22
Joined: Thu Nov 30, 2017 3:36 am

Re: Building MicroPython firmware

Post by zedtech » Wed Mar 14, 2018 12:32 am

Kindly enlighten me, what changes did you make to this module to make it usable with MicroPython before freezing it?

Post Reply