Details of build environment for micropython releases (esp. ESP32)

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
User avatar
glenn20
Posts: 132
Joined: Mon Jun 04, 2018 10:09 am

Details of build environment for micropython releases (esp. ESP32)

Post by glenn20 » Fri Apr 22, 2022 1:40 am

I'm looking for a definitive source of information about the build envrionment used for ESP32* (and ESP8266) micropython firmware releases.

I had inferred from the constant integration tests that the release builds were based on the 4.0.2 IDF. However, it seems from tools/autobuild* that a v4.2 IDF is used for esp32 and v4.4 is used for esp32s*/c*. Ideally, I'd also like to confirm which specific commit of the IDF is used for the releases and if there are any other patches applied (eg. tools/ci.sh in the v1.18 releases used the 142bb32c5 commit from v4.4 IDF, but master now uses the v4.4 tag).

I'd like to build my own images using build environments that are as close to the official builds as possible. Any tips or pointers would be appreciated. Ideally, there is a script somewhere that creates the build environment for releases and I have just not found it yet :-).

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Details of build environment for micropython releases (esp. ESP32)

Post by dhylands » Fri Apr 22, 2022 4:48 pm

The README in the esp32 port talks about the versions: https://github.com/micropython/micropyt ... nvironment

Near the end of that section it says:
  • ESP32-S3 currently requires v4.4 or later.
  • ESP32-S2 and ESP32-C3 require v4.3.1 or later.

Peugot206
Posts: 31
Joined: Sat Apr 09, 2022 5:57 pm

Re: Details of build environment for micropython releases (esp. ESP32)

Post by Peugot206 » Fri Apr 22, 2022 5:26 pm

I'm currently also looking into this, I've build mine now with all the supported ESP-IDF versions and none of them works. I'm wondering if one of them works for you?

bulletmark
Posts: 59
Joined: Mon Mar 29, 2021 1:36 am
Location: Brisbane Australia

Re: Details of build environment for micropython releases (esp. ESP32)

Post by bulletmark » Fri Apr 22, 2022 11:53 pm

dhylands wrote:
Fri Apr 22, 2022 4:48 pm
The README in the esp32 port talks about the versions
The README is not always accurate though. E.g. see my post here.
I agree with the OP. Every time I go to build a custom image I have to stuff around to work out which IDF version firstly builds, and then works without odd issues. At least there needs be an easy way to determine the specific IDF version that was used to build each release of MicroPython.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Details of build environment for micropython releases (esp. ESP32)

Post by stijn » Sat Apr 23, 2022 7:06 am

Peugot206 wrote:
Fri Apr 22, 2022 5:26 pm
I'm currently also looking into this, I've build mine now with all the supported ESP-IDF versions and none of them works. I'm wondering if one of them works for you?
I'm not sure whether the relesaes do this as well, but following all steps from tools/ci.sh always worked for me; it should because it's also what every build on github uses to build from (almost) scratch on a clean machine

Peugot206
Posts: 31
Joined: Sat Apr 09, 2022 5:57 pm

Re: Details of build environment for micropython releases (esp. ESP32)

Post by Peugot206 » Sat Apr 23, 2022 10:44 am

stijn wrote:
Sat Apr 23, 2022 7:06 am
Peugot206 wrote:
Fri Apr 22, 2022 5:26 pm
I'm currently also looking into this, I've build mine now with all the supported ESP-IDF versions and none of them works. I'm wondering if one of them works for you?
I'm not sure whether the relesaes do this as well, but following all steps from tools/ci.sh always worked for me; it should because it's also what every build on github uses to build from (almost) scratch on a clean machine
Thanks, this one: https://github.com/micropython/micropyt ... ools/ci.sh ? How should I exactly read and execute this? I'm using a Generic ESP32. Where do I run this script or..?

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Details of build environment for micropython releases (esp. ESP32)

Post by stijn » Sat Apr 23, 2022 1:19 pm

See also https://github.com/micropython/micropyt ... _esp32.yml that's the toplevel stuff. Basically: in a shell with access to build tools like make/git you'd run

Code: Select all

source tools/ci.sh
ci_esp32_idf402_setup
ci_esp32_build
Alternatively if you have the idf installed already just run ci_esp32_build and/or copy/paste the relevant commands from ci.sh. For example I have the SDK in ~/espsdk or so so I just run 'source ~/espsdk/export.sh' then copy/paste the relevant build commands from the ci_esp32_build function instead of executing it completely.

User avatar
glenn20
Posts: 132
Joined: Mon Jun 04, 2018 10:09 am

Re: Details of build environment for micropython releases (esp. ESP32)

Post by glenn20 » Fri Apr 29, 2022 1:38 am

stijn wrote:
Sat Apr 23, 2022 1:19 pm
See also https://github.com/micropython/micropyt ... _esp32.yml that's the toplevel stuff. Basically: in a shell with access to build tools like make/git you'd run

Code: Select all

source tools/ci.sh
ci_esp32_idf402_setup
ci_esp32_build
Alternatively if you have the idf installed already just run ci_esp32_build and/or copy/paste the relevant commands from ci.sh. For example I have the SDK in ~/espsdk or so so I just run 'source ~/espsdk/export.sh' then copy/paste the relevant build commands from the ci_esp32_build function instead of executing it completely.
Thanks for the pointers, and I have used the github workflow scripts myself to clean up my own commits to PRs (eg. catch code formatting probs and IDF compatibility). However, these are not what is used to build the release versions (just as vaildation tests of commits to PR requests on micropython). Eg. ci.sh use v4.0.2 ESP IDF for esp32 and v4.4 IDF for esp32/[sc][23], but the release for v1.18 uses a v4.2 IDF for esp32 (and some specific or modified release of v4.4 as v1.18 compilations against v4.4 IDF don't produce a working repl (but master does) - at least for some recent releases of v4.4 IDF).

The ci.sh scripts are great references for identifying (and replicating) a good build environment for micropython. It'd be good to have access to reproducible instructions for the release builds as well.

Post Reply