Hello!
I have an issue I can’t deal with it. As a preamble, I did check on Google, but I did not find any solution (all the first page).
I made an integration with CLion, I did a brand new project (because It’s not my real project but I want to start simply first) and I want to debug a simple program. I wrote this in my main.c:
#include <Arduino.h>
#include <avr8-stub.h>
static int a = 3;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
}
void loop() {
breakpoint();
Serial.println(a);
}
All the includes are recognized and there’s no error for this, but I try to launch the debug, with my Mega 2560 connected on COM3, I have the following error:
HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':
(.text+0x0): multiple definition of `__vector_25'
avr8-stub.c.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\megaatmega2560\firmware.elf] Error 1
I don’t understand what and where it is defined. Also, my platformio.ini:
[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
debug_tool = avr-stub
debug_port = COM3
lib_deps =
jdolinay/avr-debugger@ ~1.4
If someone could help me, I would be glad, I really need the debugger for my uni project.
PS: I would like to add that this error also happens in VSCode