Running Hardware Tests

This document provides instructions on running tests on hardware using the Unity framework. These tests call the Arduino APIs to execute and verify functionality.

Test Environment Setup

Note

The development environment setup is (currently) only supported on Linux 🐧.
As many tools and scripts are not cross-platform, some of them will not directly work on Windows 🔡 or macOS 🍎.

Important

To successfully run the tests, ensure that your development environment is properly configured.
See the section on Environment Setup.

Board Setup

  1. Connect your PSOC™ 6 board (e.g. CY8CKIT-062S2-AI) to your computer 💻 via USB.

  2. Make the board-to-board pin connections as described below:

    CY8CKIT-062S2-AI:

    Pin Connections for HIL Test Setup Between 2 Boards

    Test Name

    Board 1 Pin

    Board 2 Pin

    Description

    UART

    P10.1

    P10.0

    UART TX to RX

    P10.0

    P10.1

    UART RX to TX

    P9.4

    P9.4

    IO synch signal

    GND

    GND

    Common Ground

    Wire 1

    P0.2

    P0.2

    I2C SCL to SCL (with pullup)

    P0.3

    P0.3

    I2C SDA to SDA (with pullup)

    GND

    GND

    Common Ground

    SPI

    P9_0

    P9_0

    MOSI to MOSI

    P9_1

    P9_1

    MISO to MISO

    P9_2

    P9_2

    SCLK to SCLK

    P9_3 (IO_0)

    P9_3 (IO_0)

    GPIO pin as SPI SSEL

    P9.4

    P9.4

    IO synch signal

    GND

    GND

    Common Ground

    Advanced IO Pulse

    P9.5

    P9.5

    IO5 (Pulse Output) to

    IO5 (Pulse Input)

    P9.4

    P9.4

    IO synch signal

    Pin Connections for HIL Test Setup on Single Board

    Test Name

    Board 1 Pin

    Board 1 Pin

    Description

    Digital IO

    P9.6

    P9.7

    IO6 to IO7

    Wire 2

    P0.2

    P9.0

    I2C SCL to SCL (with pullup)

    P0.3

    P9.1

    I2C SDA TO SDA (with pullup)

    SPI

    P9_0

    P9_1

    MOSI and MISO shorted

    P9_2

    NC

    SCLK to SCLK

    Analog IO ADC

    P10.0

    VDDA 3.3V

    A0 connected to VDDA 3.3V

    P10.1

    VoltageDivider

    A1 connected to Voltage

    divider circuit as below:

    VDDA (3.3V)

    :

    [R1] <– Resistor 220 Ohms

    :

    +——-> A1 (Mid-Point)

    :

    [R2] <– Resistor 220 Ohms

    :

    GND (0V)

    Analog IO PWM

    P9.6

    P9.7

    IO6 (PWM feedback) to

    IO7 (PWM Output)

    Advanced IO Tone

    P9.6

    P9.7

    IO6 (Tone feedback) to

    IO7 (Tone Output)

Executing Test Cases Using make

The Makefile relies on arduino-cli for compiling, uploading, and monitoring. Unity is included as a library.

  1. Change directories:

    cd tests/arduino-core-tests
    
  2. Use the make command to run a specific test. For example, to run a digital I/O test:

    make FQBN= `FQBN` PORT= `PORT` test_digitalio_single monitor
    
    • FQBN: select the connected board (e.g., infineon:psoc6:cy8ckit_062s2_a).

    • PORT: set the appropriate serial port (e.g., /dev/ttyUSB0).

    • monitor : opens the serial monitor to view the test results.

  3. Display usage information about the available make targets:

    make help
    
  4. Start testing other features 🛠️ !