Separate/consolidate board initialization code, and a few functions that are shared across tests. Update the Makefile accordingly. Resolves #18
This directory contains the test code and other requirements in order to run the hardware integration tests for the Timely Reference.
The Docker image uses SEGGER's JLink software tools, and requires accepting their license. This may be swapped out for OpenOCD in the future.
Of course, the tools can also be installed directly into the host- Docker provides a (more) consistent runtime environment and forces documentation of setup steps.
Hardware Requirements
Current:
- STMicroelectronics Nucleo-L412-RB-P
- SEGGER J-Link (Any model should do)
- FTDI FT232R USB-Serial Breakout. Tested with this one from Amazon
- Sigrok-supported FX2 logic analyzer. Tested with Lcsoft Mini Board and another no-name board. Other Sigrok-supported could be supported easily.
The current hardware detection mechanisms may fail if more than one these devices is connected.
Execution
First, build the docker image. Depending on your execution environment, you may need to escalate privileges in order to run docker.
cd <project-root>
docker build -t tr-test test/
Then, execute the tests. The tests require access to the USB hardware components, so their files need to be volume-mounted in, and the container must be given privilege in order to access the devices.
docker run --privileged -it -v /dev/bus/usb:/dev/bus/usb -v $(pwd):/build-dir tr-test /build-dir/test/src/tr_test/test.py
The tests also accept other arguments accepted by pytest.