Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
391 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
# to use this, install [direnv](https://direnv.net/) | |||
source venv/bin/activate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,7 @@ | |||
/target | /target | ||
**/*.rs.bk | **/*.rs.bk | ||
**/*.py[cod] | |||
Cargo.lock | Cargo.lock | ||
.gdb_history | .gdb_history | ||
openocd.log | openocd.log | ||
/venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="cc1d", TAG+="uaccess", SYMLINK += "zissou" | |||
SUBSYSTEM=="tty", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="cc1d", TAG+="uaccess", SYMLINK += "zissouserial" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
# HIL Tests | |||
|
|||
These tests are driven from root directory with `make hil`. | |||
|
|||
The assumption is that a NUCLEO-L432KC is connected via USB adapter, | |||
with (Nucleo -> USB): PA12/D2 -> D+, PA11/D10 -> D- and GND -> GND. | |||
|
|||
cf. https://jamesmunns.com/blog/hardware-ci-overview/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
import pytest | |||
import serial as pyserial | |||
|
|||
|
|||
@pytest.fixture | |||
def serial(): | |||
"""The serial interface to Zissou.""" | |||
|
|||
# N.B. Everything after the yield is teardown | |||
with pyserial.Serial("/dev/zissouserial") as s: | |||
yield s | |||
|
|||
|
|||
def test_loopback(serial): | |||
"""Current behaviour - will change.""" | |||
|
|||
test_str = "Hello!" | |||
|
|||
sent = serial.write(test_str.encode()) | |||
assert sent == len(test_str) | |||
|
|||
read = serial.read_all() | |||
assert read.decode() == test_str.upper() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
[pytest] | |||
testpaths = hil-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
pyserial >=3.4 | |||
pytest >=4.5.0 | |||
pyusb >=1.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,10 @@ | |||
#!/bin/bash | |||
|
|||
# BAUD=115200 | |||
WHAT=/dev/zissouserial | |||
|
|||
while true | |||
do | |||
# stty -F ${WHAT} ${BAUD} # cdc-acm impl doesn't handle this properly | |||
cat ${WHAT} 2>/dev/null | |||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.