Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new binutils gdb #88

Merged
merged 4 commits into from
Jun 26, 2023
Merged

Conversation

wnienhaus
Copy link
Collaborator

This is a precursor step to adding support for the ULP-FSM of the ESP32-S2/S3.

This change changes where we get the esp32ulp assembler/linker from:

  • we now use the latest maintained version (binutils-gdb instead of binutils-esp32ulp)
  • we download pre-built binaries, rather than building ourselves - to save time.

Espressif moved where they maintain the ULP assembler (see espressif/esp-idf@a9bd454), and this changes switches to the new esp32ulp assembler/linker, which is also what the latest ESP-IDF uses.

Since Espressif publishes a list of pre-built tools, which includes the esp32ulp assembler/linker, we now download the pre-built binaries, rather than building them ourselves.

The new esp32ulp assembler/linker only has a single set of binaries across all esp32 variants, and esp32ulp-elf-as accepts the --mcpu argument to select the specific variant.

For now we explicitly choose --mcpu=esp32 (even though that is the default) in our existing tests, but when adding support for the S2 (and S3, which has the same binary format) we can simply specify --mcpu=esp32s2 in the tests that target the S2.

Espressif has switched from the binutils-esp32ulp repo (the original
fork of binutils to support their microcontrollers) to their new
repo binutils-gdb. (see espressif/esp-idf@a9bd454)

The ESP-IDF also uses the esp32ulp assembler/linker from the new
repo now. The main difference is that this is now the officially
maintained implementation. The other difference is that there are now
not different binaries for each esp32 variant, but one set of binaries.

To select which esp32 variant to target, the esp32ulp-elf-as binary
now accepts the --mcpu argument, for example --mcpu=esp32s2. The
default is still the original esp32, so omitting the argument means
one effected selected --mcpu=esp32.

Note: Because Espressif provides pre-built binaries we are no longer
building esp32ulp, but simply downloading the binaries and using
those.
The examples from the testsuite are the same as in the previous
binutils-esp32ulp repo from Espressif. But since the old repo
will no longer be maintained, we switch to the new one.

Currently all development happens on the esp32ulp-elf-2.35 branch
and master does not (yet?) contain any files related to the
Espressif-adapted assembler/linker. So we use this branch for now.

Given that the branch name includes what appears to be a version
number, it could mean Espressif might switch to a different branch
down the line. We should pay attention to this and can then choose
to switch to that branch too.
When using binutils-gdb (esp32ulp) to generate the "reference binary",
which we compare against, pass --mcpu=esp32 to select the original
ESP32 variant. While this is the default target of esp32-ulp-as,
adding this argument makes the choice explicit and shows how to select
a variant, for when we add support the ESP32-S2 or ESP32-S3 (both
use --mcpu=esp32s2 because their ULPs have the same binary format).
@wnienhaus wnienhaus merged commit ba4e9ac into micropython:master Jun 26, 2023
1 check passed
@wnienhaus wnienhaus deleted the use-new-binutils-gdb branch June 29, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant