Browse Source

Added debug utility that uses littleyoda's EspStackTraceDecoder

fastled
Xose Pérez 7 years ago
parent
commit
64f16118ad
3 changed files with 118 additions and 43 deletions
  1. +75
    -0
      code/debug
  2. +18
    -18
      code/platformio.custom.ini
  3. +25
    -25
      code/platformio.official.ini

+ 75
- 0
code/debug View File

@ -0,0 +1,75 @@
#!/bin/bash
# ------------------------------------------------------------------------------
# CONFIGURATION
# ------------------------------------------------------------------------------
ENVIRONMENT="node-debug"
ADDR2LINE=$HOME/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-addr2line
DECODER=utils/EspStackTraceDecoder.jar
DECODER_ORIGIN=https://github.com/littleyoda/EspStackTraceDecoder/releases/download/untagged-83b6db3208da17a0f1fd/EspStackTraceDecoder.jar
FILE="/tmp/.trace"
# ------------------------------------------------------------------------------
# END CONFIGURATION - DO NOT EDIT FURTHER
# ------------------------------------------------------------------------------
# remove default trace file
rm -rf $FILE
function help {
echo
echo "Syntax: $0 [-e <environment>] [-d <dumpfile>]"
echo
}
# get environment from command line
while [[ $# -gt 1 ]]; do
key="$1"
case $key in
-e)
ENVIRONMENT="$2"
shift
;;
-d)
FILE="$2"
shift
;;
esac
shift # past argument or value
done
# check environment folder
if [ $ENVIRONMENT == "" ]; then
echo "No environment defined"
help
exit 1
fi
ELF=.pioenvs/$ENVIRONMENT/firmware.elf
if [ ! -f $ELF ]; then
echo "Could not find ELF file for the selected environment: $ELF"
exit 2
fi
# get decode
if [ ! -f $DECODER ]; then
folder=$(dirname "$DECODER")
if [ $folder != "." ]; then
mkdir -p $folder
fi
echo "Downloading decoder..."
wget -q $DECODER_ORIGIN -O "$DECODER"
fi
# get trace interactively
if [ ! -f $FILE ]; then
echo "Paste stack trace and end with a blank line:"
trace=$(sed '/^$/q')
echo $trace > $FILE
fi
java -jar $DECODER $ADDR2LINE $ELF $FILE

+ 18
- 18
code/platformio.custom.ini View File

@ -15,16 +15,16 @@ framework = arduino
extra_script = pio_hooks.py extra_script = pio_hooks.py
lib_ignore = FauxmoESP lib_ignore = FauxmoESP
lib_deps = lib_deps =
19
31
44
64
305
306
346
359
408
727
DHT sensor library
Adafruit Unified Sensor
Time
ArduinoJson
ESPAsyncTCP
ESPAsyncWebServer@3e6e890808
AsyncMqttClient
ESPAsyncUCP
Embedis
NtpClientLib
https://bitbucket.org/xoseperez/justwifi.git https://bitbucket.org/xoseperez/justwifi.git
https://bitbucket.org/xoseperez/nofuss.git https://bitbucket.org/xoseperez/nofuss.git
https://bitbucket.org/xoseperez/hlw8012.git https://bitbucket.org/xoseperez/hlw8012.git
@ -40,7 +40,7 @@ upload_flags = --auth=fibonacci --port 8266
[env:sonoff-debug] [env:sonoff-debug]
include = common include = common
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
[env:sonoff-debug-ota] [env:sonoff-debug-ota]
include = env:sonoff-debug,ota include = env:sonoff-debug,ota
@ -48,7 +48,7 @@ include = env:sonoff-debug,ota
[env:sonoff-pow-debug] [env:sonoff-pow-debug]
include = common include = common
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_POW
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_POW
[env:sonoff-pow-debug-ota] [env:sonoff-pow-debug-ota]
include = env:sonoff-pow-debug,ota include = env:sonoff-pow-debug,ota
@ -56,7 +56,7 @@ include = env:sonoff-pow-debug,ota
[env:slampher-debug] [env:slampher-debug]
include = common include = common
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSLAMPHER
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSLAMPHER
[env:slampher-debug-ota] [env:slampher-debug-ota]
include = env:slampher-debug,ota include = env:slampher-debug,ota
@ -64,7 +64,7 @@ include = env:slampher-debug,ota
[env:s20-debug] [env:s20-debug]
include = common include = common
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
[env:s20-debug-ota] [env:s20-debug-ota]
include = env:s20-debug,ota include = env:s20-debug,ota
@ -73,7 +73,7 @@ include = env:s20-debug,ota
include = common include = common
board = nodemcuv2 board = nodemcuv2
platform = espressif8266_stage platform = espressif8266_stage
build_flags = -DNODEMCUV2 -DDEBUG_PORT=Serial -DENABLE_FAUXMO=1
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DENABLE_FAUXMO=1
lib_ignore = lib_ignore =
[env:node-debug-ota] [env:node-debug-ota]
@ -86,18 +86,18 @@ include = env:node-debug,ota
[env:washer-device] [env:washer-device]
topic = /home/cellar/washer/ip topic = /home/cellar/washer/ip
include = env:sonoff-debug-ota include = env:sonoff-debug-ota
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_EMON=1 -DENABLE_DHT=1
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_EMON=1 -DENABLE_DHT=1
[env:studio-lamp-device] [env:studio-lamp-device]
topic = /home/studio/lamp/ip topic = /home/studio/lamp/ip
include = env:sonoff-debug-ota include = env:sonoff-debug-ota
platform = espressif8266_stage platform = espressif8266_stage
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=1
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=1
lib_ignore = lib_ignore =
[env:living-lamp-device] [env:living-lamp-device]
topic = /home/living/lamp/ip topic = /home/living/lamp/ip
include = env:s20-debug-ota include = env:s20-debug-ota
platform = espressif8266_stage platform = espressif8266_stage
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20 -DENABLE_FAUXMO=1
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20 -DENABLE_FAUXMO=1
lib_ignore = lib_ignore =

+ 25
- 25
code/platformio.official.ini View File

@ -3,21 +3,21 @@ env_default = node-debug
[common] [common]
lib_deps = lib_deps =
19
31
44
64
305
306
346
359
408
727
DHT sensor library
Adafruit Unified Sensor
Time
ArduinoJson
ESPAsyncTCP
ESPAsyncWebServer@3e6e890808
AsyncMqttClient
ESPAsyncUCP
Embedis
NtpClientLib
https://bitbucket.org/xoseperez/justwifi.git https://bitbucket.org/xoseperez/justwifi.git
https://bitbucket.org/xoseperez/nofuss.git https://bitbucket.org/xoseperez/nofuss.git
https://bitbucket.org/xoseperez/hlw8012.git https://bitbucket.org/xoseperez/hlw8012.git
https://bitbucket.org/xoseperez/emonliteesp.git https://bitbucket.org/xoseperez/emonliteesp.git
https://bitbucket.org/xoseperez/fauxmoesp.git
https://bitbucket.org/xoseperez/fauxmoESP.git
https://github.com/jccprj/RemoteSwitch-arduino-library https://github.com/jccprj/RemoteSwitch-arduino-library
[env:sonoff-debug] [env:sonoff-debug]
@ -26,7 +26,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
lib_ignore = FauxmoESP lib_ignore = FauxmoESP
[env:sonoff-debug-ota] [env:sonoff-debug-ota]
@ -35,7 +35,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
@ -47,7 +47,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_POW
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_POW
lib_ignore = FauxmoESP lib_ignore = FauxmoESP
[env:sonoff-pow-debug-ota] [env:sonoff-pow-debug-ota]
@ -56,7 +56,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_POW
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF_POW
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
@ -68,7 +68,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSLAMPHER
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSLAMPHER
lib_ignore = FauxmoESP lib_ignore = FauxmoESP
[env:slampher-debug-ota] [env:slampher-debug-ota]
@ -77,7 +77,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSLAMPHER
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSLAMPHER
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
@ -89,7 +89,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
lib_ignore = FauxmoESP lib_ignore = FauxmoESP
[env:s20-debug-ota] [env:s20-debug-ota]
@ -98,7 +98,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
lib_ignore = FauxmoESP lib_ignore = FauxmoESP
@ -110,7 +110,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = nodemcuv2 board = nodemcuv2
build_flags = -DNODEMCUV2 -DDEBUG_PORT=Serial -DENABLE_FAUXMO=1
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial -DENABLE_FAUXMO=1
[env:node-debug-ota] [env:node-debug-ota]
platform = espressif8266 platform = espressif8266
@ -118,7 +118,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = nodemcuv2 board = nodemcuv2
build_flags = -DNODEMCUV2 -DDEBUG_PORT=Serial
build_flags = -g -DNODEMCUV2 -DDEBUG_PORT=Serial
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
@ -133,7 +133,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DS20
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
@ -149,7 +149,7 @@ board = esp01_1m
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_EMON=1 -DENABLE_DHT=1
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_EMON=1 -DENABLE_DHT=1
lib_ignore = FauxmoESP lib_ignore = FauxmoESP
[env:studio-lamp-device] [env:studio-lamp-device]
@ -159,7 +159,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=1
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF -DENABLE_FAUXMO=1
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
@ -172,7 +172,7 @@ framework = arduino
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
extra_script = pio_hooks.py extra_script = pio_hooks.py
board = esp01_1m board = esp01_1m
build_flags = -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
build_flags = -g -Wl,-Tesp8266.flash.1m256.ld -DDEBUG_PORT=Serial -DSONOFF
upload_speed = 115200 upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266


Loading…
Cancel
Save