Simavr load failing on ATmega2560

When trying to run simavr the debugger fails stating load failed and no error.

My launch.json looks like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug",
            "executable": "C:/Users/rconnor/OneDrive - COMP AQUATIC LIFE LTD/Documents/Firmware/.pio/build/ATmega2560/firmware.elf",
            "projectEnvName": "ATmega2560",
            "toolchainBinDir": "C:/Users/rconnor/.platformio/packages/toolchain-atmelavr/bin",
            "internalConsoleOptions": "openOnSessionStart",
            "preLaunchTask": {
                "type": "PlatformIO",
                "task": "Pre-Debug"
            }
        },
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug (skip Pre-Debug)",
            "executable": "C:/Users/rconnor/OneDrive - COMP AQUATIC LIFE LTD/Documents/Firmware/.pio/build/ATmega2560/firmware.elf",
            "projectEnvName": "ATmega2560",
            "toolchainBinDir": "C:/Users/rconnor/.platformio/packages/toolchain-atmelavr/bin",
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug (without uploading)",
            "executable": "C:/Users/rconnor/OneDrive - COMP AQUATIC LIFE LTD/Documents/Firmware/.pio/build/ATmega2560/firmware.elf",
            "projectEnvName": "ATmega2560",
            "toolchainBinDir": "C:/Users/rconnor/.platformio/packages/toolchain-atmelavr/bin",
            "internalConsoleOptions": "openOnSessionStart",
            "loadMode": "manual"
        }
    ]
}

platform.ini:

[env:ATmega2560]
platform = atmelavr
board = megaATmega2560
framework = arduino
lib_ldf_mode = deep+
lib_deps = arduino-libraries/SD
check_skip_packages = true
check_tool = cppcheck, clangtidy
extra_scripts = post:scripts/copy_hex.py
monitor_speed = 19200
debug_tool = simavr
debug_init_break = tbreak setup
monitor_filters = time, colorize

Debug Console:

image

The strange thing is that it works fine running simavr from power shell but for some reason platformio just doesn’t want to run it.

Can you open an issue about that at Issues · platformio/platform-atmelavr · GitHub? That’s where the Mega2560 board definition and SimAVR integration lives.

Technically board definition is called megaatmega2560, not sure if the differing upper- lowercasing has an influence on this particular issue though.

(platform-atmelavr/boards/megaatmega2560.json at develop · platformio/platform-atmelavr · GitHub) .

Thanks, I’ll check if that makes any difference and if not I’ll open an issue.

1 Like