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

Unknown target CPU atmega4809 required by megaAVR boards #112

Open
3 tasks done
bradcush opened this issue Jun 12, 2022 · 0 comments
Open
3 tasks done

Unknown target CPU atmega4809 required by megaAVR boards #112

bradcush opened this issue Jun 12, 2022 · 0 comments
Assignees
Labels
type: imperfection Perceived defect in any part of project

Comments

@bradcush
Copy link

bradcush commented Jun 12, 2022

Describe the problem

When specifying the arduino:megaavr:uno2018 platform core as the FQBN, whether as part of the original language server command or inside of a sketch.json file for a given project, the language server is able to run but isn't functional due to multiple errors. When the arduino:avr:uno platform core is specified instead, the language server works as expected.

I'm specifically running the language server with the built-in Neovim LSP but I've seen the same type of issue reported by users in the context of the Arduino IDE. I’m opening an issue here as the problem seems to be focused on the language server itself. Some of the relevant errors are included below:

[ERROR][2022-06-12 10:09:26] .../vim/lsp/rpc.lua:420 "rpc" "/Users/bcushing/go/bin/arduino-language-server" "stderr" "V[10:09:26.721] Ignored diagnostic. unknown target CPU 'atmega4809'\nV[10:09:26.721] Ignored diagnostic. unknown target CPU 'atmega4809'\n"

[ERROR][2022-06-12 10:09:26] .../vim/lsp/rpc.lua:420 "rpc" "/Users/bcushing/go/bin/arduino-language-server" "stderr" "V[10:09:26.714] Ignored diagnostic. unknown target CPU 'atmega4809'\nV[10:09:26.714] Ignored diagnostic. valid target CPU values are: avr1, avr2, avr25, ..., atiny104\n"

[ERROR][2022-06-12 10:09:29] .../vim/lsp/rpc.lua:420 "rpc" "/Users/bcushing/go/bin/arduino-language-server" "stderr" "E[10:09:29.213] Could not build a preamble for file /private/var/folders/cl/h4959ym96wn_dd1zg6v7tdl00000gq/T/arduino-language-server1483186440/sketch/practice.ino.cpp version 4: CreateTargetInfo() return null\n"

[ERROR][2022-06-12 10:09:29] .../vim/lsp/rpc.lua:420 "rpc" "/Users/bcushing/go/bin/arduino-language-server" "stderr" "E[10:09:29.213] Failed to prepare a compiler instance: valid target CPU values are: avr1, avr2, avr25, ..., attiny104\nI[10:09:29.213] --> textDocument/publishDiagnostics\n"

To reproduce

  1. Setup the arduino_language_server using nvim-lspconfig
  2. Specify the cmd to be used for running the language server
  3. Set the -fqbn flag to be arduino:megaavr:uno2018
  4. Open an ino file in a buffer and monitor log output

Example language server setup showing command:

-- Set paths for arduino language server command
local arduino_binary = '/Users/bcushing/go/bin/arduino-language-server'
local arduino_config = '/Users/bcushing/Library/Arduino15/arduino-cli.yaml'
nvim_lsp['arduino_language_server'].setup({
    on_attach = on_attach,
    cmd = {
        arduino_binary,
        '-cli-config',
        arduino_config,
        '-clangd',
        'clangd',
        '-cli',
        'arduino-cli'
        '-fqbn',
        'arduino:megaavr:uno2018'
    }
})

Expected behavior

The arduino:megaavr:uno2018 platform core can be specified as the FQBN and the language server is functioning similarly to how it does for FQBNs that are supported like arduino:avr:uno.

Arduino Language Server version

v0.0.0-20220608154818-2554452cd205

Arduino CLI version

arduino-cli Version: 0.23.0 Commit: 899dc91b Date: 2022-06-06T08:13:52Z

Operating system

macOS

Operating system version

Version 12.4 (21F79)

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants