Setup
Intro + setup.
Getting to blinky.
Writing tests.
Calling RPCs.
Key Value Store.
Testing in the factory.
Instructions are the same as flashing blinky but passing in a different .elf
.
Run the compile with pw watch
or ninja -C out
.
Flash factory-test.elf
.
Teensy
arduino_unit_test_runner --config out/arduino_debug/gen/arduino_builder_config.json --upload-tool teensyloader --verbose --flash-only out/arduino_debug/obj/workshop/05-factory-test/bin/factory_test.elf
stm32f429i_disc1
openocd -s ${PW_PIGWEED_CIPD_INSTALL_DIR}/share/openocd/scripts -f ${PW_ROOT}/targets/stm32f429i_disc1/py/stm32f429i_disc1_utils/openocd_stm32f4xx.cfg -c "program out/stm32f429i_disc1_debug/obj/workshop/05-factory-test/bin/factory-test.elf reset exit"
Optional: Create / update the log token database. This will be automatically updated when compiling.
python -m pw_tokenizer.database create --force --database workshop/05-factory-test/tokenizer_database.csv out/arduino_debug/obj/workshop/05-factory-test/bin/factory-test.elf
Start the rpc_console that saves log output to a file.
python -m pw_hdlc.rpc_console -o logfile.txt -d /dev/ttyACM0 ./third_party/pigweed/pw_rpc/echo.proto
Tail the log output.
python -m pw_tokenizer.detokenize base64 workshop/05-factory-test/tokenizer_database.csv -i logfile.txt --follow
After flashing the factory-test.elf binary, execute the factory_test.py script.
python workshop/05-factory-test/factory_test.py --device /dev/ttyACM0 --baud 115200