Cant find atmel AVR - windows 11 (in parallels on apple M3 OS

New windows 11 minstallation on new Apple M3 Macbook Pro
new vscode installatrion, new platform IO installation
installed fine

when i try to build a project that builds find normally on windows (native and as virtual machine parallels on INTEL OSX) and mac
i get
Tool Manager: Installing platformio/toolchain-atmelavr @ ~1.70300.0
UnknownPackageError: Could not find the package with ‘platformio/toolchain-atmelavr @ ~1.70300.0’ requirements for your system 'windows_arm64’t-find-the-package-with-requirements-for-your-system-darwin-arm64

what gives? any way to fix this?

more info

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino

i tried this
[env:megaatmega2560]
platform = atmelavr@5.2
board = megaatmega2560
framework = arduino

and when i build now i get

Resolving megaatmega2560 dependencies…

Platform Manager: Installing atmelavr @ 5.2

UnknownPackageError: Could not find the package with ‘atmelavr @ 5.2’ requirements for your system ‘windows_arm64’

Is this referencing a version in the future? The latest one is atmelavr@5.1.0.

This is the fundamental issue here. There is no native Windows ARM64 compiled gcc-avr toolchain in the PIO registry. Look at https://registry.platformio.org/tools/platformio/toolchain-atmelavr/compatibility for that.

Now there are two ways: We either recompile all thousands of missing toolchain binaries and tools natively for Windows ARM64 (yep, not gonna happen-) or we simply declare the Windows AMD64 (x64) version to be compatible with Windows ARM64 and hope that Window’s on ARM’s x86/x64 emulator kicks in and can actually run the binary.

Very similiar discussions have already been had in

So, can you download the x86 version of toolchain-atmelavr manually and see if avr-gcc.exe --version runs at all?

https://dl.registry.platformio.org/download/platformio/tool/toolchain-atmelavr/3.70300.220127/toolchain-atmelavr-windows-3.70300.220127.tar.gz

CC @ivankravets.

thanks but can’t download using the link you provided

whether down under OSX or Win11 I get

This site has been reported as unsafe

The connection for this site is not secure

usc1.contabostorage.com sent an invalid response.

ERR_SSL_PROTOCOL_ERROR

TroubleshootRefresh

Microsoft Edge

OSX terminal wget won’t download it either

Downloading it in your regular browser doesn’t work? Works fine for me

grafik

thanks very much! It had not occurred to me that this could be a wifi issue.

i am on hotel wifi. using my cellphone as hotspot solved the problem

on to testing whether it works!

regarding:
So, can you download the x86 version of toolchain-atmelavr manually and see if avr-gcc.exe --version runs at all?

yes, if i specify the path to the extracted file.

see below:

PS C:\Mac\Home\Documents\GitHub\Boardwalk> C:\Users\raventalking\.platformio\packages\toolchain-atmelavr\bin\avr-gcc.exe --version

avr-gcc.exe (GCC) 7.3.0
Copyright (C) 2017 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.

so i understand that i need to replace the package.json file

 "system": [
    "windows",
    "windows_amd64",
    "windows_x86"
]

with

 "system": [
    "windows",
    "windows_amd64",
    "windows_x86",
    "windows_arm64" ]

and edit the platformio.ini:

is this correct?

[env:megaatmega2560]
platform = atmelavr@3.70300.220127
platform_packages=platformio/toolchain-atmelavr-windows-3.70300.220127
board = megaatmega2560
framework = arduino
lib_deps = ...

AND where do i put the extracted tar referenced above. its in the pacakges dir, and still cant build, tried having it in the platformio dir, same results:

UnknownPackageError: Could not find the package with ‘atmelavr @ 3.70300.220127’ requirements for your system ‘windows_arm64’

The easier way is to modify the platform files themselves instead of a per-project fix.

So, your platformio.ini should be kept at only

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino

plain and simple.

You should then follow this procedure.

  1. Cleanup. Delete all folders
    • C:\Users\<user>\.platformio\.cache
    • C:\Users\<user>\.platformio\platforms\atmelavr*
    • C:\Users\<user>\.platformio\packages\toolchain-atmelavr*
  2. Prepare the fixed toolchain by
  1. Get the latest stable version of the atmelavr platform using
git clone -b "v5.1.0" "https://github.com/platformio/platform-atmelavr.git" C:\Users\<user>\.platformio\platforms\atmelavr
  1. Repoint the platform to use the modified local package. Open C:\Users\<user>\.platformio\platforms\atmelavr\platform.json and find the section

And replace this section with

    "toolchain-atmelavr": {
      "type": "toolchain",
      "owner": "platformio",
      "version": "symlink://C:/Users/<user>/Desktop/toolchain-atmelavr/"
    },

(example path from above).

Then, you should be able to compile an example sketch for the Mega2560.

If you want uploading to work too, you will have to do the same procedure with the tool-avrdude package: The download URL for amd_64 can be retrieved from https://api.registry.platformio.org/v3/packages/platformio/tool/tool-avrdude (as for other packages), which is https://dl.registry.platformio.org/download/platformio/tool/tool-avrdude/1.60300.200527/tool-avrdude-windows-1.60300.200527.tar.gz in this case.

Actually, screw all that.

The latest PlatformIO core introcued a setting with which you can make PlatformIO think that your system is just a regular “windows_amd64” one. Which should work if everything can be emulated on ARM64.

See https://github.com/platformio/platformio-core/releases/tag/v6.1.16.

To use:

  • Use the CLIpio upgrade and pio --version to make sure your core version is 6.1.16 (or above, in the future).
  • Add a new environment variable to your account with the name PLATFORMIO_SYSTEM_TYPE and a value of windows_amd64
  • Restart the computer for the environment variable to take effect
  • Compile and upload Arduino code as normal.

This should be much, much easier.

1 Like

thanks very much. I will try this later this week

this worked perfectly, thanks