Skip to content
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

Simavr load failing on ATmega2560 #270

Open
Con30 opened this issue Dec 15, 2021 · 1 comment
Open

Simavr load failing on ATmega2560 #270

Con30 opened this issue Dec 15, 2021 · 1 comment

Comments

@Con30
Copy link

Con30 commented Dec 15, 2021

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.

@hypov8
Copy link

hypov8 commented Mar 22, 2022

i been having the same issue on an sanguino_atmega1284p.
if i look in windows task manager. its missing the .elf file added to the run command
is yours missing it to?

if i look in atmelavr\platform.py it seems to be missing the .elf agument?

debug["tools"]["simavr"] = {
    "port": ":1234",
    "server": {
        "package": "tool-simavr",
        "arguments": [
            "-g",
            "-m", debug["simavr_target"],
            "-f", build.get("f_cpu", "")
        ],
        "executable": "bin/simavr"
    },
} 

to make mine run i add this to plantform.ini (it still fails at random, like it times out with a full rebuild)

[env:melzi_debug]
build_type = debug
debug_tool = simavr
debug_server =
    ${platformio.packages_dir}/tool-simavr/bin/simavr.exe
    -m
    atmega1284p
    -f
    16000000L
    -g
    1234
    ${platformio.build_dir}\melzi_debug\firmware.elf

still trying to figure out how the console works for simavr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants