Skip to content

Instantly share code, notes, and snippets.

@msquirogac
Last active May 19, 2020 10:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msquirogac/9926bc47129f39fb2cae46b115f36f15 to your computer and use it in GitHub Desktop.
Save msquirogac/9926bc47129f39fb2cae46b115f36f15 to your computer and use it in GitHub Desktop.
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