diff --git a/tests/psoc6/hw_ext/README.md b/tests/psoc6/hw_ext/README.md new file mode 100644 index 0000000000000..c53b65251055a --- /dev/null +++ b/tests/psoc6/hw_ext/README.md @@ -0,0 +1,33 @@ +# Extended Hardware Setup Tests + +The tests located in this folder implement the validation of hardware peripherals features (GPIO, I2C, SPI, etc.) which require additional or extended hardware configuration to the evaluation boards. + +The extended setup is meant to provide the necessary circuitry, electronic system or interface for the tests to be performed. For example, interconnecting some pins (with simple cables) and/or attach some external circuit, device, or discrete electronic components. + +## Boards Setup Diagram + +Find below the hardware diagrams for each of the supported boards: + +### CY8CPROTO-062-4343W + +![CY8CPROTO-062-4343W HIL setup](img/cy8cproto-062-4343w-hil-test-diag.png) + +### CY8CPROTO-063-BLE + +![CY8CPROTO-063-BLE HIL setup](img/cy8cproto-063-ble-hil-test-diag.png) + +## Developing Extended Hardware Setup Tests + +The driving principle for designing these tests is to keep a **simple** (as simple as possible), **reproducible** and **scalable** hardware-in-the-loop setup, by aiming for **self-contained** board setups using minimal or no hardware other than the board itself. + +Most of the MCU (and boards) provide a given feature and its complementary feature. What does we mean by a feature and its *complementary* feature? Conceptually, many protocols and system topologies are based on a complementary or opposite role interaction: input-output, master-slave, server-client or controller-peripheral, sender-receiver. Its operation is effective when they are interacting together. Thus, the evaluation of one of the is hardly achievable without each other. + +In our case, both roles are likely to be available and implementable in a single (or worst case, with a couple of) evaluation board. +For example, testing a GPIO input API functionality can be done by using a GPIO output API, and physically connecting the 2 ports together with a cable. +Another example would be to validate an ADC by connecting it to a DAC in the same board. Or connecting an instance of a I2C master to a I2C slave, in the same board, with a few cables and pull-up resistors. + +If this is the case, it will often simplify the whole testing hardware infrastructure by removing the need of external hardware devices and complex interfaces. For example, measuring equipment that is not always available, potentially expensive, and harder to reproduce and scale. + +Sometimes the *complementary* feature might not be available. In that case, it is worth to evaluate which is the most convenient approach. Let´s imagine we have a master SPI API which could be easily tested with a SPI slave in the same micocontroller. If it is not available it will require to be developed for MicroPython. Sure, it is an effort, but keep in mind that such SPI slave mode is not just a testing utility, but an usable enablement for MicroPython end (primary) users. Besides, how simple, reproducible, scalalable and automatable re the other options? + +Yes, also automatable. As the rests of the PSoC6 folder tests, these tests need to be able to **run automatically** under the MicroPython testing suite tools, without the requiring visual inspections and manual checks. That way they can be added to the Continuous Integration testing pipelines, and reassuring quality after every affected or relevant code change. \ No newline at end of file diff --git a/tests/psoc6/dut/adc.py b/tests/psoc6/hw_ext/adc.py similarity index 100% rename from tests/psoc6/dut/adc.py rename to tests/psoc6/hw_ext/adc.py diff --git a/tests/psoc6/dut/adc.py.exp b/tests/psoc6/hw_ext/adc.py.exp similarity index 100% rename from tests/psoc6/dut/adc.py.exp rename to tests/psoc6/hw_ext/adc.py.exp diff --git a/tests/psoc6/dut/i2c.py b/tests/psoc6/hw_ext/i2c.py similarity index 100% rename from tests/psoc6/dut/i2c.py rename to tests/psoc6/hw_ext/i2c.py diff --git a/tests/psoc6/dut/i2c.py.exp b/tests/psoc6/hw_ext/i2c.py.exp similarity index 100% rename from tests/psoc6/dut/i2c.py.exp rename to tests/psoc6/hw_ext/i2c.py.exp diff --git a/tests/psoc6/dut/i2s.py b/tests/psoc6/hw_ext/i2s.py similarity index 100% rename from tests/psoc6/dut/i2s.py rename to tests/psoc6/hw_ext/i2s.py diff --git a/tests/psoc6/dut/i2s.py.exp b/tests/psoc6/hw_ext/i2s.py.exp similarity index 100% rename from tests/psoc6/dut/i2s.py.exp rename to tests/psoc6/hw_ext/i2s.py.exp diff --git a/tests/psoc6/hw_ext/img/cy8cproto-062-4343w-hil-test-diag.png b/tests/psoc6/hw_ext/img/cy8cproto-062-4343w-hil-test-diag.png new file mode 100644 index 0000000000000..c5702142f69e4 Binary files /dev/null and b/tests/psoc6/hw_ext/img/cy8cproto-062-4343w-hil-test-diag.png differ diff --git a/tests/psoc6/hw_ext/img/cy8cproto-063-ble-hil-test-diag.png b/tests/psoc6/hw_ext/img/cy8cproto-063-ble-hil-test-diag.png new file mode 100644 index 0000000000000..febad4aeaa110 Binary files /dev/null and b/tests/psoc6/hw_ext/img/cy8cproto-063-ble-hil-test-diag.png differ diff --git a/tests/psoc6/dut/pin.py b/tests/psoc6/hw_ext/pin.py similarity index 100% rename from tests/psoc6/dut/pin.py rename to tests/psoc6/hw_ext/pin.py diff --git a/tests/psoc6/dut/pin.py.exp b/tests/psoc6/hw_ext/pin.py.exp similarity index 100% rename from tests/psoc6/dut/pin.py.exp rename to tests/psoc6/hw_ext/pin.py.exp diff --git a/tests/psoc6/dut/pwm.py b/tests/psoc6/hw_ext/pwm.py similarity index 100% rename from tests/psoc6/dut/pwm.py rename to tests/psoc6/hw_ext/pwm.py diff --git a/tests/psoc6/dut/pwm.py.exp b/tests/psoc6/hw_ext/pwm.py.exp similarity index 100% rename from tests/psoc6/dut/pwm.py.exp rename to tests/psoc6/hw_ext/pwm.py.exp diff --git a/tests/psoc6/dut/signal.py b/tests/psoc6/hw_ext/signal.py similarity index 100% rename from tests/psoc6/dut/signal.py rename to tests/psoc6/hw_ext/signal.py diff --git a/tests/psoc6/dut/signal.py.exp b/tests/psoc6/hw_ext/signal.py.exp similarity index 100% rename from tests/psoc6/dut/signal.py.exp rename to tests/psoc6/hw_ext/signal.py.exp