arduino / Arduino

Arduino IDE 1.x
https://www.arduino.cc/en/software
Other
14.18k stars 7.01k forks source link

Support for macOS Big Sur on arm64 #10836

Open neilpa-inv opened 4 years ago

neilpa-inv commented 4 years ago

With the "Apple Silicon" announcement earlier this year, are there any plans for macOS/arm64 support? As I understand it this at least requires updates to the avr-toolchain and avrdude along with other stuff I may not be aware of.

My primary interest is in getting avrdude working on an arm64 Mac. I've got access to one of the dev kit machines and have managed to compile a version on it. However, I've yet to successfully flash an Arduino from with the same parameters I've used from an Intel Mac.

I realize that some of the above may be better suited to the arduino/avrdude-build-script repo (which I just discovered), but I'm also generally interested in the Arduino IDE on this upcoming platform.

ubidefeo commented 4 years ago

hi @neilpa-inv

we have of course considered this, and got our hands on a dev kit. In the initial phase of the transition everything should keep working thanks to Rosetta 2, but in the future we should have native versions of every bit of software we release. Of course we cannot account for 3rd party tools which are simply installed via our Boards Manager, but when it comes to binaries we build internally we'll make sure they are running properly on every major platform.

brandwe commented 4 years ago

I have tried this and want to report that using the opensdk build by Azul using these instructions I still get an error after successful compile. I'll post back as I find more, but I'm sure it has to do with some x86 binaries in the keychain.

portable-false:

generate-hourly-build-txt:

start:

macosx-start:
     [exec] 2020-11-23 22:24:44.730 Arduino[24610:896895] Loading Application 'Arduino'
     [exec] 2020-11-23 22:24:44.731 Arduino[24610:896895] JVMRuntime=zulu-8.jdk
     [exec] 2020-11-23 22:24:44.731 Arduino[24610:896895] CFBundleName=Arduino
     [exec] 2020-11-23 22:24:44.731 Arduino[24610:896895] WorkingDirectory=(null)
     [exec] 2020-11-23 22:24:44.731 Arduino[24610:896895] JVMMainClassName=processing.app.Base
     [exec] 2020-11-23 22:24:44.731 Arduino[24610:896895] JVMOptions=(
     [exec]     "-Dapple.awt.application.name=Arduino",
     [exec]     "-Dcom.apple.macos.use-file-dialog-packages=true",
     [exec]     "-Dcom.apple.smallTabs=true",
     [exec]     "-DAPP_DIR=$APP_ROOT/Contents/Java",
     [exec]     "-Djava.ext.dirs=$JVM_RUNTIME/Contents/Home/lib/ext/:$JVM_RUNTIME/Contents/Home/jre/lib/ext/",
     [exec]     "-Djava.net.preferIPv4Stack=true",
     [exec]     "-Xdock:name=Arduino",
     [exec]     "-Dcom.apple.mrj.application.apple.menu.about.name=Arduino",
     [exec]     "-Dfile.encoding=UTF-8",
     [exec]     "-Xms128M",
     [exec]     "-Xmx512M",
     [exec]     "-splash:$APP_ROOT/Contents/Java/lib/splash.png"
     [exec] )
     [exec] 2020-11-23 22:24:44.731 Arduino[24610:896895] JVMArguments=(
     [exec] )
     [exec] 2020-11-23 22:24:44.732 Arduino[24610:896895] JVMClasspath=(null)
     [exec] 2020-11-23 22:24:44.732 Arduino[24610:896895] JVMDefaultOptions={
     [exec] }
     [exec] 2020-11-23 22:24:44.732 Arduino[24610:896895] SearchSystemJVM=false
     [exec] 2020-11-23 22:24:44.732 Arduino[24610:896895] -> Bundle path: /Volumes/Development/Electronics/Arduino/build/macosx/work/Arduino.app
     [exec] 2020-11-23 22:24:44.732 Arduino[24610:896895] -> Working Directory: '/Volumes/Development/Electronics/Arduino/build'
     [exec] 2020-11-23 22:24:44.732 Arduino[24610:896895] -> JVM Runtime path: /Volumes/Development/Electronics/Arduino/build/macosx/work/Arduino.app/Contents/PlugIns/zulu-8.jdk
     [exec] 2020-11-23 22:24:44.732 Arduino[24610:896895] -> Java Runtime Dylib Path: '/Volumes/Development/Electronics/Arduino/build/macosx/work/Arduino.app/Contents/PlugIns/zulu-8.jdk/Contents/Home/jre/lib/jli/libjli.dylib'

BUILD FAILED
/Volumes/Development/Electronics/Arduino/build/build.xml:146: The following error occurred while executing this line:
/Volumes/Development/Electronics/Arduino/build/build.xml:543: exec returned: 1
Grippy98 commented 3 years ago

@brandwe Well I got it to build just fine on first try, but alas "Error loading Java on startup"

Screen Shot 2021-02-03 at 10 10 27 PM

Edit: Looks like the same you were experiencing. Not sure if GCC or some other x86 but yeah I suspect that's the case. Will look into it as well.

Looks like the lines it gets stuck on at the end there are:

   <antcall target="${platform}-run" />

 <antcall target="${platform}-start"

and

<exec executable="macosx/work/Arduino.app/Contents/MacOS/Arduino" spawn="false" failonerror="true"/>

I managed to get arm-binutils compiled but still fail on avr-gcc proper because "toplev::main(int, char**) in libbackend.a(toplev.o)ld: symbol(s) not found for architecture arm64"

parreirat commented 3 years ago

I've been scouring the internet for the past couple hours trying to get M1 to detect my Mega2560 R3. Does not show up in serial ports at all. Have rebooted repeatedly, replugged, tried different cables, usb hubs. OSX is not even recognizing an "Unknown device" or similar: cannot detect any trace of board from PC. Tried from Arduino IDE Pro, Arduino IDE, arduino-cli with arduino-cli board list

Tried installing drivers listed here, but did not help (and figures: it's listed for 10.9 up, so my hopes were low) https://learn.sparkfun.com/tutorials/how-to-install-ftdi-drivers/all#mac

Grippy98 commented 3 years ago

Very curious, just tried with both a genuine and a clone Mega 2560 R3 just now and both uploaded fine. What version of Arduino are you running?

Screen Shot 2021-02-18 at 6 11 13 PM

I should add it shows up as a "Communications Device" as you can see on the bottom right.

parreirat commented 3 years ago

Very curious, just tried with both a genuine and a clone Mega 2560 R3 just now and both uploaded fine. What version of Arduino are you running?

Screen Shot 2021-02-18 at 6 11 13 PM

I should add it shows up as a "Communications Device" as you can see on the bottom right.

Godammit, can't believe it works for you on the "same setup"

I'm also on 11.2.1, and arduino 1.8.13 as well... I just don't get it showing up as a port. USV shows nothing either.

How are you running the board? I have the USB-B cable that came with it hooked onto my external USB C/A hub.

Currently trying to set up GO + build this PR from arduino-user-agent that claims to add M1 support (experimental, not really a lot of info, but I found it): https://github.com/arduino/arduino-create-agent/pull/617

And not being able to build it. Compiling it on M1 terminal blows up with "Too many errors", didn't realy bother digging into it properly yet, and with a Rosetta terminal I get a segmentation fault just installing Go.

image

I just get this "composite device" which I don't think is it, since it's there even if I unplug the board.

Grippy98 commented 3 years ago

I assume that "scarlet" is a USB Audio interface? Try that port?

parreirat commented 3 years ago

I assume that "scarlet" is a USB Audio interface? Try that port?

I had already tried the board on all 3 ports of my hub with everything else disconnected - did not help (yes, it's an audio interface)

neilpa-inv commented 3 years ago

I had already tried the board on all 3 ports of my hub with everything else disconnected

@parreirat this sounds like a hardware problem with the Arduino or the cable/hub. Especially since it's not showing up in the USB device tree.

I just get this "composite device" which I don't think is it, since it's there even if I unplug the board.

Correct. You can see in the screenshot that @Grippy98 shared it's listed as "Communications Device" with different vendor and product IDs. You can also see Arduino under the manufacturer field.

parreirat commented 3 years ago

I had already tried the board on all 3 ports of my hub with everything else disconnected

@parreirat this sounds like a hardware problem with the Arduino or the cable/hub. Especially since it's not showing up in the USB device tree.

I just get this "composite device" which I don't think is it, since it's there even if I unplug the board.

Correct. You can see in the screenshot that @Grippy98 shared it's listed as "Communications Device" with different vendor and product IDs. You can also see Arduino under the manufacturer field.

So you think it's more of a problem with hub/cable or arduino... I have a spare USB B from my e-drums - and I'll ask a friend for his USB HUB, that way I can eliminate if the arduino itself is the issue.

I'll report back. Thanks!

parreirat commented 3 years ago

It was the USB B cable. I used another one and it's working flawlessly now :)

dinolupo commented 3 years ago

Hi all, I'm trying with an Intel Edison, but the toolchain does not work, even with Rosetta 2:

fork/exec /Users/dino/Library/Arduino15/packages/Intel/tools/core2-32-poky-linux/1.6.2+1.0/i686/pokysdk/usr/bin/i586-poky-linux/i586-poky-linux-g++: bad CPU type in executable Error compiling for board Intel® Edison.

Screenshot 2021-05-11 at 09 03 20
Grippy98 commented 3 years ago

@dinolupo Have you tried https://gist.github.com/pbosetti/027125c4ba066f51bf2c ?

dinolupo commented 3 years ago

@Grippy98 yes thank you, same error on M1 unfortunately.

PaulStoffregen commented 3 years ago

It's not just M1.

Compiling for Edison doesn't work on Intel-based Macintosh either, if running any version of MacOS newer than Mojave.

image

As you can see in the screenshot, the problem is the toolchain in the "Arduino i686 Boards" package is a 32 bit executable ("Mach-O executable i386"). Apple ended support for 32 bit programs starting with Catalina.

Just to be clear, it's not the Arduino IDE. The problem is within the boards package used for Edison.

dinolupo commented 3 years ago

@PaulStoffregen ok thank you. I can imagine that there is no solution at this point, besides using another O.S.

PaulStoffregen commented 3 years ago

In theory, anyone could try to update the "Arduino i686 Boards" package. As far as I know, this is only the gcc toolchain which should be open source. With enough effort, there should be a way to rebuild the toolchain as x86-64 code.

In practice, it's hard to imagine anyone would invest that sort of effort to support a board Intel discontinued years ago. And if anyone outside Arduino & Intel were to do it, whether Arduino would publish the updated the package might also be a good question.