tree: 9ea6f3281a6ead565dd0217dec7dbe326afa4d31 [path history] [tgz]
  1. BUILD.gn
  2. main.cc
  3. README.md
  4. tokenizer_database.csv
workshop/01-blinky/README.md

Blinky with Logging

Instructions for building with a teensy36 board.

Create the out build directory.

gn gen out --export-compile-commands \
  --args='
    arduino_board="teensy36"
    dir_pw_third_party_arduino="//third_party/pigweed/third_party/arduino"
    arduino_core_name="teensy"
    pw_arduino_use_test_server=false'

Run the compile.

ninja -C out

Flash blinky.elf.

arduino_unit_test_runner \
  --config out/arduino_debug/gen/arduino_builder_config.json \
  --upload-tool teensyloader \
  --verbose \
  --flash-only \
  out/arduino_debug/obj/workshop/01-blinky/bin/blinky.elf

Tail the output with miniterm, (use Ctrl-] to quit).

python -m serial.tools.miniterm --raw - 115200

Viewing Tokenized Log Output

After compiling create/update the log token database.

python -m pw_tokenizer.database create --force \
  --database workshop/01-blinky/tokenizer_database.csv \
  out/arduino_debug/obj/workshop/01-blinky/blinky.main.cc.o

Flash blinky.elf and watch the serial output with:

This produces no output until hitting Ctrl-C.
python -m pw_tokenizer.serial_detokenizer \
  --device /dev/ttyACM0 --baudrate 115200 \
  workshop/01-blinky/tokenizer_database.csv

Viewing HLDC Encoded Log Output

This section WIP
python -m pw_hdlc_lite.rpc_console -o logfile.txt -d /dev/ttyACM0 \
  ./third_party/pigweed/pw_rpc/pw_rpc_protos/echo.proto
tail -F logfile.txt | python -m pw_tokenizer.detokenize \
  base64 workshop/01-blinky/tokenizer_database.csv