tests/periph: Add test using the Peripheral Selftest Shield#19932
tests/periph: Add test using the Peripheral Selftest Shield#19932maribu merged 2 commits intoRIOT-OS:masterfrom
Conversation
6193c8c to
ba80fa1
Compare
|
Ah, it still contains unrelated commits (that are useful to not get the PWM test stuck on an |
ba80fa1 to
fac5784
Compare
fac5784 to
4bf23bd
Compare
|
Just ran it on |
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 <[email protected]> Co-authored-by: Marian Buschsieweke <[email protected]>
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 <[email protected]>
Co-authored-by: Marian Buschsieweke <[email protected]>
There was a problem hiding this comment.
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.
|
Seems like all my boards are failing... Maybe it would be good to get rid of the kernel panic (ie. the problem @MichelRottleuthner found) Details |
|
bors merge |
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 <[email protected]>
Co-authored-by: Lena Boeckmann <[email protected]>
Co-authored-by: Michel Rottleuthner <[email protected]>
|
Build failed (retrying...): |
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 <[email protected]>
|
Build failed: |
|
ugg, maybe casting is needed... |
730d2bf to
9fa8ec3
Compare
|
bors retry |
1 similar comment
|
bors retry |
|
bors retry |
1 similar comment
|
bors retry |
|
bors ping |
|
bors merge |
9fa8ec3 to
10ff296
Compare
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.
10ff296 to
03fdeec
Compare
The feature `arduino_i2c` was already provided, but the define this feature indicates to be present is missing.
03fdeec to
fe6c940
Compare
|
Thx everyone! :-) |
Contribution description
This adds a test that makes use of the peripheral selftesting shield.
ToDo
Testing procedure
Issues/PRs references
none