Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/periph: Add test using the Peripheral Selftest Shield #19932

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

maribu
Copy link
Member

@maribu maribu commented Sep 19, 2023

Contribution description

This adds a test that makes use of the peripheral selftesting shield.

ToDo

  • Add doc

Testing procedure

  • grab an Arduino UNO compatible board that has the Arduino pin map feature
  • connect it to the testing shield
  • configure the testing shield
    • make sure the VCC selector matches the logic level of the board (3.3V and 5V are the only options)
    • enabled all the "loops" needed for testing on SW1
    • it could be that the UART on D0, D1 is used for stdio. In that case, do NOT close the loop
  • flash and run the test application

Issues/PRs references

none

@maribu maribu added State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Area: tests Area: tests and testing framework labels Sep 19, 2023
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: doc Area: Documentation Platform: AVR Platform: This PR/issue effects AVR-based platforms Area: cpu Area: CPU/MCU ports labels Sep 19, 2023
@maribu maribu force-pushed the peripheral-selftest branch from 6193c8c to ba80fa1 Compare September 19, 2023 14:33
@maribu maribu removed the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Sep 19, 2023
@maribu maribu changed the title [WIP] tests/periph: Add test using the Peripheral Selftest Shield tests/periph: Add test using the Peripheral Selftest Shield Sep 19, 2023
@maribu
Copy link
Member Author

maribu commented Sep 19, 2023

Ah, it still contains unrelated commits (that are useful to not get the PWM test stuck on an assert()) and fix a bug on nRF. I'll drop them now.

@maribu maribu force-pushed the peripheral-selftest branch from ba80fa1 to fac5784 Compare September 19, 2023 14:36
@github-actions github-actions bot removed Platform: ARM Platform: This PR/issue effects ARM-based platforms Platform: AVR Platform: This PR/issue effects AVR-based platforms Area: cpu Area: CPU/MCU ports labels Sep 19, 2023
@maribu maribu force-pushed the peripheral-selftest branch from fac5784 to 4bf23bd Compare September 19, 2023 14:40
@MichelRottleuthner
Copy link
Contributor

Just ran it on nucleo-l476rg. Runs fine up to the SPI test but there it asserts in the spi_acquire in tests/periph/selftest_shield/main.c:777 due to an invalid SPI bus. It tries to use SPI_DEV(1) but only SPI_DEV(0) exists on this board. This is due to ARDUINO_SPI_D11D12D13 being unconditionally defined to SPI_DEV(1) in boards/common/nucleo64/include/arduino_iomap.h. So it seems like this will be at least a problem on all nucleo64 boards that only define a single SPI instance in periph_conf.

bors bot added a commit that referenced this pull request Sep 20, 2023
19914: boards: complete SD Card MTD definition for several bords r=benpicco a=gschorcht

### Contribution description

This PR completes the MTD definition for the following boards:
- `seeedstudio-gd32`
- `sipeed-longan-nano` including `sipeed-longan-nano-tft`
- `waveshare-nrf52840-eval-kit`
- ESP32x boards that have an SPI SD Card interface and use `mtd_sdcard_default`

### Testing procedure

Green CI

### Issues/PRs references#19465 

Prerequisite for PR #19465 

19915: drivers/lcd: support MCU 8080 8-bit parallel mode r=benpicco a=gschorcht

### Contribution description

LCD driver ICs usually support
- SPI serial mode,
- MCU 8080 8-bit parallel mode and
- MCU 8080 16-bit parallel mode.

This PR extends the LCD display driver API to support the MCU 8080 8-/16-bit parallel modes and implements a GPIO-driven MCU 8080 8-bit parallel mode.

The following features are already working locally and will be provided as follow-on PRs for which this PR is a prerequisite.

- GPIO-driven bit-banging implementation of the 16-bit mode of the MCU 8080 parallel interface
- Enabling the display on `stm32f723e-disco` and `stm32l496g-disco` using the feature above
- Definition of a low-level API for the parallel modes using the LCD controller of the MCU
- Using FMC for the display on `stm32f723e-disco` and `stm32l496g-disco`
- Using LCD controller for the display of `esp32-wt32-sc01-plus` (PR #19917)

### Testing procedure

The PR can be tested with PR #19917 on top of this PR.
```
BOARD=esp32s3-wt32-sc01-plus make -j8 -C tests/drivers/st77xx flash
```
The following video shows the test.

**Please note** The test is pretty slow because the display has 480 x 320 pixels and the MCU 8080 8-bit parallel interface is realized by a GPIO-driven bit-banging implementation where each GPIO of the data bus is set separately. A follow-up PR will use the ESP32-S3 LCD controller and DMA for this board. This PR just defines the extension of the driver by the parallel interface and provides the bit-banging implementation for MCUs that don't have a LCD controller on chip.

https://github.com/RIOT-OS/RIOT/assets/31932013/c1e3e3d7-05d9-4ca5-8fff-9a5eaca50fba

### Issues/PRs references

19919: drivers/st77xx: introduce rotation defines r=benpicco a=gschorcht

### Contribution description

The PR introduces counterclockwise rotations for the definition of parameter `ST77XX_PARAM_ROTATION`.

It is more intuitive and universal to use `ST77XX_ROTATION_{0,90,180,270}` instead of `ST77XX_ROTATION_{ST77XX_ROTATION_{VERT,VERT_FLIP,HORZ,HORZ_FLIP}`, especially because the orientation of the display may vary with respect to the orientation of the board.

### Testing procedure

`tests/drivers/st77xx` should still work, for example:
```
BOARD=adafruit-pybadge make -C tests/drivers/st77xx flash
```
```
BOARD=esp32s3-usb-otg make -j8 -C tests/drivers/st77xx flash
```

### Issues/PRs references


19931: boards: fix documentation for GD32V boards and doxygen 1.9.4 r=benpicco a=gschorcht

### Contribution description

This PR fixes some small problems in documentation of `sipeed-longan-nano`, `sipeed-longan-nano-tft` and `seeedstudio-gd32` for doxygen 1.9.4 that is used on `doc.riot-os.org`.

Doxygen version 1.9.4 doesn't like anymore
- single double quotes as symbol for the inches unit in the text
- line breaks in `[]()` to avoid exhausting the 100 characters per line.

See https://doc.riot-os.org/group__boards__sipeed__longan__nano.html for example.

Doxygen 1.9.1 which is part of `riot-docker` container didn't have theses problems 😟

### Testing procedure

Documentation should be fixed.

### Issues/PRs references


19935: boards/nucleo64: fix SPI Arduino mapping for most boards r=benpicco a=maribu

### Contribution description

Before, the Arduino SPI mapping for all Nucleo-64 boards was incorrect. With this, the situation improves to the following:

- [x] nucleo-f030r8
- [ ] nucleo-f070rb
    - No SPI buses provided.
- [x] nucleo-f072rb
- [x] nucleo-f091rc
- [x] nucleo-f103rb
- [ ] nucleo-f302r8
    - No SPI bus at D11, D12, D13 provided
- [x] nucleo-f303re
- [x] nucleo-f334r8
- [x] nucleo-f401re
- [x] nucleo-f410rb
- [x] nucleo-f411re
- [x] nucleo-f446re
- [x] nucleo-g070rb
- [x] nucleo-g071rb
- [x] nucleo-g431rb
- [x] nucleo-g474re
- [x] nucleo-l053r8
- [x] nucleo-l073rz
- [x] nucleo-l152re
    - No SPI bus at D11, D12, D13 provided
- [x] nucleo-l452re
- [x] nucleo-l476rg
- [x] nucleo-wl55jc

The remaining offenders still need to be fixed, but that is better done one PR at a time.

### Testing procedure

- Check if the SPI device provided in the given `boards/<BOARD_NAME>/incude/periph_conf.h` is indeed `SPI_DEV(0)`, or in `periph_conf.h` the correct SPI dev is found
    - this should be fine for all boards above, except for the unchecked ones

or:

- run #19932: The SPI test should pass now

### Issues/PRs references

Bug found in #19932 (comment)

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
bors bot added a commit that referenced this pull request Sep 20, 2023
19919: drivers/st77xx: introduce rotation defines r=benpicco a=gschorcht

### Contribution description

The PR introduces counterclockwise rotations for the definition of parameter `ST77XX_PARAM_ROTATION`.

It is more intuitive and universal to use `ST77XX_ROTATION_{0,90,180,270}` instead of `ST77XX_ROTATION_{ST77XX_ROTATION_{VERT,VERT_FLIP,HORZ,HORZ_FLIP}`, especially because the orientation of the display may vary with respect to the orientation of the board.

### Testing procedure

`tests/drivers/st77xx` should still work, for example:
```
BOARD=adafruit-pybadge make -C tests/drivers/st77xx flash
```
```
BOARD=esp32s3-usb-otg make -j8 -C tests/drivers/st77xx flash
```

### Issues/PRs references


19931: boards: fix documentation for GD32V boards and doxygen 1.9.4 r=benpicco a=gschorcht

### Contribution description

This PR fixes some small problems in documentation of `sipeed-longan-nano`, `sipeed-longan-nano-tft` and `seeedstudio-gd32` for doxygen 1.9.4 that is used on `doc.riot-os.org`.

Doxygen version 1.9.4 doesn't like anymore
- single double quotes as symbol for the inches unit in the text
- line breaks in `[]()` to avoid exhausting the 100 characters per line.

See https://doc.riot-os.org/group__boards__sipeed__longan__nano.html for example.

Doxygen 1.9.1 which is part of `riot-docker` container didn't have theses problems 😟

### Testing procedure

Documentation should be fixed.

### Issues/PRs references


19935: boards/nucleo64: fix SPI Arduino mapping for most boards r=benpicco a=maribu

### Contribution description

Before, the Arduino SPI mapping for all Nucleo-64 boards was incorrect. With this, the situation improves to the following:

- [x] nucleo-f030r8
- [ ] nucleo-f070rb
    - No SPI buses provided.
- [x] nucleo-f072rb
- [x] nucleo-f091rc
- [x] nucleo-f103rb
- [ ] nucleo-f302r8
    - No SPI bus at D11, D12, D13 provided
- [x] nucleo-f303re
- [x] nucleo-f334r8
- [x] nucleo-f401re
- [x] nucleo-f410rb
- [x] nucleo-f411re
- [x] nucleo-f446re
- [x] nucleo-g070rb
- [x] nucleo-g071rb
- [x] nucleo-g431rb
- [x] nucleo-g474re
- [x] nucleo-l053r8
- [x] nucleo-l073rz
- [x] nucleo-l152re
    - No SPI bus at D11, D12, D13 provided
- [x] nucleo-l452re
- [x] nucleo-l476rg
- [x] nucleo-wl55jc

The remaining offenders still need to be fixed, but that is better done one PR at a time.

### Testing procedure

- Check if the SPI device provided in the given `boards/<BOARD_NAME>/incude/periph_conf.h` is indeed `SPI_DEV(0)`, or in `periph_conf.h` the correct SPI dev is found
    - this should be fine for all boards above, except for the unchecked ones

or:

- run #19932: The SPI test should pass now

### Issues/PRs references

Bug found in #19932 (comment)

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 20, 2023
@riot-ci
Copy link

riot-ci commented Sep 20, 2023

Murdock results

✔️ PASSED

fe6c940 boards/nucleo-wl55jc: Add missing ARDUINO_I2C_UNO

Success Failures Total Runtime
525 0 525 03m:14s

Artifacts

Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can reduce the spam a bit...

diff --git a/tests/periph/selftest_shield/main.c b/tests/periph/selftest_shield/main.c
index 0c16fd85e2..65496bf067 100644
--- a/tests/periph/selftest_shield/main.c
+++ b/tests/periph/selftest_shield/main.c
@@ -641,14 +641,14 @@ static bool periph_i2c_test(void)
     ASSERT(pcf857x_gpio_init(&egpios, PCF857X_GPIO_PIN(0, 0), GPIO_OUT) == 0);
     ASSERT(pcf857x_gpio_init(&egpios, PCF857X_GPIO_PIN(0, 1), GPIO_IN) == 0);
 
-    for (unsigned i = 0; i < flaky_test_repetitions; i++) {
+    for (unsigned i = 0; i < flaky_test_repetitions && !failed; i++) {
         gpio_set(ARDUINO_PIN_9);
         failed |= TEST(pcf857x_gpio_read(&egpios, PCF857X_GPIO_PIN(0, 1)) != 0);
         gpio_clear(ARDUINO_PIN_9);
         failed |= TEST(pcf857x_gpio_read(&egpios, PCF857X_GPIO_PIN(0, 1)) == 0);
     }
 
-    for (unsigned i = 0; i < flaky_test_repetitions; i++) {
+    for (unsigned i = 0; i < flaky_test_repetitions && !failed; i++) {
         pcf857x_gpio_set(&egpios, PCF857X_GPIO_PIN(0, 0));
         failed |= TEST(gpio_read(ARDUINO_PIN_8) != 0);
         pcf857x_gpio_clear(&egpios, PCF857X_GPIO_PIN(0, 0));
@@ -783,7 +783,7 @@ static bool periph_spi_rxtx_test(spi_t bus, spi_mode_t mode, spi_clk_t clk,
     /* C̅S̅ should still be HIGH while no chip is selected */
     failed |= TEST(gpio_read(cs_check) != 0);
 
-    for (uint8_t i = 0; i < UINT8_MAX; i++) {
+    for (uint8_t i = 0; i < UINT8_MAX && !failed; i++) {
         uint16_t start = 0;
         if (IS_USED(MODULE_PERIPH_TIMER)) {
             start = timer_read(TIMER);
@@ -808,7 +808,7 @@ static bool periph_spi_rxtx_test(spi_t bus, spi_mode_t mode, spi_clk_t clk,
     failed |= TEST(gpio_read(cs_check) != 0);
 
     /* no also test for different sizes */
-    for (unsigned i = 1; i <= sizeof(testdata); i++) {
+    for (unsigned i = 1; i <= sizeof(testdata) && !failed; i++) {
         uint8_t target[sizeof(testdata) + 4];
         memset(target, 0x55, sizeof(target));
         /* C̅S̅ should be HIGH before chip is selected */
@@ -857,10 +857,10 @@ static bool periph_spi_test(void)
 
     /* using a signed comparison here to also compile when no SPI buses are
      * available for testing */
-    for (int i = 0; i < (int)ARRAY_SIZE(spi_buses); i++) {
+    for (int i = 0; i < (int)ARRAY_SIZE(spi_buses) && !failed; i++) {
         spi_t bus = spi_buses[i];
         gpio_t clk_check = spi_clk_check_pins[i];
-        for (unsigned j = 0; j < ARRAY_SIZE(clocks); j++) {
+        for (unsigned j = 0; j < ARRAY_SIZE(clocks) && !failed; j++) {
             spi_clk_t clk = clocks[j];
             uint32_t clk_hz = clk_hzs[j];
             failed |= periph_spi_rxtx_test(bus, SPI_MODE_0, clk, clk_hz, clk_check, false);

I also think it will be pretty hard to identify the failing parameters within the loops. Maybe one could count the failure messages and try to find the parameters from that...

If this is only meant to indicate pass/fail then better to keep it clean I would think.

@MrKevinWeiss
Copy link
Contributor

MrKevinWeiss commented Oct 5, 2023

Seems like all my boards are failing... Maybe it would be good to get rid of the kernel panic (ie. the problem @MichelRottleuthner found)

NODE:0:BOARD:nucleo-g474re: r
NODE:0:BOARD:nucleo-g474re: /home/weiss/wd/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM3" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line
NODE:0:BOARD:nucleo-g474re: Twisted not available, please install it if you want to use pyterm's JSON capabilities
NODE:0:BOARD:nucleo-g474re: Connect to serial port /dev/ttyACM3
NODE:0:BOARD:nucleo-g474re: Welcome to pyterm!
NODE:0:BOARD:nucleo-g474re: Type '/exit' to exit.
NODE:0:BOARD:nucleo-g474re: READY
NODE:0:BOARD:nucleo-g474re: s
NODE:0:BOARD:nucleo-g474re: START
NODE:0:BOARD:nucleo-g474re: main(): This is RIOT! (Version: 2023.10-devel-260-g4bf23-peripheral-selftest)
NODE:0:BOARD:nucleo-g474re: self-testing peripheral drivers
NODE:0:BOARD:nucleo-g474re: ===============================
NODE:0:BOARD:nucleo-g474re: Starting test for GPIO at tests/periph/selftest_shield/main.c:283
NODE:0:BOARD:nucleo-g474re: [OK]
NODE:0:BOARD:nucleo-g474re: Starting test for GPIO at tests/periph/selftest_shield/main.c:305
NODE:0:BOARD:nucleo-g474re: [OK]
NODE:0:BOARD:nucleo-g474re: Starting test for GPIO at tests/periph/selftest_shield/main.c:335
NODE:0:BOARD:nucleo-g474re: [OK]
NODE:0:BOARD:nucleo-g474re: Starting test for GPIO at tests/periph/selftest_shield/main.c:365
NODE:0:BOARD:nucleo-g474re: [OK]
NODE:0:BOARD:nucleo-g474re: Starting test for GPIO at tests/periph/selftest_shield/main.c:391
NODE:0:BOARD:nucleo-g474re: (skipped)
NODE:0:BOARD:nucleo-g474re: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:438
NODE:0:BOARD:nucleo-g474re: [OK]
NODE:0:BOARD:nucleo-g474re: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:501
NODE:0:BOARD:nucleo-g474re: [OK]
NODE:0:BOARD:nucleo-g474re: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:564
NODE:0:BOARD:nucleo-g474re: [OK]
NODE:1:BOARD:nucleo-g070rb: r
NODE:0:BOARD:nucleo-g474re: Starting test for I2C at tests/periph/selftest_shield/main.c:638
NODE:1:BOARD:nucleo-g070rb: /home/weiss/wd/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM1" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line
NODE:1:BOARD:nucleo-g070rb: Twisted not available, please install it if you want to use pyterm's JSON capabilities
NODE:1:BOARD:nucleo-g070rb: Connect to serial port /dev/ttyACM1
NODE:1:BOARD:nucleo-g070rb: Welcome to pyterm!
NODE:1:BOARD:nucleo-g070rb: Type '/exit' to exit.
NODE:1:BOARD:nucleo-g070rb: READY
NODE:0:BOARD:nucleo-g474re: [OK]
NODE:0:BOARD:nucleo-g474re: Starting test for SPI at tests/periph/selftest_shield/main.c:763
NODE:0:BOARD:nucleo-g474re: 8002427
NODE:0:BOARD:nucleo-g474re: *** RIOT kernel panic:
NODE:0:BOARD:nucleo-g474re: FAILED ASSERTION.
NODE:0:BOARD:nucleo-g474re: 
NODE:0:BOARD:nucleo-g474re: *** halted.
NODE:0:BOARD:nucleo-g474re: 
NODE:1:BOARD:nucleo-g070rb: s
NODE:1:BOARD:nucleo-g070rb: START
NODE:1:BOARD:nucleo-g070rb: main(): This is RIOT! (Version: 2023.10-devel-260-g4bf23-peripheral-selftest)
NODE:1:BOARD:nucleo-g070rb: self-testing peripheral drivers
NODE:1:BOARD:nucleo-g070rb: ===============================
NODE:1:BOARD:nucleo-g070rb: Starting test for GPIO at tests/periph/selftest_shield/main.c:283
NODE:1:BOARD:nucleo-g070rb: [OK]
NODE:1:BOARD:nucleo-g070rb: Starting test for GPIO at tests/periph/selftest_shield/main.c:305
NODE:1:BOARD:nucleo-g070rb: [OK]
NODE:1:BOARD:nucleo-g070rb: Starting test for GPIO at tests/periph/selftest_shield/main.c:335
NODE:1:BOARD:nucleo-g070rb: [OK]
NODE:1:BOARD:nucleo-g070rb: Starting test for GPIO at tests/periph/selftest_shield/main.c:365
NODE:1:BOARD:nucleo-g070rb: [OK]
NODE:1:BOARD:nucleo-g070rb: Starting test for GPIO at tests/periph/selftest_shield/main.c:391
NODE:1:BOARD:nucleo-g070rb: (skipped)
NODE:1:BOARD:nucleo-g070rb: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:438
NODE:1:BOARD:nucleo-g070rb: [OK]
NODE:1:BOARD:nucleo-g070rb: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:501
NODE:1:BOARD:nucleo-g070rb: [OK]
NODE:1:BOARD:nucleo-g070rb: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:564
NODE:1:BOARD:nucleo-g070rb: [OK]
NODE:1:BOARD:nucleo-g070rb: Starting test for I2C at tests/periph/selftest_shield/main.c:638
NODE:2:BOARD:nucleo-f303re: r
NODE:2:BOARD:nucleo-f303re: /home/weiss/wd/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line
NODE:2:BOARD:nucleo-f303re: Twisted not available, please install it if you want to use pyterm's JSON capabilities
NODE:2:BOARD:nucleo-f303re: Connect to serial port /dev/ttyACM0
NODE:2:BOARD:nucleo-f303re: Welcome to pyterm!
NODE:2:BOARD:nucleo-f303re: Type '/exit' to exit.
NODE:2:BOARD:nucleo-f303re: READY
NODE:1:BOARD:nucleo-g070rb: [OK]
NODE:1:BOARD:nucleo-g070rb: Starting test for SPI at tests/periph/selftest_shield/main.c:763
NODE:1:BOARD:nucleo-g070rb: 8002297
NODE:1:BOARD:nucleo-g070rb: *** RIOT kernel panic:
NODE:1:BOARD:nucleo-g070rb: FAILED ASSERTION.
NODE:1:BOARD:nucleo-g070rb: 
NODE:1:BOARD:nucleo-g070rb: *** halted.
NODE:1:BOARD:nucleo-g070rb: 
NODE:2:BOARD:nucleo-f303re: s
NODE:2:BOARD:nucleo-f303re: START
NODE:2:BOARD:nucleo-f303re: main(): This is RIOT! (Version: 2023.10-devel-260-g4bf23-peripheral-selftest)
NODE:2:BOARD:nucleo-f303re: self-testing peripheral drivers
NODE:2:BOARD:nucleo-f303re: ===============================
NODE:2:BOARD:nucleo-f303re: Starting test for GPIO at tests/periph/selftest_shield/main.c:283
NODE:2:BOARD:nucleo-f303re: [OK]
NODE:2:BOARD:nucleo-f303re: Starting test for GPIO at tests/periph/selftest_shield/main.c:305
NODE:2:BOARD:nucleo-f303re: [OK]
NODE:2:BOARD:nucleo-f303re: Starting test for GPIO at tests/periph/selftest_shield/main.c:335
NODE:2:BOARD:nucleo-f303re: [OK]
NODE:2:BOARD:nucleo-f303re: Starting test for GPIO at tests/periph/selftest_shield/main.c:365
NODE:2:BOARD:nucleo-f303re: [OK]
NODE:2:BOARD:nucleo-f303re: Starting test for GPIO at tests/periph/selftest_shield/main.c:391
NODE:2:BOARD:nucleo-f303re: (skipped)
NODE:2:BOARD:nucleo-f303re: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:438
NODE:2:BOARD:nucleo-f303re: [OK]
NODE:2:BOARD:nucleo-f303re: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:501
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:509
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:514
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:519
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:524
NODE:3:BOARD:nucleo-l433rc: r
NODE:3:BOARD:nucleo-l433rc: /home/weiss/wd/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM2" -b "115200" --no-reconnect --noprefix --no-repeat-command-on-empty-line
NODE:3:BOARD:nucleo-l433rc: Twisted not available, please install it if you want to use pyterm's JSON capabilities
NODE:3:BOARD:nucleo-l433rc: Connect to serial port /dev/ttyACM2
NODE:3:BOARD:nucleo-l433rc: Welcome to pyterm!
NODE:3:BOARD:nucleo-l433rc: Type '/exit' to exit.
NODE:3:BOARD:nucleo-l433rc: READY
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:529
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:541
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:545
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:550
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:555
NODE:2:BOARD:nucleo-f303re: [FAILED]
NODE:2:BOARD:nucleo-f303re: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:564
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:572
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:577
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:582
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:587
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:592
NODE:3:BOARD:nucleo-l433rc: s
NODE:3:BOARD:nucleo-l433rc: START
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:604
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:608
NODE:3:BOARD:nucleo-l433rc: main(): This is RIOT! (Version: 2023.10-devel-260-g4bf23-peripheral-selftest)
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:613
NODE:3:BOARD:nucleo-l433rc: self-testing peripheral drivers
NODE:3:BOARD:nucleo-l433rc: ===============================
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:618
NODE:2:BOARD:nucleo-f303re: [FAILED]
NODE:3:BOARD:nucleo-l433rc: Starting test for GPIO at tests/periph/selftest_shield/main.c:283
NODE:3:BOARD:nucleo-l433rc: [OK]
NODE:2:BOARD:nucleo-f303re: Starting test for I2C at tests/periph/selftest_shield/main.c:638
NODE:3:BOARD:nucleo-l433rc: Starting test for GPIO at tests/periph/selftest_shield/main.c:305
NODE:3:BOARD:nucleo-l433rc: [OK]
NODE:3:BOARD:nucleo-l433rc: Starting test for GPIO at tests/periph/selftest_shield/main.c:335
NODE:3:BOARD:nucleo-l433rc: [OK]
NODE:3:BOARD:nucleo-l433rc: Starting test for GPIO at tests/periph/selftest_shield/main.c:365
NODE:3:BOARD:nucleo-l433rc: [OK]
NODE:3:BOARD:nucleo-l433rc: Starting test for GPIO at tests/periph/selftest_shield/main.c:391
NODE:3:BOARD:nucleo-l433rc: (skipped)
NODE:3:BOARD:nucleo-l433rc: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:438
NODE:3:BOARD:nucleo-l433rc: [OK]
NODE:2:BOARD:nucleo-f303re: [OK]
NODE:3:BOARD:nucleo-l433rc: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:501
NODE:2:BOARD:nucleo-f303re: Starting test for SPI at tests/periph/selftest_shield/main.c:763
NODE:3:BOARD:nucleo-l433rc: [OK]
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:780
NODE:3:BOARD:nucleo-l433rc: Starting test for GPIO-IRQ at tests/periph/selftest_shield/main.c:564
NODE:3:BOARD:nucleo-l433rc: [OK]
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:806
NODE:3:BOARD:nucleo-l433rc: Starting test for I2C at tests/periph/selftest_shield/main.c:638
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:832
NODE:2:BOARD:nucleo-f303re: [FAILED]
NODE:3:BOARD:nucleo-l433rc: FAILURE in tests/periph/selftest_shield/main.c:648
NODE:3:BOARD:nucleo-l433rc: [FAILED]
NODE:2:BOARD:nucleo-f303re: Starting test for SPI at tests/periph/selftest_shield/main.c:763
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:780
NODE:3:BOARD:nucleo-l433rc: Starting test for SPI at tests/periph/selftest_shield/main.c:763
NODE:3:BOARD:nucleo-l433rc: 8002493
NODE:3:BOARD:nucleo-l433rc: *** RIOT kernel panic:
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:806
NODE:3:BOARD:nucleo-l433rc: FAILED ASSERTION.
NODE:3:BOARD:nucleo-l433rc: 
NODE:3:BOARD:nucleo-l433rc: *** halted.
NODE:3:BOARD:nucleo-l433rc: 
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:832
NODE:2:BOARD:nucleo-f303re: [FAILED]
NODE:2:BOARD:nucleo-f303re: Starting test for SPI at tests/periph/selftest_shield/main.c:763
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:796
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:806
NODE:2:BOARD:nucleo-f303re: [FAILED]
NODE:2:BOARD:nucleo-f303re: Starting test for SPI at tests/periph/selftest_shield/main.c:763
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:796
NODE:2:BOARD:nucleo-f303re: FAILURE in tests/periph/selftest_shield/main.c:806
NODE:2:BOARD:nucleo-f303re: [FAILED]
NODE:2:BOARD:nucleo-f303re: 
NODE:2:BOARD:nucleo-f303re: 
NODE:2:BOARD:nucleo-f303re: SOME TESTS FAILED
NODE:2:BOARD:nucleo-f303re: { "threads": [{ "name": "main", "stack_size": 1536, "stack_used": 488 }]}
NODE:0:BOARD:nucleo-g474re: Timeout in expect script at "child.expect("ALL TESTS SUCCEEDED")" (tests/periph/selftest_shield/tests/01-run.py:17)
NODE:0:BOARD:nucleo-g474re: 
NODE:0:BOARD:nucleo-g474re: make: *** [/home/weiss/wd/RIOT/makefiles/tests/tests.inc.mk:26: test] Error 1
NODE:1:BOARD:nucleo-g070rb: Timeout in expect script at "child.expect("ALL TESTS SUCCEEDED")" (tests/periph/selftest_shield/tests/01-run.py:17)
NODE:1:BOARD:nucleo-g070rb: 
NODE:1:BOARD:nucleo-g070rb: make: *** [/home/weiss/wd/RIOT/makefiles/tests/tests.inc.mk:26: test] Error 1
NODE:2:BOARD:nucleo-f303re: Timeout in expect script at "child.expect("ALL TESTS SUCCEEDED")" (tests/periph/selftest_shield/tests/01-run.py:17)
NODE:2:BOARD:nucleo-f303re: 
NODE:2:BOARD:nucleo-f303re: make: *** [/home/weiss/wd/RIOT/makefiles/tests/tests.inc.mk:26: test] Error 1
NODE:3:BOARD:nucleo-l433rc: Timeout in expect script at "child.expect("ALL TESTS SUCCEEDED")" (tests/periph/selftest_shield/tests/01-run.py:17)
NODE:3:BOARD:nucleo-l433rc: 
NODE:3:BOARD:nucleo-l433rc: make: *** [/home/weiss/wd/RIOT/makefiles/tests/tests.inc.mk:26: test] Error 1
RESULT:NODE:0:BOARD:nucleo-g474re: 2
RESULT:NODE:1:BOARD:nucleo-g070rb: 2
RESULT:NODE:2:BOARD:nucleo-f303re: 2
RESULT:NODE:3:BOARD:nucleo-l433rc: 2

@maribu maribu added the CI: ready for merge train 🚃 PR is ready to be merged and awaiting the next merge train label Nov 2, 2023
@MrKevinWeiss
Copy link
Contributor

bors merge

bors bot added a commit that referenced this pull request Nov 2, 2023
19932: tests/periph: Add test using the Peripheral Selftest Shield r=MrKevinWeiss a=maribu

### Contribution description

This adds a test that makes use of the peripheral selftesting shield.

#### ToDo

- [x] Add doc

### Testing procedure

- grab an Arduino UNO compatible board that has the Arduino pin map feature
- connect it to the testing shield
- configure the testing shield
    - make sure the VCC selector matches the logic level of the board (3.3V and 5V are the only options)
    - enabled all the "loops" needed for testing on SW1
    - it could be that the UART on D0, D1 is used for stdio. In that case, do *NOT* close the loop
- flash and run the test application

### Issues/PRs references

none

19992: sys/psa_crypto: Fix build problems r=MrKevinWeiss a=Einhornhool

### Contribution description
This fixes several problems:

#### 1. Empty union in cipher context when `MODULE_PSA_CIPHER` is not selected.
PSA operations are now separated into modules. Functions and contexts are only built when the corresponding module is selected. This way there won't be problems with missing or unitialized structures in unused modules anymore.

#### 2. Zero-size array when using secure elements and `PSA_MAX_KEY_DATA_SIZE == 0`
I added a condition to the `psa_key_slot_t` structure in `psa_key_slot_management.h`.
Also the existence of key slot management functions and key slot structures now depends on the number of allocated key slots instead of selected modules.
This way key structures will not exist unless they are used.

### Testing procedure
Add the following to `examples/hello_world/Makefile` and call make : 
```
USEMODULE += psa_crypto
USEMODULE += psa_hash
USEMODULE += psa_hash_sha_256
USEMODULE += psa_secure_element
```
Output on Master:
```
"make" -C /home/lena/work/RIOT/boards/common/init
"make" -C /home/lena/work/RIOT/boards/native
"make" -C /home/lena/work/RIOT/boards/native/drivers
"make" -C /home/lena/work/RIOT/core
"make" -C /home/lena/work/RIOT/core/lib
"make" -C /home/lena/work/RIOT/cpu/native
"make" -C /home/lena/work/RIOT/cpu/native/periph
"make" -C /home/lena/work/RIOT/cpu/native/stdio_native
"make" -C /home/lena/work/RIOT/drivers
"make" -C /home/lena/work/RIOT/drivers/periph_common
"make" -C /home/lena/work/RIOT/sys
"make" -C /home/lena/work/RIOT/sys/auto_init
"make" -C /home/lena/work/RIOT/sys/libc
"make" -C /home/lena/work/RIOT/sys/luid
"make" -C /home/lena/work/RIOT/sys/preprocessor
"make" -C /home/lena/work/RIOT/sys/psa_crypto
In file included from /home/lena/work/RIOT/sys/include/psa_crypto/psa/crypto.h:39,
                 from /home/lena/work/RIOT/sys/psa_crypto/psa_crypto_algorithm_dispatch.c:23:
/home/lena/work/RIOT/sys/include/psa_crypto/psa/crypto_struct.h:137:11: error: union has no members [-Werror=pedantic]
  137 |     union cipher_context {
      |           ^~~~~~~~~~~~~~
In file included from /home/lena/work/RIOT/sys/psa_crypto/include/psa_crypto_operation_encoder.h:32,
                 from /home/lena/work/RIOT/sys/psa_crypto/psa_crypto_algorithm_dispatch.c:28:
/home/lena/work/RIOT/sys/psa_crypto/include/psa_crypto_slot_management.h:82:17: error: ISO C forbids zero-size array ‘data’ [-Werror=pedantic]
   82 |         uint8_t data[PSA_MAX_KEY_DATA_SIZE];    /**< Key data buffer */
      |                 ^~~~
cc1: all warnings being treated as errors
make[3]: *** [/home/lena/work/RIOT/Makefile.base:146: /home/lena/work/RIOT/examples/hello-world/bin/native/psa_crypto/psa_crypto_algorithm_dispatch.o] Error 1
make[2]: *** [/home/lena/work/RIOT/Makefile.base:31: ALL--/home/lena/work/RIOT/sys/psa_crypto] Error 2
make[1]: *** [/home/lena/work/RIOT/Makefile.base:31: ALL--/home/lena/work/RIOT/sys] Error 2
make: *** [/home/lena/work/RIOT/examples/hello-world/../../Makefile.include:761: application_hello-world.module] Error 2
```
Output with fixes:
```
"make" -C /home/lena/work/RIOT/boards/common/init
"make" -C /home/lena/work/RIOT/boards/native
"make" -C /home/lena/work/RIOT/boards/native/drivers
"make" -C /home/lena/work/RIOT/core
"make" -C /home/lena/work/RIOT/core/lib
"make" -C /home/lena/work/RIOT/cpu/native
"make" -C /home/lena/work/RIOT/cpu/native/periph
"make" -C /home/lena/work/RIOT/cpu/native/stdio_native
"make" -C /home/lena/work/RIOT/drivers
"make" -C /home/lena/work/RIOT/drivers/periph_common
"make" -C /home/lena/work/RIOT/sys
"make" -C /home/lena/work/RIOT/sys/auto_init
"make" -C /home/lena/work/RIOT/sys/libc
"make" -C /home/lena/work/RIOT/sys/luid
"make" -C /home/lena/work/RIOT/sys/preprocessor
"make" -C /home/lena/work/RIOT/sys/psa_crypto
"make" -C /home/lena/work/RIOT/sys/psa_crypto/psa_key_slot_mgmt
"make" -C /home/lena/work/RIOT/sys/psa_crypto/psa_se_mgmt
"make" -C /home/lena/work/RIOT/sys/random
/usr/bin/ld: warning: /home/lena/work/RIOT/examples/hello-world/bin/native/hello-world.elf has a LOAD segment with RWX permissions
   text	   data	    bss	    dec	    hex	filename
  29764	    584	  47856	  78204	  1317c	/home/lena/work/RIOT/examples/hello-world/bin/native/hello-world.elf
```

20042: dist/tools/uf2: add target to also copy families.json file r=MrKevinWeiss a=MichelRottleuthner

### Contribution description

The updated UF2 pkg (#20035) stores the family ID in an external .json file. I overlooked that and flashing fails if this file is not present. This PR fixes it by also copying the json into the tool folder.

### Testing procedure
Check if the `feather-nrf52840-sense` can be flashed when the new UF2 pkg is cloned freshly.


### Issues/PRs references
 Fixes a regression introduced with #20035 


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: Lena Boeckmann <lena.boeckmann@haw-hamburg.de>
Co-authored-by: Michel Rottleuthner <michel.rottleuthner@haw-hamburg.de>
Copy link
Contributor

bors bot commented Nov 3, 2023

Build failed (retrying...):

bors bot added a commit that referenced this pull request Nov 3, 2023
19932: tests/periph: Add test using the Peripheral Selftest Shield r=MrKevinWeiss a=maribu

### Contribution description

This adds a test that makes use of the peripheral selftesting shield.

#### ToDo

- [x] Add doc

### Testing procedure

- grab an Arduino UNO compatible board that has the Arduino pin map feature
- connect it to the testing shield
- configure the testing shield
    - make sure the VCC selector matches the logic level of the board (3.3V and 5V are the only options)
    - enabled all the "loops" needed for testing on SW1
    - it could be that the UART on D0, D1 is used for stdio. In that case, do *NOT* close the loop
- flash and run the test application

### Issues/PRs references

none

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Copy link
Contributor

bors bot commented Nov 3, 2023

Build failed:

@MrKevinWeiss
Copy link
Contributor

ugg, maybe casting is needed...

@maribu maribu force-pushed the peripheral-selftest branch from 730d2bf to 9fa8ec3 Compare November 6, 2023 12:36
@maribu
Copy link
Member Author

maribu commented Nov 6, 2023

bors retry

1 similar comment
@maribu
Copy link
Member Author

maribu commented Nov 6, 2023

bors retry

@maribu maribu added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 6, 2023
@maribu
Copy link
Member Author

maribu commented Nov 6, 2023

bors retry

1 similar comment
@maribu
Copy link
Member Author

maribu commented Nov 6, 2023

bors retry

@benpicco
Copy link
Contributor

benpicco commented Nov 6, 2023

bors ping

@MrKevinWeiss
Copy link
Contributor

bors merge

@maribu maribu force-pushed the peripheral-selftest branch from 9fa8ec3 to 10ff296 Compare November 10, 2023 08:58
@maribu maribu added this pull request to the merge queue Nov 10, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 10, 2023
This test application makes use of the RIOT Peripheral Selftest Shield,
which connects e.g. PWM to ADC or SPI MOSI to SPI MISO, UART TXD to RXD,
etc. This provides quick and fully automated self testing capabilities.

Please note that the simplicity and ease of use of the hardware comes
with a prices: There are whole classes of issues that cannot be detected
automatically. This test cannot replace other testing approaches
(such as manual testing or PHiLIP on the HiL), but only complement them.
@maribu maribu force-pushed the peripheral-selftest branch from 10ff296 to 03fdeec Compare November 10, 2023 14:15
@github-actions github-actions bot added the Area: boards Area: Board ports label Nov 10, 2023
The feature `arduino_i2c` was already provided, but the define this
feature indicates to be present is missing.
@maribu maribu force-pushed the peripheral-selftest branch from 03fdeec to fe6c940 Compare November 10, 2023 15:30
@maribu maribu enabled auto-merge November 10, 2023 15:36
@maribu maribu added this pull request to the merge queue Nov 10, 2023
Merged via the queue into RIOT-OS:master with commit bf582b0 Nov 10, 2023
24 checks passed
@maribu maribu deleted the peripheral-selftest branch November 11, 2023 12:58
@maribu
Copy link
Member Author

maribu commented Nov 11, 2023

Thx everyone! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: doc Area: Documentation Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: ready for merge train 🚃 PR is ready to be merged and awaiting the next merge train
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants