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

Can't install v2.0.0 on arm64 #5735

Closed
urish opened this issue Oct 5, 2021 · 11 comments
Closed

Can't install v2.0.0 on arm64 #5735

urish opened this issue Oct 5, 2021 · 11 comments
Assignees
Labels
Type: Feature request Feature request for Arduino ESP32
Milestone

Comments

@urish
Copy link
Contributor

urish commented Oct 5, 2021

Hardware:

Board: any
Core Installation version: 2.0.0
IDE name: Arduino CLI
Computer OS: Linux-aarch64 (arm64)

Description:

Installation fails with an error:

Error during install: Error downloading tool esp32:riscv32-esp-elf-gcc@gcc8_4_0-esp-2021r1: no versions available for the current OS%!(EXTRA *cores.ToolRelease=esp32:riscv32-esp-elf-gcc@gcc8_4_0-esp-2021r1)

Seems like arm64 support was originally added by #4117, but broke due to the introduction of the riscv32 core support.

@igrr
Copy link
Member

igrr commented Oct 5, 2021

Linking espressif/esp-idf#6432 which tracks adding aarch64 host support in ESP-IDF. Once that's released in IDF (planned for esp-2021r2 toolchain release), we can pick these tool releases in arduino-esp32.

It looks like #4117 simply added existing 32-bit ARM (armel) toolchains as ones to install for aarch64, so I'm not quite sure how that worked. Perhaps one can sudo dpkg --add-architecture armhf to install make these 32-bit tools work on a 64-bit system? If that does work, we can try to re-add these armel versions of tools.

@urish
Copy link
Contributor Author

urish commented Oct 5, 2021

Thanks for looking into this, @igrr

How can I help with testing this?

Adding dpkg --add-architecture armhf at the top of my container's Dockerfile didn't resolve the error, but I'm pretty sure I'm missing something? Probably need to make some changes to the actual arduino-esp32 package to test this?

@Jason2866
Copy link
Collaborator

@igrr Is it planned to release the toolchains for Apple Silicon M1 too?

@igrr
Copy link
Member

igrr commented Oct 7, 2021

@urish correct, installing architecture support is likely not sufficient. At least these armel tools need to be listed as downloads for arm64, this has to be done in package.json of the arduino-esp32 release. It is possible that other steps will be necessary, e.g. installing libc or other system libraries for armhf.

You can download the armel toolchain to your arm64 system (link here) and then try to run it. If that fails, check if some additional libraries need to be installed (use ldd to find the dependencies). If all that is successful somehow, then we can update package_esp32_index.template.json and include this change into the next release.

@igrr
Copy link
Member

igrr commented Oct 7, 2021

@Jason2866 Yes, espressif/esp-idf#6113 is the tracking issue for M1 toolchain. However it's not going to be part of the next esp-2021r2 toolchain release, maybe will get done in the one after that.

@pedrominatel pedrominatel added Type: Feature request Feature request for Arduino ESP32 and removed Type: Bug 🐛 All bugs labels Oct 7, 2021
@urish
Copy link
Contributor Author

urish commented Oct 8, 2021

Thanks for the direction! I have changed the generated board file and added the armhf binaries for the aarch64-linux-gnu architecture, then installed the new package and voila - it works like a charm!

I also verified I could compile for the following boards:

  • esp32:esp32:esp32doit-devkit-v1
  • esp32:esp32:franzininho_wifi_esp32s2
  • esp32:esp32:esp32c3

all compiled well. This is what the modified file looks like.

Should go ahead and send a pull request?

@urish
Copy link
Contributor Author

urish commented Oct 29, 2021

Anything I can do to help with this?

@igrr
Copy link
Member

igrr commented Oct 29, 2021

@me-no-dev Do you think we can still add this to 2.0.1?

@me-no-dev
Copy link
Member

yes. will update the toolchains for 2.0.1 :)

@urish
Copy link
Contributor Author

urish commented Oct 30, 2021

Thank you!

@VojtechBartoska VojtechBartoska added this to the 2.0.1 milestone Nov 1, 2021
@me-no-dev me-no-dev self-assigned this Nov 3, 2021
@urish
Copy link
Contributor Author

urish commented Nov 10, 2021

Fixed in 2.0.1 and verified on Wokwi.

Thanks for fixing this! Now the users can enjoy ESP32-S2 Blink on the Arduino Core 😉

@urish urish closed this as completed Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature request Feature request for Arduino ESP32
Projects
None yet
Development

No branches or pull requests

6 participants