Skip to content

Instantly share code, notes, and snippets.

@msquirogac msquirogac/main.cpp

Last active May 19, 2020
Embed
What would you like to do?
Platformio configuration for avr_debug integration
// Download lib from https://github.com/jdolinay/avr_debug
#include <avr8-stub.h>
#include <app_api.h>
void setup(void)
{
debug_init();
/* config here */
}
void loop(void)
{
breakpoint();
/* code here */
}
[env:nanoatmega328new]
platform = atmelavr
board = nanoatmega328new
framework = arduino
lib_deps = avr-debugger ; Optional parameter, PlatformIO should auto include all dependencies
debug_tool = custom ; Defines a custom configuration to use with avr-gdb
debug_load_cmds = preload ; Always upload firmware before debugging, this uses the regular upload mechanism (bootloader)
debug_port = /dev/ttyUSB0 ; Serial port where the board is connected
debug_init_cmds =
define pio_reset_halt_target
end
define pio_reset_run_target
end
file "$PROG_PATH"
set serial baud 115200
target remote $DEBUG_PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.