void setup() {
// put your setup code here, to run once:
debug_int();
pinMode(LED,OUTPUT); //Sets the pinMode to Output
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED, HIGH); //Sets the voltage to high
delay(100); //Waits for 1000 milliseconds
digitalWrite(LED, LOW); //Sets the voltage to low
delay(10000); //Waits for 1000 milliseconds
}
The board has no on-board debugger (like an ST-Link or a CMSIS-DAP). You are expected to have an external debug probe and connect it to the JTAG/SWD connector of the board.
PlatformIO offers to use (aka, automatically start and connect to) a suite of debug_tools that are available and suitable for that board. Whether any of those debug tools are actually available, or usable for a particular board, without any additionally hardware, is not something PlatformIO guarantees. Of course it depends on the target board, whether there’s an on-board debugger (and accompanying software) or alternative debugging methods available for it
The Nano ATmega328P’s debug tools are another story: First of all, it correcetly says that that board does not have an on-board debugger.
That doesn’t mean though that it can’t be debugged: The debug tool “simavr” (github) is a AVR simulator and works without hardware. So, the firmware is being run in a simulated environment here. The debug tool “avr-stub” (github) is special: It’s a “gdb stub”. That is code that runs on the target and exposes an interface, usually via UART, that gdb (the debugger client) can connect to. I.e., it implements the GDB Remote Serial Protocol (RSP). This makes it such that the board can actually debug itself (set breakpoints, read and write memory, …) without external debugger hardware. In fact, the ATmega328P does also support external hardware probes via the debugWIRE interface and probes such as an Atmel ICE and software such as avarice, but PlatformIO doesn’t support this at the moment.
GDB Stubs are not unqiue to the AVR architecture. They e.g. exist for ESP8266 and the Teensy, too. In fact, pretty much all ARM Cortex-M cores have a mechanism that allows the implementation of such “self debugging” mechanism, by providing the possiblity to set breakpoints (“ARM FPB”) and react to them (“DebugMonitor” exception / interrupt).
That being said, I don’t know of any “drop in ready” GDB stub library for the Giga R1, which uses the Arduino framework runs a STM32H747XI, which is turn a Cortex-M7 and a Cortex-M4 dual-core chip. Can it be constructed? Sure, with some work. But there will be drawbacks from the chip running a debug stub code directly vs an actual external debug probe which controls everything. Hence why I would absolutely recommend getting a e.g. cheap Raspberry Pi Pico board to use a debugger, or an actual ST-Link V3(Set or Minie). PlatformIO fully supports this debug method with debug_tool = cmsis-dap / stlink.