1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

42601 Commits

Author SHA1 Message Date
bors[bot]
cf2d66ede8
Merge #19193 #19214
19193: rust: Update dependencies, use riot-wrappers from git r=benpicco a=chrysn

### Contribution description

As riot-wrappers has advanced a bit since it was last released, Rust modules are switched to using it from git again. (This is a regular ping-pong between testing the latest release in RIOT master, and using released support crates when they're current).

This primarily updates riot-wrappers, which has accumulated several compatible changes. Several other crates receive updates as well.

### Testing procedure

* Green CI

### Issues/PRs references

Changes on the riot-wrappers side:

* https://github.com/RIOT-OS/rust-riot-wrappers/pull/17
* https://github.com/RIOT-OS/rust-riot-wrappers/pull/22
* https://github.com/RIOT-OS/rust-riot-wrappers/pull/29
* https://github.com/RIOT-OS/rust-riot-wrappers/pull/30

[edit: added:]

This also serves to help preparing a 0.8.1 release of riot-wrappers, which performs some deprecations so that a breaking 0.9 change can be done more effortlessly later on.

19214: cpu/gd32v: add periph_spi support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_spi` support and is one of a bunch of PRs that complete the peripheral drivers for GD32VF103.

The driver is a modified version of the driver for STM32F1 with some changes that were necessary to get it working on GD32V.

### Testing procedure

`tests/periph_spi` as well as a test with any SPI sensor should work. `tests/driver_sdcard_spi` should work on `sipeed-longan-nano`.

### Issues/PRs references

Depeneds on PR #19216 

Co-authored-by: chrysn <chrysn@fsfe.org>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-02-01 11:13:05 +00:00
Gunar Schorcht
929bb3e0ab dist/tools/doccheck: add ST7735 config to generic_exclude_pattern 2023-02-01 02:44:54 +01:00
Gunar Schorcht
1e5b89c40b dist/tools/doccheck: add SD_SPI CARD config to generic_exclude_pattern 2023-02-01 02:44:54 +01:00
Gunar Schorcht
4b3663ee02 dist/tools/doccheck: add SPI config to generic_exclude_pattern 2023-02-01 02:44:54 +01:00
Gunar Schorcht
8d3369acc7 boards/sipeed-longan-nano: add SPI configuration 2023-02-01 02:44:54 +01:00
Gunar Schorcht
b2c0062393 boards/seeedstudio-gd32v: add SPI configuration 2023-02-01 02:44:54 +01:00
Gunar Schorcht
ea6a9d3f36 boards/common/gd32v: add default SPI configuration 2023-02-01 02:37:54 +01:00
Gunar Schorcht
42b683a89e cpu/gdv32: add SPI support 2023-02-01 02:37:54 +01:00
bors[bot]
2c525769c3
Merge #19219
19219: doc/porting-boards.md: fix code snippets in Riot web page/doxygen r=benpicco a=krzysztof-cabaj

### Contribution description

PR #19206 fix issues with code snippets in the[ `porting-boards.md`](https://github.com/RIOT-OS/RIOT/blob/master/doc/doxygen/src/porting-boards.md) presented by GitHub.  However, in Riot web page comments in code snippets are not presented and in effect section `doc.txt` shows empty area - see [dox.txt section](https://doc.riot-os.org/porting-boards.html). 

This PR should fix this - it change for this code snippet C code to generic code.  

### Testing procedure

Generation of doxygen documentation by CI process and manual check if this change fix the problem.

### Issues/PRs references

PR #19206

Co-authored-by: krzysztof-cabaj <kcabaj@gmail.com>
2023-02-01 01:22:21 +00:00
bors[bot]
718e4a8340
Merge #16782 #19201
16782: drivers/mfrc522: add new driver r=benpicco a=HendrikVE

### Contribution description

This PR adds support for the MFRC522. It is quite common in the Arduino world and it is quite cheap. The driver connects to the MFRC522 via SPI and is heavily based on the Arduino driver available [here](https://github.com/miguelbalboa/rfid). Basically it was ported, but with several improvements in readability and documentation.

### Testing procedure

The given (manual) test provides single commands for some driver functions.

19201: cpu/gd32v: add periph_i2c support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_i2c` support and is one of a bunch of PRs that complete the peripheral drivers for GD32VF103.

The driver is a modified version of the driver for STM32F1 with some changes that were necessary to get it working on GD32V. As  for STM32F1, the driver is using polling instead of interrupts for now. It will be implemented interrupt-driven later.

### Testing procedure

`tests/periph_i2c` as well as a test with any I2C sensor should work. The driver was tested with `tests/driver_l3gxxxx` and `tests/driver_bmp180`.

### Issues/PRs references


Co-authored-by: Hendrik van Essen <hendrik.ve@fu-berlin.de>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-31 23:15:41 +00:00
Hendrik van Essen
dcc8edd1e5 tests/driver_mfrc522: add test for mfrc522 driver 2023-01-31 21:05:07 +01:00
Hendrik van Essen
cdefa6934c drivers/mfrc522: add new driver 2023-01-31 21:05:07 +01:00
Gunar Schorcht
51fd28f0dd dist/tools/doccheck: add I2C config to generic_exclude_pattern 2023-01-31 20:12:04 +01:00
Gunar Schorcht
fde5c8a3ea board/sipeed-longan-nano: add periph_i2c support 2023-01-31 20:12:04 +01:00
Gunar Schorcht
ea848929e7 board/seeedstudio-gd32v: add periph_i2c support 2023-01-31 20:12:04 +01:00
Gunar Schorcht
5355a2435c cpu/dg32v: add periph_i2c support 2023-01-31 20:12:04 +01:00
bors[bot]
207dd5d3dc
Merge #19215
19215: tests/periph_flashpage_unittest: enable periph_flashpage r=benpicco a=gschorcht

### Contribution description

This PR enables the `periph_flashpage` module for  the unittest in `tests/periph_flashpage_unittest` so that it requires feature `periph_flashpage` and expects only correct calculation of flashpage indices if it is used.

Testing the correct calculation of flashpage indices without assuming the `periph_flashpage` feature and enabling the `periph_flashpage` module makes no sense. On ESP32x SoCs for example, the space in the flash is only reserved and `FLASHPAGE_NUMOF` is greater than 0 if `periph_flashpage` is used.

The PR fixes the unittest problem for ESP32x SoCs.

### Testing procedure

Green CI with label `CI: run test`.

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-31 17:49:08 +00:00
bors[bot]
a27231fc9e
Merge #19226 #19227
19226: test_utils/print_stack_usage: use thread.h API r=kaspar030 a=kaspar030



19227: release-notes.txt: add 2023.01 release notes r=kaspar030 a=kaspar030



Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2023-01-31 15:32:06 +00:00
83fad613c5 release-notes.txt: add 2023.01 release notes 2023-01-31 16:15:41 +01:00
2a960f95ba test_utils/print_stack_usage: use thread.h API 2023-01-31 15:48:32 +01:00
krzysztof-cabaj
dba9c2729f doc/porting-boards.md: fix code snippets in Riot web page/doxygen 2023-01-30 15:05:12 -05:00
bors[bot]
fcf63cf5e3
Merge #19217
19217: drivers/at86rf2xx: set netdev channel on init r=kaspar030 a=jia200x



Co-authored-by: Jose Alamos <jose@alamos.cc>
2023-01-30 17:57:55 +00:00
Jose Alamos
6ef2b17e54
drivers/at86rf2xx: set netdev channel on init 2023-01-30 18:37:58 +01:00
Gunar Schorcht
04df8cd387 tests/periph_flashpage_unittest: enable periph_flashpage
Testing the correct calculation of flash page indices without assuming the `periph_flashpage` feature and enabling the `periph_flashpage` module makes no sense. On ESP32x SoCs for example, the space in the flash is only reserved and `FLASHPAGE_NUMOF` is greater than 0 if `periph_flashpage` is used.
2023-01-30 09:26:16 +01:00
bors[bot]
49d549cce5
Merge #19211
19211: cpu/gd32v: move board dependent RTT configs to board config r=maribu a=gschorcht

### Contribution description

This PR fixes the problem that the RTT frequency is defined to be 40.0 kHz instead of 32.768 kHz if `TEST_KCONFIG=1` is not defined.

The problem was caused by the order in which the headers were included. In `cpu/gd32v/include/periph_cpu.h` the RTT frequency was defined to be 32.768 kHz or 40.0 kHz, depending on the `CONFIG_BOARD_HAS_LXTAL` configuration of the board. If `TEST_KCONFIG=1` is used, it is defined in `autoconfig.h` and is always known, but without `TEST_KCONFIG=1` it is defined in the `periph_conf.h` of the board. If `periph_cpu.h` is included but not `periph_conf.h`, `CONFIG_BOARD_HAS_LXTAL` is not defined without `TEST_KCONFIG=1` and the RTT frequency is defined to be 40.0 kHz.

The solution is to move board dependent RTT configurations to `periph_common.conf`.

### Testing procedure

```
BOARD=sipeed-longan-nano make -C tests/periph_rtt flash
```
should still work.

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-29 18:01:46 +00:00
Gunar Schorcht
993a65ef7d dist/tools/doccheck: add RTT config to generic_exclude_pattern 2023-01-29 18:51:59 +01:00
Gunar Schorcht
e387019076 cpu/gd32v: move board dependent RTT configs to board config 2023-01-29 18:51:59 +01:00
bors[bot]
d187b2fc98
Merge #19206
19206: doc/porting-boards.md: fix code snippets in md view r=benpicco a=krzysztof-cabaj

### Contribution description

Current version of the file [`porting-boards.md`](https://github.com/RIOT-OS/RIOT/blob/master/doc/doxygen/src/porting-boards.md) did not present correctly in the github preview two snippets, presented in the sections: `doc.txt` and `Using Common code`. 

This PR fix this issue.

### Testing procedure

Check if these changes do not corrupt generated doxygen.

### Issues/PRs references

None

Co-authored-by: krzysztof-cabaj <kcabaj@gmail.com>
2023-01-29 02:42:10 +00:00
bors[bot]
4c1e5c7b2b
Merge #19209
19209: cpu/gd32v: add periph_pwm support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_pwm` support for GD32VF103.

It includes a bug fix (2c6e527339) of `periph_timer` which clears pending interrupts on setting the timer before the interrupt is enabled. This avoids that a pending interrupt is triggered immediately when the timer is set. The bug caused `tests/periph_timer` and `tests/periph_timer_periodic` to crash. (I could split-off this bug fix if necessary).

Furthermore, the default timer configuration has been extended and reordered. `TIMER0` can be used now as timer device (0dfbdebaf7). The default timer configuration has been changed (377b5b321c) so that `TIMER0` and `TIMER1` are always timer devices. `TIMER2` can only be used as timer device if it is not used for PWM devices. `TIMER3` and `TIMER4` are only available as timer devices if they are supported by the CPU model and not used for PWM devices.

### Testing procedure

- `tests/periph_timer` and `tests/periph_timer_periodic` should work now. Without the PR, these tests lead to kernel panic.
- `tests/periph_pwm` should work on any GD32VF103 board. Command `osci` should also let LED1 and LED2 oscillate.

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-29 00:41:43 +00:00
Gunar Schorcht
608a41213d dist/tools/doccheck: add PWM config to generic exclude pattern 2023-01-28 18:16:17 +01:00
Gunar Schorcht
8ecc80a3ac boards/seeedstudio-gd32: add periph_pwm support 2023-01-28 18:16:17 +01:00
Gunar Schorcht
3bf303f9c6 board/sipeed-longan-nano: add periph_pwm support 2023-01-28 18:16:17 +01:00
Gunar Schorcht
e9be9b4e75 cpu/gd32v: add periph_pwm support 2023-01-28 18:16:17 +01:00
Gunar Schorcht
377b5b321c boards/common/gd32v: change default timer configuration
The default timer configuration has been changed so that `TIMER0` and `TIMER1` are always timer devices. `TIMER2` can only be used as timer device if it is not used for PWM devices. `TIMER3` and `TIMER4` are only available as timer devices if they are supported by the CPU model and not used for PWM devices.
2023-01-28 18:16:17 +01:00
Gunar Schorcht
0dfbdebaf7 cpu/gd32v: allow using TIMER0 as timer device 2023-01-28 17:46:45 +01:00
Gunar Schorcht
596d762806 cpu/gd32v: move TIMER_CHANNEL macros to header file 2023-01-28 17:39:06 +01:00
Gunar Schorcht
2c6e527339 cpu/gd32v: fix interrupt handling in periph_timer
When a timer is set, any pending interrupts must be cleared before the interrupt is enabled for the channel. Otherwise the interrupt would be triggered immediately when the timer is set.
2023-01-28 17:37:15 +01:00
bors[bot]
c6c84cccc9
Merge #19199 #19205 #19207
19199: sys/suit: Ensure previous thread is stopped before reusing its stack r=benpicco a=chrysn

### Contribution description

Closes: https://github.com/RIOT-OS/RIOT/issues/19195

If the thread has released the mutex but the thread has not terminated (which happens in the situation that would previously have overwritten a still active thread's state), then a warning is shown and the trigger is ignored.

### Testing procedure

This should work before and after:

* `make -C examples/suit_update BOARD=native all term`
* `aiocoap-client coap://'[fe80::3c63:beff:fe85:ca96%tapbr0]'/suit/trigger -m POST --payload 'coap://[2001:db8::]/foo'`
* In parallel, on the RIOT shell, run `suit fetch coap://[2001:db8::]/foo`
* After the first download fails, the second one starts right away ("suit_worker: update failed, hdr invalid" / "suit_worker: started").

Run again with the worker thread on low priority:

```patch
diff --git a/sys/suit/transport/worker.c b/sys/suit/transport/worker.c
index a54022fb28..e26701a64c 100644
--- a/sys/suit/transport/worker.c
+++ b/sys/suit/transport/worker.c
`@@` -70 +70 `@@`
-#define SUIT_COAP_WORKER_PRIO THREAD_PRIORITY_MAIN - 1
+#define SUIT_COAP_WORKER_PRIO THREAD_PRIORITY_MAIN + 1
```

Before, this runs the download once silently (no clue why it doesn't run it twice, but then again, I claim there's concurrent memory access from two thread, so who knows what happens). After, it runs a single download and shows an error message for the second one once the first is complete ("Ignoring SUIT trigger: worker is still busy.").

### Issues/PRs references

This may be made incrementally easier by https://github.com/RIOT-OS/RIOT/pull/19197 -- that PR as it is now would spare us the zombification (because returning would do that), and having a `wait` function would allow us to turn the new error case into a success.

19205: boards/common: add common timer config for GD32VF103 boards r=benpicco a=benpicco



19207: examples/gnrc_border_router: static: use router from advertisements by default r=benpicco a=benpicco




Co-authored-by: chrysn <chrysn@fsfe.org>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-01-27 21:01:39 +00:00
Benjamin Valentin
162d06a9bd boards/common: add common timer config for GD32VF103 boards 2023-01-27 21:39:22 +01:00
Benjamin Valentin
ff52d35584 gnrc_ipv6_nib: use static DNS server from auto_init_sock_dns if present 2023-01-27 19:15:13 +01:00
bors[bot]
31fe47c82c
Merge #19202
19202: cpu/gd32v: add periph_rtt support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_rtt` support and is one of a bunch of PRs that complete the peripheral drivers for GD32VF103.

### Testing procedure

`tests/periph_rtt` should work and give the following results:
```
Help: Press s to start test, r to print it is ready
START
main(): This is RIOT! (Version: 2023.04-devel-199-g2d429-cpu/gd32v/periph_rtt)

RIOT RTT low-level driver test
RTT configuration:
RTT_MAX_VALUE: 0xffffffff
RTT_FREQUENCY: 32768

Testing the tick conversion
Trying to convert 1 to seconds and back
Trying to convert 256 to seconds and back
Trying to convert 65536 to seconds and back
Trying to convert 16777216 to seconds and back
Trying to convert 2147483648 to seconds and back
All ok

Initializing the RTT driver
This test will now display 'Hello' every 5 seconds

RTT now: 148
Setting initial alarm to now + 5 s (163988)
rtt_get_alarm() PASSED
Done setting up the RTT, wait for many Hellos
{ "threads": [{ "name": "idle", "stack_size": 256, "stack_used": 216 }]}
{ "threads": [{ "name": "main", "stack_size": 1280, "stack_used": 480 }]}
Hello
Hello
Hello
Hello
```

### Issues/PRs references


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-27 17:19:20 +00:00
Benjamin Valentin
acf2074369 examples/gnrc_border_router: static: use router from advertisements by default 2023-01-27 18:01:00 +01:00
bors[bot]
a175ad22b6
Merge #19204
19204: boards/sipeed-longan-nano: default to flashing via DFU r=gschorcht a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-01-27 15:47:49 +00:00
bors[bot]
69c0640211
Merge #19194
19194: drivers/sx126x: make MODULE_SX126X_RF_SWITCH hidden in kconfig r=aabadie a=MrKevinWeiss





Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
2023-01-27 14:08:16 +00:00
Benjamin Valentin
15dfaddeb5 boards/sipeed-longan-nano: default to flashing via DFU 2023-01-27 12:11:00 +01:00
Gunar Schorcht
4383e0ac6f cpu/gd32v: fix periph_flashpage doc group 2023-01-27 06:46:51 +01:00
Gunar Schorcht
72b214a9dc boards/sipeed-longan-nano: add periph_rtt support 2023-01-27 06:46:51 +01:00
Gunar Schorcht
a72d87e16f boards/seeedstudio-gd32: add periph_rtt support 2023-01-27 06:46:51 +01:00
Gunar Schorcht
0b6fc8833b cpu/gd32v: add periph_rtt support 2023-01-27 06:46:51 +01:00
bors[bot]
2492e21766
Merge #19203
19203: make: pass make jobserver to cargo r=kaspar030 a=kaspar030



Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2023-01-26 20:52:05 +00:00