Loopback wiring for tests

Overview

This shield is less a plug-on module in the conventional sense than more a wiring for feedback of certain signals. It can be used to run most test cases for Zephyr drivers that require a loopback connection on hardware level.

Requirements

This shield requires a board which provides a configuration that allows:

  • two GPIO lines, 1st for output and 2nd for loopback input

  • two PWM lines, 1st for output and 2nd for loopback input

  • one PWM line for output and one ADC line for input

  • one SPI interface, MOSI for output and MISO for input

  • two I2C interfaces, 1st for slave and 2nd for master mode

  • two UART interfaces, 1st for counterpart and 2nd for test case

Note

Sometimes boards declare standard headers like Arduino R3 but not define all connections. Make sure that the board you are using have all definitions to avoid build errors (see Shields for more details).

Supported variations

The below table suggests shield variation accordingly with test cases. When a standard connector (arduino, mikrobus, tmph) is available on board, user should select the matching shield configuration. When loopback_test shield is used with a board that doesn’t feature a standard connector, a dedicated <board>.overlay file should be provided. The remaining configurations should be used based on the board standard headers available.

Connector Standard

Shield Designation

Variation

Without standard (overlay)

loopback_test

1

Arduino R3 (not yet, planned)

loopback_test_arduino

2

MikroBus (not yet, planned)

loopback_test_mikrobus

3

TiaC MAGPIE Pin Header

loopback_test_tmph

4

Build and Programming

Set -DSHIELD=<shield designation> when you invoke west build.

To build shield with specific overlay:

west build -b tiac_magpie zephyr/tests/drivers/gpio/gpio_basic_api -- -DSHIELD=loopback_test
west flash

To build shield with standard headers:

west build -b [tiac_magpie | nucleo_f746zg] zephyr/tests/drivers/gpio/gpio_basic_api -- -DSHIELD=[loopback_test_arduino | loopback_test_mikrobus | loopback_test_tmph]
west flash

Wiring Schematics

Arduino R3

not yet, planned

MikroBus

not yet, planned

TiaC MAGPIE Pin Header

TiaC MAGPIE Pin Header Loopback Wiring
GPIO loopback
1
2
3
4
5
	gpio_basic_api_0 {
		compatible = "test,gpio_basic_api";
		out-gpios = <&tmph2 9 0>;	/* TMPH2:10 */
		in-gpios = <&tmph2 11 0>;	/* TMPH2:12 */
	}; // gpio_basic_api_0
out-gpios

Identity of a GPIO that will be configured as an output. This must be on the same device as in-gpios, and physically connected to in-gpios.

in-gpios

Identity of a GPIO that will be configured as an input. This must be on the same device as out-gpios, and physically connected to out-gpios.

References