AVR stub setup with atmega328p

Per issue we’ve found the actual culprit – PlatformIO has multiple toolchain-atmelavr packages for the GCC 7.3.0 version, but the very latest one does not contain the avr-gdb.exe, for whatever reason. It’s just missing. The exact version of that package is 2.70300.201015.

The other 7.3.0 GCC package version, 1.70300.191015 does contain the executable and immediately works in my test.

Could you again try your project with your libraries but this time with the pacakge

platform_packages =
  toolchain-atmelavr@1.70300.191015

and see if both the linking error is gone and debugging works?

I’m catching the same debugger issue, using the latest PIO and toolchain-atmelavr under CLion IDE for macOS. It seems to me, a buggy version of the toolchain (1.70300.191015 ) has become the default. That is why the previous workaround does not work, at least for me.

So, defining the previous toolchain (1.50400.190710) is solving the issue.

platform_packages =
    toolchain-atmelavr @1.50400.190710

I managed to make it work on 1 laptop a few weeks ago, and I am not exactly sure what I have done, but I could not make it work on another. I will try with the info you gave me and get back to you asap. thanks!

I described in details my quest to make this work here. Credit is due to Max as always for helping so much in making PIO more accessible Setting up Arduino Uno as a debug environment for Atmel-ICE PlatformIO projects – Cyan Sensors

*this post is a work in progress, so if you see any improvements, tell me! I want to make atmel ICE usage on PIO easier for everyone!!