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) |
1 |
|
Arduino R3 (not yet, planned) |
2 |
|
MikroBus (not yet, planned) |
3 |
|
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¶
not yet, planned
not yet, planned
for test cases in tests/drivers/gpio
needs test fixture: gpio_loopback in hardware map
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.
for test cases in tests/drivers/pwm
needs test fixture: pwm_loopback in hardware map
1 2 3 4 5 6 | pwm_loopback_0 {
compatible = "test,pwm_loopback";
/* channel 1 pwm out to channel 4 capture in */
pwms = <&tmph_pwms 1 0 0>, /* TMPH4:5 */
<&tmph_pwms 4 0 0>; /* TMPH1:3 */
}; // pwm_loopback_0
|
- pwms
PWM pins that will be used for generating and capturing a pulse-width modulated signal. The pin at the first index will be used for signal generation while the pin at the second index will be used for capuring the generated signal. The two pins must be physically connected to each other.
1 2 3 | &tmph_pwms {
status = "okay";
}; // tmph_pwms
|
1 2 3 | &tmph_timers {
status = "okay";
}; // tmph_timers
|
Attention
Not yet supported, missing integration test case.
for test cases in tests/drivers/spi
needs test fixture: spi_loopback in hardware map
1 2 3 | &tmph_spi1 {
status = "okay";
}; // tmph_spi1
|
for test cases in tests/drivers/i2c
needs test fixture: i2c_bus_short in hardware map
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | &tmph_i2c1 {
status = "okay";
eeprom1: eeprom@56 {
compatible = "atmel,at24";
reg = <0x56>;
size = <1024>;
pagesize = <16>;
address-width = <8>;
timeout = <5>;
status = "okay";
label = "EEPROM_1";
}; // eeprom1
}; // tmph_i2c1
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | &tmph_i2c2 {
status = "okay";
eeprom0: eeprom@54 {
compatible = "atmel,at24";
reg = <0x54>;
size = <1024>;
pagesize = <16>;
address-width = <8>;
timeout = <5>;
status = "okay";
label = "EEPROM_0";
}; // eeprom0
}; // tmph_i2c2
|
Transfer of commands from one bus controller to the other is accomplished by hardware through having the SCL (and SDA) signals shorted to join the two buses.
Attention
Not yet supported, missing integration test case.