Warning: unrecognized item "timeout" in "qSupported" response

Hello there
I trying to use platformio debug for last two days, I always getting the same error:

PlatformIO: Initializing remote target...
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
.pioinit:13: Error in sourced command file:
Bogus trace status reply from target: timeout

I looked at a lot of search results(for example: 1, 2, and more(new users can insert up to two links)) and none of them helped me.
Here is my platformio.ini:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
; monitor_speed = 9600
extra_scripts = no_verify.py

build_flags =
  -DAVR8_BREAKPOINT_MODE=2
debug_build_flags = -O0 -g -ggdb
debug_tool = avr-stub
debug_port = /dev/ttyUSB2
; board_debug.avr-stub.speed = 9600
lib_deps = 
	adafruit/Adafruit NeoPixel@^1.10.4
	m-tech-creations/NoDelay@^2.1.1
	evert-arias/EasyButton@^2.0.1
	LibPrintf=https://github.com/embeddedartistry/arduino-printf/archive/refs/tags/1.2.8.tar.gz
	nickgammon/Regexp@^0.1.0
	jdolinay/avr-debugger@~1.4

And a part of my project:

// *** Include libs ***
#include "Arduino.h"
#include "avr8-stub.h"
#include "app_api.h"
#include <Adafruit_NeoPixel.h>
// #include <EasyButton.h>
#include <avr/power.h>
#include <NoDelay.h>
#include <EEPROM.h>

// *** Include header files ***
#include "typedefs.h" //Here is the definition of the Functions type
                      //! (but other type definitions may appear there in future updates)
#include "config.h" //Definition of the EEPROM_CONFIG type, 
                    //common for all files, together with its initial appearance
#include "FwF.h" //Header file for essential firmware functions 
                 //(serial.cpp and startup.cpp)
#include "helpers.h" //Small helper functions designed to simplify files
#include "definitionOfModes.h" //In order not to include a dozen or even more mode files, 
                               //you can use just one header file

EEPROM_CONFIG CONFIG; //Its initial appearance of EEPROM_CONFIG

#define LED_DATA_PIN 53
#define CHANGE_MODE_BUTTON_PIN 52
#define TURN_OFF_BUTTON_PIN 51
#define NUMBER_OF_PIXELS 150

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMBER_OF_PIXELS, LED_DATA_PIN, NEO_GRB + NEO_KHZ800);
//Target for management, the meaning of the existence of the firmware

// EasyButton changeModeButton(CHANGE_MODE_BUTTON_PIN); 
// EasyButton turnOffButton(TURN_OFF_BUTTON_PIN); 
//This is the button to change the mode

const int CONFIG_ADDRESS = 0;
uint8_t modeSelected = 0;
//Currently selected mode 
uint8_t maxSelected = 6;
//maxSelected to reset the mode selection to the first one
//!Max count of modes in firmware is 255
bool __FLAG__doModes = false; 
//Can stop the execution of modes, used in startup() to wait for the ESP8266 chip to be fully ready

Functions modes[] = { redAndGray::doTick }; //Defined in typedefs.h

void serialEvent3() { doReadSerial(); }
void setup() { debug_init(); startup(); }
void loop() {
  // changeModeButton.read();
  // turnOffButton.read();
  if (__FLAG__doModes) { modes[modeSelected](); }
}

I tried to convey all the necessary information

Thanks :slight_smile:

This project is huge with a thousand includes and possibly conflictuing usage of the serail.

Can you try to replicate the absolute minimal debug environment as in How to debug on Arduino mega 2560 - #2 by maxgerhardt? With no other code? What happens then?

This is strange, it’s worked with this output:

0x0000059a in micros () at /home/thets/.platformio/packages/framework-arduino-avr/cores/arduino/wiring.c:103
103		return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond());
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = tbreak main`
PlatformIO: More configuration options -> https://bit.ly/pio-debug

Then something in your large project is preventing it from working. I would throw out / deacitvate everyething Serial related first and just keep the debug_init().

This is so:

#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif
#include "config.h"
#include "typedefs.h"
#include "FwF.h"
#include "helpers.h"
#include "definitionOfModes.h"
#include <EEPROM.h>
// #include <LibPrintf.h>
// #include <EasyButton.h>
#include <NoDelay.h>

void startup() {
  #if defined (__AVR_ATtiny85__)
      if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
  #endif
  
  // Serial.begin(9600);
  // Serial.println(">>> S-LED Start <<<");
  // Serial.println("> Start Serial3");
  Serial3.begin(9600);

  // Serial.println("> Getting Memory");
  EEPROM.get(CONFIG_ADDRESS, CONFIG);

  // Serial.println("> Starting strip");
  strip.begin();

  // printf("Brightness: %hhu", CONFIG.brightness);
  strip.setBrightness(CONFIG.brightness);
  strip.setPixelColor(2, strip.Color(0, 255, 0));
  strip.show();

  // changeModeButton.begin();
  // turnOffButton.begin();
  // changeModeButton.onPressed(changeMode);
  // changeModeButton.onPressedFor(CONFIG.waitForReset, doReset);
  // turnOffButton.onPressed(offLED);

  modes[1] = platform::doTick;
  modes[2] = rainbow::doTick;

  if (CONFIG.useRGBStep) { modes[3] = RGBStep::doTick; }
  if (CONFIG.useWhiter) { modes[4] = whiter::doTick; }
  if (CONFIG.useWhiteForWhite) { modes[5] = whiteForWhite::doTick; }
  modes[6] = fitoLamp::doTick;
}

That’s also a minor issue, you should add debug_init_break = loop (or setup). Additionally you can add a

as the first statement in loop() to force a stop.

What happens when you do that?

I’ll ask you to wait, please. I’m waiting for the result, just informing

main.cpp:

// *** Include libs ***
#include "Arduino.h"
#include "avr8-stub.h"
#include "app_api.h"
#include <Adafruit_NeoPixel.h>
// #include <EasyButton.h>
#include <avr/power.h>
#include <NoDelay.h>
#include <EEPROM.h>

// *** Include header files ***
#include "typedefs.h" //Here is the definition of the Functions type
                      //! (but other type definitions may appear there in future updates)
#include "config.h" //Definition of the EEPROM_CONFIG type, 
                    //common for all files, together with its initial appearance
#include "FwF.h" //Header file for essential firmware functions 
                 //(serial.cpp and startup.cpp)
#include "helpers.h" //Small helper functions designed to simplify files
#include "definitionOfModes.h" //In order not to include a dozen or even more mode files, 
                               //you can use just one header file

EEPROM_CONFIG CONFIG; //Its initial appearance of EEPROM_CONFIG

#define LED_DATA_PIN 53
#define CHANGE_MODE_BUTTON_PIN 52
#define TURN_OFF_BUTTON_PIN 51
#define NUMBER_OF_PIXELS 150

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMBER_OF_PIXELS, LED_DATA_PIN, NEO_GRB + NEO_KHZ800);
//Target for management, the meaning of the existence of the firmware

// EasyButton changeModeButton(CHANGE_MODE_BUTTON_PIN); 
// EasyButton turnOffButton(TURN_OFF_BUTTON_PIN); 
//This is the button to change the mode

const int CONFIG_ADDRESS = 0;
uint8_t modeSelected = 0;
//Currently selected mode 
uint8_t maxSelected = 6;
//maxSelected to reset the mode selection to the first one
//!Max count of modes in firmware is 255
bool __FLAG__doModes = false; 
//Can stop the execution of modes, used in startup() to wait for the ESP8266 chip to be fully ready

Functions modes[] = { redAndGray::doTick }; //Defined in typedefs.h

void serialEvent3() { doReadSerial(); }
void setup() { debug_init(); startup(); }
void loop() {
  // changeModeButton.read();
  // turnOffButton.read();
  breakpoint();	
  if (__FLAG__doModes) { modes[modeSelected](); }
}

platformio.ini:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
; monitor_speed = 9600
extra_scripts = no_verify.py
debug_init_break = loop

build_flags =
  -DAVR8_BREAKPOINT_MODE=2
debug_build_flags = -O0 -g -ggdb
debug_tool = avr-stub
debug_port = /dev/ttyUSB2
; board_debug.avr-stub.speed = 9600
lib_deps = 
	adafruit/Adafruit NeoPixel@^1.10.4
	m-tech-creations/NoDelay@^2.1.1
	evert-arias/EasyButton@^2.0.1
	LibPrintf=https://github.com/embeddedartistry/arduino-printf/archive/refs/tags/1.2.8.tar.gz
	nickgammon/Regexp@^0.1.0
	jdolinay/avr-debugger@~1.4

I think it’s easier to upload the project to github instead (if it is sharable) instead of copy-pasting all the code here.

Yes it’s a good idea, I’ll do it

I can’t say that the repository is well designed, but it has been empty until now. Whatever here

P.S. I will definitely improve this repository.

Hmm… It’s bad, but it definitely got better. Here is debug output:

PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = avr-stub
PlatformIO: Initializing remote target...
Ignoring packet error, continuing...
0x00000572 in _NeoPixelGammaTable ()
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = loop`
PlatformIO: More configuration options -> https://bit.ly/pio-debug
Cannot execute this command while the target is running.
Use the "interrupt" command to stop the target
and then try again.

Change

https://github.com/TSecret-GitHub/S-LED/blob/main/src/main.cpp#L47-L54

to

// void serialEvent3() { doReadSerial(); }
void setup() { debug_init(); /*startup(); */}
void loop() {
  // changeModeButton.read();
  // turnOffButton.read();
  breakpoint();	
  //if (__FLAG__doModes) { modes[modeSelected](); }
}

is it different?

If I omit what I just wanted to debug 3 serial port, it works:
Is there a way to leave serialEvent3()?

Reading symbols from /home/thets/Dev/__AVR__S-LED/.pio/build/megaatmega2560/firmware.elf...
done.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = avr-stub
PlatformIO: Initializing remote target...
0x00000608 in _NeoPixelSineTable ()
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = loop`
PlatformIO: More configuration options -> https://bit.ly/pio-debug

Well in theory the library should only use up one serial port and leave all others intact…

There might be issues with how the Arduino core is written and if serialEvent3 is defined then it has an influence on other serial ports…

Can you minimaly reproduce this issue of it non-working with the How to debug on Arduino mega 2560 - #2 by maxgerhardt project but an added void serialEvent3() { }? If yes, report that to Issues · jdolinay/avr_debug · GitHub.

So, it works?

PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = avr-stub
PlatformIO: Initializing remote target...
0x000005fa in delay (ms=871) at /home/thets/.platformio/packages/framework-arduino-avr/cores/arduino/wiring.c:112
112			while ( ms > 0 && (micros() - start) >= 1000) {
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = tbreak main`
PlatformIO: More configuration options -> https://bit.ly/pio-debug

Then serialEvent3() can’t be the result of the breakage. Did you only remove serialEvent3 from the original sketch to make it work?