-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Adding ARM builds for Raspberry Pi and co. #3334
Comments
I've also described the build process on my blog, if that helps. |
I tried your tutorial. It just wont compile. And I also havent added the symlinks which might be the problem. It would be cool if you add the few commands which we need to link those files. It would be cool to already add this in the build process? Or maybe you could add it to the install script (also have a look at the current PR about the install script!). So it might be just the symlinks for me. the eroor was a syntax error in avr-g++ by the way. The rest was super easy and it would be really cool to see this in the official repository from arduino github and the jessie repo of the raspi debian for pi2. |
I have met that syntax error with avr-g++ - something about symbol '(', right? That's what it says when version of avr-g++ is for x86, not ARM, even though that's certainly not the most correct error message ever. As far as I understood, you still do have x86 avr-g++ in the Arduino IDE folder, so this error makes sense. Which PR about installer script are you talking about? I couldn't find a PR about that. |
So here's an one-liner, just execute it in the hardware/tools/avr/bin/ directory:
Worked for me, will add this to my blog entry now as well. Also, which Raspbian release do you try this on? If it's Wheezy, that's be good, since most of the people use it =) |
In order to have a ARM compatible version, we need to pack everything we pack now, including astyle, all the toolchains (gcc, avrdude, bossac, openocd) |
In this specific case, is there any kind of cross-compiling environment needed when compiling libastyle and binaries for ARM? I figure that your build environment is x86/x64, and I haven't yet compiled ARM things on x86, so I'm kinda confused =) |
we don't cross compile |
Yes I got that symbol '(' error. Yes I've installed gcc-avr. But where to move which file? If you are doing a script then you may want to add the copy command for avr-g++ as well. Do I have to do this before the build or afterwards? This is the PR I am talking about. You could add your script stuff here. Even though its just a trick right now, many people would appreciate it. #3226 ffissore is right about shipping a copy with the ide, so it works under every OS. I tried with a fresh noobs booted debian jessie (upgraded before). I am not sure if wheezy would work since avr-gcc 4.8.1 is only available on jessie. But if we can fix those bugs we can probably see the IDE also running on wheezy. |
@NicoHood - Aha, so IMO Wheezy is out of question until we get all the things packaged, or alternatively those who need it can use packages from jessie (and hope it doesn't break things). I think I'll work on compiling&packaging things then. You don't actually need to move files. All you need is to create symlinks using that one-liner - it deletes all the binaries (extracted from an archive meant for x86, so useless to us) and creates symlinks to according binaries in /usr/bin instead. @ffissore What'd be the way then? As I understand, in order for the ARM compile scripts to be useful and to aid the creation of official ARM build, they have to be able to successfully produce ARM binaries on your build environment, which's most definitely ix86 arch. That sounds awfully like cross-compilation, and the fact that you don't use it isn't particularly surprising, considering that all the official builds at the moment are ix86, just that OSes change. How do you think, is it feasible that the Arduino IDE build&packaging process will involve cross-compilation in order to officially support ARM architecture? Or is there another way you could suggest? |
I tried this with 1.6 RC1 once. You can set jessie as 2nd repository. But this will break weird things. You cannot download some normal wheezy packages etc. So I wouldnt do it again like this. shipping it with the ide is probably the best thing you could do. Is this version fixed for pi2 or does it also work on the pi1? Or in other words: Can we improve the performence for pi2 maybe since it has 4 cores? I couldnt compile so I dont know if it uses all 4 cores at the same time. The underlying wheezy/jessie is still ARM6 from what I understood so we cant get ARM7 optimization? But what about the ubuntu mate release that's out now? Would the IDE work there as well? |
@NicoHood - I have only tested it on Pi2 so far, but I can also test it on Pi1B+ with Raspbian Jessie, which I'll do right now. I wonder if it'll break =) You're right about the whole thing still being ARMv6 - Raspbian repositories didn't get further than that AFAIK. Also, multicore support should be as good as Arduino IDE itself supports it, that is, if it does set '-j{cores}' flag when calling compiler/linker. |
Other then the IDE there is no need to compile anything because it is all in apt-get. Have A Great Day |
@ShorTie8 |
Shasum
|
This looks weird if you delete a post. More information would be great. |
Indeed. I was answering this question
|
I recently built the ARM toolchain for Raspberry Pi. If this thing is really going to happen, I'd be happy to help with that part. Many users have asked me to support Raspberry Pi. The problem has always been a lack of an official Arduino release. The distro packages are poorly made and tend to have lots of problems, far too many to try supporting them. |
Hi! Also, @ffissore I'm sorry for that deleted comment. Just got confused. |
Hey! I've compiled and packaged a version of IDE, now testing it. It works on Raspbian Jessie on RPi2 (the same machine I used for compiling it). It stops on launch on Raspbian Wheezy on RPi1B, however. The error message is as follows:
Does that mean that Wheezy simply doesn't have packages recent enough to support the IDE? Or is there a workaround I yet don't have a clue of, like compiling for an older GLIBCXX version? |
The error may means that you do not have the stdc++ library installed or that it is older than <3.4.20. If the library is not installed a If it's an older version the simpler solution is to build |
What I got to know using readelf: compilers in Raspbian produce armv6 code, even if running on armv7. That's great to know. I also more or less understood about the toolchain extraction, and hope I won't really need that (seems I won't need it that much though). Now I also sorted it all out about the basics of compatibility and such =) @cmaglie libstdc++6 is there indeed. Though the host uses libstdc++-4.9-dev package (without 6 after ++), and target uses libstdc++6-4.6-dev (metapackage is installed on both of them, MB the problem will go away after dist-upgrade I'm doing now on target). What'd be the more complicated solution? We need to build astyle + avr toolchain, and the latter is heavy (essentially building a compiler). That'd be taking a Wheezy image (it has the library that's compatible, I think), and that's something I can't do now, as compilation takes ages, and that RPi 2 I can compile on needs Jessie on it, since it's my desktop PC for now. Maybe there's a possibility to compile against earlier versions of this library? There should be, I just don't know how yet =( |
From my experience I can tell you that is so complex and error prone that many prefers to create a virtual-machine with the same setup as the target. BTW even the VM may be slow as hell, with the drawback that you waste a lot more energy to run the VM on a PC compared to a Raspberry. |
Hmm. @cmaglie - would your approach work if I set up a Wheezy x86 machine and cross-compile? Honestly, can't wait until the Foundation-provided image becomes Raspbian Jessie. |
Sorry, wrong button. |
libastylej is not in wheezy, that is why you need jessie Have A Great Day @PaulStoffregen about as official as I can seem to make it, but you still need jessie PS: The foundation is working on going to jessie, maybe the next image release. |
I'm currently setting up a Wheezy compile environment on a Raspberry Pi 2 to compile that libastylej and the toolchain too. If I don't stumble upon any problems, I'll have the whole system working on Wheezy. I hope nothing has any requirements that can't be supported on Wheezy. @ShorTie8 I'm sure patching is not the official way of doing things, as it's IMO hard to maintain. And I hope they get to Jessie soon, but I have to admit Jessie has some serious web browser issues as for now. (offtopic: if you have the same webbrowser problem, try luakit.) |
@ShorTie8 In my mind, the only "official" release is if Arduino.cc publishes it as a stand-alone download. The distro packages tend to be a support nightmare, especially Debian! |
Got it working on Wheezy! Recompile in Wheezy environment did the trick, now recompiling the toolchain-avr since it misbehaves too, in the same way as astyle did, just complaining about GLIBC_2.17 not found. Right now IDE runs, just doesn't compile =) @ffissore @PaulStoffregen So far, it doesn't seem to have unsolvable problems (toolchain's still compiling but I hope for the best ;-) ) When I get it working on Wheezy, what do I do next? Do I send you my build environment? (I could package the quick Wheezy setup I just did, just 4GB, runs on RPi2). Which files do I need to provide? What's about testing? Anything else that'd be desired? |
All working and packaged. Moreover, the package runs both on Wheezy and Jessie without any problems. Waiting for further directions =) |
Whelp, for yucks I tried it. Got a few warnings, but did seem to compile sumfin. Picked up JAVA_TOOL_OPTIONS: (java:5333): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-entry-select-on-focus after class was initialised (java:5333): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-entry-password-hint-timeout after class was initialised (java:5333): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-can-change-accels after class was initialised (java:5333): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-menu-popup-delay after class was initialised (java:5333): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-menu-popdown-delay after class was initialised (java:5333): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-menu-bar-popup-delay after class was initialised (java:5333): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised (java:5333): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-scrolled-window-placement after class was initialised (java:5333): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-button-images after class was initialised ShorTie |
@ShorTie8 Glad it worked for you! Those warnings don't mean much, they're due to the way how some of the UI elements are coded in the Arduino code =) I think I haven't seem them in the version that was compiled on Jessie, obviously the GTK library has changed and doesn't throw these warnings anymore. |
I tried it quickly on wheezy to see if it ran and would compile something. ShorTie |
Arduino IDE 1.6.x on Raspi / Raspbian sounds great! Does it work meanwhile or not? |
Hi! |
@ffissore @PaulStoffregen I think I'll prepare a pull request with additional instructions and let you guys see what you can do with it =) |
Hi CRImier! I have an Arduino Due hooked up to my Raspberry Pi 2 hosting emoncms for energy monitoring. When I go to verify or upload the sketch, I get the following output: Arduino: 1.6.5 (Linux), Board: "Arduino Due (Programming Port)" Build options changed, rebuilding all /home/pi/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=10605 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Due" -I/home/pi/.arduino15/packages/arduino/hardware/sam/1.6.4/system/libsam -I/home/pi/.arduino15/packages/arduino/hardware/sam/1.6.4/system/CMSIS/CMSIS/Include/ -I/home/pi/.arduino15/packages/arduino/hardware/sam/1.6.4/system/CMSIS/Device/ATMEL/ -I/home/pi/.arduino15/packages/arduino/hardware/sam/1.6.4/cores/arduino -I/home/pi/.arduino15/packages/arduino/hardware/sam/1.6.4/variants/arduino_due_x -I/home/pi/Arduino/libraries/DHT -I/home/pi/Arduino/libraries/Adafruit_BMP085 -I/home/pi/.arduino15/packages/arduino/hardware/sam/1.6.4/libraries/Wire -I/home/pi/Arduino/libraries/OneWire -I/home/pi/Arduino/libraries/DallasTemperature -I/home/pi/Arduino/libraries/EmonLib /tmp/build3513037533168774213.tmp/MeterNode.cpp -o /tmp/build3513037533168774213.tmp/MeterNode.cpp.o I tried compiling another sketch for a regular Arduino Leonardo & got the following output: Arduino: 1.6.5 (Linux), Board: "Arduino Leonardo" Using library SoftwareSerial in folder: /home/pi/arduino-1.6.5/hardware/arduino/avr/libraries/SoftwareSerial /home/pi/arduino-1.6.5/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Leonardo" -I/home/pi/arduino-1.6.5/hardware/arduino/avr/cores/arduino -I/home/pi/arduino-1.6.5/hardware/arduino/avr/variants/leonardo -I/home/pi/arduino-1.6.5/hardware/arduino/avr/libraries/SoftwareSerial /tmp/build3513037533168774213.tmp/MasterNode.cpp -o /tmp/build3513037533168774213.tmp/MasterNode.cpp.o Cannot run program "/home/pi/arduino-1.6.5/hardware/tools/avr/bin/avr-g++" (in directory "."): error=2, No such file or directory Any help with getting this going would be greatly appreciated. Since the Pi & the Due are located in the electricity meter box, being able to remotely access the Pi & upload changes to the sketch to the Due would be extremely handy! Thanks for your time! |
Has anyone been successful in putting together a succinct set of commands to activate the Arduino IDE 1.6.5 in Raspberry-Jessie yet? I've stumbled through Crimier and NicoHoods' solutions to get past Arduino 1.0.1, but continue having major issues, with avrdude, non-connected serial ports, etc. |
@CRImier hi, like @transivit i like to know the same thing. |
@facchinm I think this can be closed now :) |
Hello!
I've managed to compile and run Arduino IDE 1.6.5 on a Raspberry Pi (2B), running Raspbian Jessie. I have added a new platform to build.xml, as well as replaced libastylej.so with a copy from Raspbian repos and all the avr-gcc&avrdude binaries by symlinks to the corresponding binaries on my system. It runs quite nice, I've uploaded a Blink sketch on an Arduino Pro Mini.
Is somebody interested in completing that so that Arduino could offer pre-built IDE archives for Raspberry Pi&ARM? Basically, all that's left is to package libastylej.so, avr-gcc and avrdude into tarballs, as it is already with Linux IDE archives, upload those archives on the official page (where the build script downloads them from) and finish the build.xml work. Then I guess even Raspbian repos could have it, as it'll be officially supported - and, honestly, being stuck on 1.0.5 sucks a lot.
I have the build.xml file in my copy of this repository (commit). I'm not making a pull request because it is far from complete, given that it copies libastylej.so from the system-wide libraries and does nothing about absence of avr-gcc and avrdude packages on Arduino website (I symlinked the binaries to system-wide for IDE to work). I've also run 'ant test' and it did well - only some tests related to autoformat feature failed, overall it was okay.
The text was updated successfully, but these errors were encountered: