Skip to content

Instantly share code, notes, and snippets.

@frankleonrose
Created July 11, 2017 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save frankleonrose/dd9995ec0dbd9f14d00a9c867e9dbe37 to your computer and use it in GitHub Desktop.
Save frankleonrose/dd9995ec0dbd9f14d00a9c867e9dbe37 to your computer and use it in GitHub Desktop.
Building for TTN OTAA example on Feather M0 for debugging using PlatformIO and BlackMagic Probe
; Instructions
; - Install PlatformIO IDE Package within Atom and then choose PlatformIO / Install Shell Commands menu item
; - Alternatively install PlatformIO command line only (when you install for Atom it will want you to then remove the cli version)
; - Upgrade to development version of atmelsam platform using the following commands
; pio platform uninstall atmelsam
; pio platform install https://github.com/platformio/platform-atmelsam.git
; - Make a directory myproject
; - Copy this fileinto it as platformio.ini
; - Copy ttn-otaa.ino to myproject/src/main.cpp
; - Make sure that arm-none-eabi-gdb is on your path. Might have to run:
; export PATH=~/.platformio/packages/toolchain-gccarmnoneeabi/bin:$PATH
; - Build and Run
; pio debug --interface gdb
; - At the (gdb) prompt load the executable with
; source .pioinit
; - You should see something like
; Target voltage: 3.3V
; Available Targets:
; No. Att Driver
; 1 Atmel SAMD21G18A (rev D)
; 0x000021c8 in ?? ()
; Loading section .text, size 0x8894 lma 0x0
; Loading section .ramfunc, size 0x60 lma 0x8894
; Loading section .ARM.exidx, size 0x8 lma 0x88f4
; Loading section .data, size 0x120 lma 0x88fc
; Start address 0x1b84, load size 35356
; Transfer rate: 16 KB/sec, 906 bytes/write.
; Breakpoint 2 at 0x462: file src/main.cpp, line 167.
; [Ctrl-C breaks you out of GDB, which is unworkable. But at this point you can run under Atom (PlatformIO/Debug menu)
; where Ctrl-C works right and you get all the visual debugging sweets.]
; Using a OpenOCD and a different JTAG connector, you'll have to edit debug_tool/port accordingly
; See http://docs.platformio.org/en/latest/plus/debugging.html#openocd-and-st-link
[common]
lib_deps_builtin = SPI
lib_deps_external = https://github.com/things-nyc/arduino-lmic.git
[env:feather]
platform = atmelsam
board = adafruit_feather_m0
framework = arduino
build_flags =
-ggdb3
-Wl,-T"flash_without_bootloader.ld"
debug_tool = blackmagic
debug_port = /dev/cu.usbmodem7BB07991
debug_extra_cmds =
break setup
lib_deps =
${common.lib_deps_builtin}
${common.lib_deps_external}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment