platformio / platform-linux_arm

Linux ARM: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/linux_arm
Apache License 2.0
19 stars 25 forks source link

The package 'toolchain-gccarmlinuxgnueabi' is not available #2

Open ivankravets opened 7 years ago

ivankravets commented 7 years ago

Temporary solution

PlatformIO currently does not support cross-compilation for RaspberryPi and similar boards. Please use one of:

a) PlatformIO Core directly on a target device b) PIO Remote and work with your hardware from anywhere in the world.


Attempt to use the arm / raspberrypi platform. gets the error. Error: The package 'toolchain-gccarmlinuxgnueabi' is not available for your system 'linux_x86_64'

Also had this error under 64 bit windows.


Configuration

Operating system: Linux, x86_64 x-ubuntu

PlatformIO Version (platformio --version): PlatformIO, version 2.8.5

Description of problem

Steps to Reproduce

  1. Using the IDE, Initalise new project
  2. Select "Raspberry Pi 1 Model B"
  3. Click Initalize

    Actual Results

PlaftormIO: Failed to initialize PlatformIO project! Error: The package 'toolchain-gccarmlinuxgnueabi' is not available for your system 'linux_x86_64'

Expected Results

I would expect to be able to cross compile to arm from 64 bit linux..

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39567698-the-package-toolchain-gccarmlinuxgnueabi-is-not-available?utm_campaign=plugin&utm_content=tracker%2F38214396&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38214396&utm_medium=issues&utm_source=github).
ivankravets commented 7 years ago

Temporary solution is http://docs.platformio.org/en/latest/plus/pio-remote.html

hoosierEE commented 7 years ago

Another data point. I see a similar error on Ubuntu aarch64:

lx@~/Downloads/blinky-light-strip/pio[master !?*] platformio --version
PlatformIO, version 3.3.0
lx@~/Downloads/blinky-light-strip/pio[master !?*] pio run -t build
[Thu Apr  6 19:38:47 2017] Processing teensylc (platform: teensy, board: teensy35, framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------
PackageManager: Installing toolchain-gccarmnoneeabi @ >=1.40803.0,<1.40805.0
Error: Could not find a version that satisfies the requirement '>=1.40803.0,<1.40805.0' for your system 'linux_aarch64'
ivankravets commented 7 years ago

@hoosierEE your issue has been fixed https://github.com/platformio/platform-linux_arm/commit/bc5f23c8af37883cf9487c29fcbbe9ce51f8312f

Could you re-test?

  1. pio platform uninstall linux_arm
  2. pio platform install https://github.com/platformio/platform-linux_arm.git
hoosierEE commented 7 years ago

Re-tested, no change.

To be clear, the target device which I want to program is a Teensy 3.5, the host machine (which runs PlatformIO) is Linux ARM aarch64.

[EDIT] I did another test, changing the platform to atmelavr and board to nanoatmega328, and got a similar failure message:

PackageManager: Installing toolchain-atmelavr @ ~1.40902.0
Error: Could not find a version that satisfies the requirement '~1.40902.0' for your system 'linux_aarch64'
zgoda commented 7 years ago

FYI, at least on Debian derivatives there is a system package crossbuild-essential-{arm64|armel|armhf} which installs ready toolchain system wide:

$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ apt-cache show crossbuild-essential-armhf
Package: crossbuild-essential-armhf
Priority: optional
Section: devel
Installed-Size: 15
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Matthias Klose <doko@debian.org>
Architecture: all
Source: build-essential
Version: 12.1ubuntu2
Depends: gcc-arm-linux-gnueabihf (>= 5.2), g++-arm-linux-gnueabihf (>= 5.2), dpkg-cross
Filename: pool/main/b/build-essential/crossbuild-essential-armhf_12.1ubuntu2_all.deb

Since the toolchain is rather large, I'd suggest to fall back to download only if it is not already present.

poelzi commented 6 years ago

I seriously can't understand why the toolchain for linux_arm does only exist for darwin but not linux platforms. I was not able to find it, only for darwin. As this causes a but every 2 weeks, can you please add the proper entry and toolchain, please. It is obviously a wanted target.

  "toolchain-gccarmlinuxgnueabi": [
    {
      "sha1": "4606ce747ee2a59497e4859e6b22fce0c6df5904", 
      "system": [
        "darwin_x86_64", 
        "darwin_i386"
      ], 
      "url": "http://dl.platformio.org/packages/toolchain-gccarmlinuxgnueabi-darwin_x86_64-1.40802.0.tar.gz", 
      "version": "1.40802.0"
    }
  ], 
ivankravets commented 6 years ago

We don't have toolchains for Linux which allow building source code for ARM GNU EABI. We have all toolchains for NONE EABI.

shaman7036 commented 3 years ago

а это вообще будет работать???))))

JonnyTech commented 3 years ago

Is it possible to cross-compile yet (from Linux 64bit desktop for Linux ARM Raspberry Pi)? I cannot access my device with PIO Remote and do not have a similar device with me. I just want to be able to compile the source to a binary format and send it to my non-technical colleagues to test. Is there any way to build the output file at all? Even if the process is very tedious, I am willing to do it. Thanks.

sergerold commented 3 years ago

agreed, would be fantastic to cross-compile for the rpi. is it an IP issue?

twischer commented 3 years ago

On Linux using qemu binfmt to emulate ARM build environment might be another workaround: On Debian based system (on e.g. x86 machine) you have to do the following:

sudo apt install qemu binfmt-support qemu-user-static
wget https://github.com/debuerreotype/docker-debian-artifacts/raw/dist-arm32v7/buster/slim/rootfs.tar.xz
unp -u rootfs.tar.xz
cd rootfs
sudo mount -o bind /sys ./sys
sudo mount -o bind /proc ./proc
sudo chroot ./
apt install python3-pip
pip3 install platformio

In this ARM based change root file system you can use any platformio command to compile the binary for your raspberry. E.g. download the examples from https://github.com/platformio/platform-linux_arm/tree/master/examples/wiringpi-blink, copy it to the newly created root file system and execute pio run in the project directory.

I have not yet tested it completely but so far it seems to work.

maxgerhardt commented 3 years ago

This was asked again at https://community.platformio.org/t/raspbberry-pi-4-create-project-problem/22314/, official support would be good :(

techdragon commented 3 years ago

Ok... so 5 years have passed... is this still "temporary" half a decade later? or has this just become an accepted limitation that will never be resolved?

Personal Note: This is deeply frustrating to me (and I'm probably not the only one that finds it frustrating), the whole reason I read up on PlatformIO and bothered to install it in the first place was to simplify dealing with cross-compiling C/C++ (Honestly I'd rather just use rust where this is is a solved problem with zero issues cross compiling, but I have a whole C SDK I need to use on a project, so I'm stuck dealing with c/c++ cross compile toolchains)

sebeaumont commented 2 years ago

@techdragon I couldn't agree more as indeed I just went thorough that same loop. Another hour of my life wasted. Grr.