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

42581 Commits

Author SHA1 Message Date
Benjamin Valentin
46764727ab sys/net/sock_util: add sock_dtls_establish_session() 2023-02-08 15:57:22 +01: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
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
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
6fb226d5a2 make: pass make jobserver to cargo 2023-01-26 21:43:39 +01:00
krzysztof-cabaj
9f0cf1c384 doc/porting-boards.md: fix code snippets in md view 2023-01-26 15:02:37 -05:00
bors[bot]
7b75351bdd
Merge #19200
19200: blobs: include documentation in doxygen r=kaspar030 a=bergzand

### Contribution description

This PR changes the blob makefile documentation to be included in the doxygen output. I ~~didn't~~ slightly change the documentation itself to satisfy doxygen, just added another # and the doxygen boiler plating .
 

### Testing procedure

Take a look at the docs


### Issues/PRs references

None


Co-authored-by: Koen Zandberg <koen@bergzand.net>
2023-01-26 08:36:33 +00:00
96e37a4f41
blobs: include documentation in doxygen 2023-01-26 09:27:47 +01:00
chrysn
2c716d3ede sys/suit: Ensure previous thread is stopped before reusing its stack
Closes: https://github.com/RIOT-OS/RIOT/issues/19195
2023-01-25 18:04:28 +01:00
MrKevinWeiss
56947834f9
boards/sx126x: make MODULE_SX126X_RF_SWITCH hidden in kconfig
It turns out this is really a board specific setting and should always and only be used when the onboard module is being used...
2023-01-25 08:47:26 +01:00
bors[bot]
719787bd7f
Merge #19192
19192: cpu/esp32: fixes for boot issues and crashes on ESP32 r=kaspar030 a=Flole998

### Contribution description

In syscalls_init() there is a call to malloc(), which will return NULL if the heap is not initialized before, causing the entire board to fail booting if MODULE_ESP_IDF_HEAP is used.

API of [vTaskDelete()](https://www.freertos.org/a00126.html) says, that if NULL is passed to vTaskDelete the calling task should be deleted.

This PR needs a backport to 2023.01.

### Testing procedure

Just compiling on the ESP32S2 and running it with WiFi caused it to not start anymore, no output, nothing. When Null is written to that null-pointer it hangs.

The second commit fixed an issue/assertion fail that happens when the WiFi connection drops/disconnects.

### Issues/PRs references

Issue was introduced with PR #19146 

Co-authored-by: Flole998 <Flole998@users.noreply.github.com>
2023-01-24 20:36:34 +00:00
Flole998
56d2997d95 cpu/esp_common/freertos: Handle NULL being passed to vTaskDelete 2023-01-24 17:48:13 +00:00
Flole998
1a4af03a94 cpu/esp32: Make sure heap is initialized early enough
In syscalls_init() there is a call to malloc(), which will return NULL if the heap is not initialized before, causing the entire board to fail booting if MODULE_ESP_IDF_HEAP is used.
2023-01-24 16:46:22 +00:00
bors[bot]
f85366ae60
Merge #19185 #19187
19185: cpu/gd32v: add periph_gpio_irq support r=gschorcht a=gschorcht

### Contribution description

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

### Testing procedure

Use a GD32VF103 board and flash `tests/periph_gpio`. Note: The Sipeed Longan Nano works also with `seeedstudio-gd32` board defintion and could be used for testing.
```
BOARD=seeedstudio-gd32 make -C tests/periph_gpio flash  (until PR #19170 is merged only `seeedstudio
```
With the GPIO PB8 and PB9 connected, the following test sequence should work:
```
> init_out 1 8
> init_int 1 9 2 0
GPIO_PIN(1, 9) successfully initialized as ext int
> set 1 8
INT: external interrupt from pin 9
> clear 1 8
INT: external interrupt from pin 9
```


### Issues/PRs references


19187: cpu/gd32v: add pm_layered support in periph_pm r=gschorcht a=gschorcht

### Contribution description

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

Since the configuration of the deep sleep and the standby mode require the access CSR (control and status registers) of the MCU, the Nuclei-SDK NMSIS is added as package which provides a low-level interface for Nuclei-based RISC-V MCUs.

### Testing procedure

The best way to test it is to rebase this PR onto PR #19186 and to flash `tests/periph_pm` to any GD32VF103 board. Note: The Sipeed Longan Nano works also with `seeedstudio-gd32` board definition and could be used for testing.
```
BOARD=seeedstudio-gd32 make -C tests/periph_pm flash
```
The test output should be:
```
main(): This is RIOT! (Version: 2023.04-devel-174-g7dc91-cpu/gd32v/periph_pm_test)
...
mode 0 blockers: 1 
mode 1 blockers: 2 
mode 2 blockers: 0 
Lowest allowed mode: 2
```
Using command the `set_rtc 1 5` command should let the MCU deep sleep for 5 seconds
```
> set_rtc 1 5
Setting power mode 1 for 5 seconds.
␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀␀> 
```
while command `set_rtc 1 5` should set the MCU into the standby mode which is left with restart.
```
> set_rtc 0 5
Setting power mode 0 for 5 seconds.
main(): This is RIOT! (Version: 2023.04-devel-174-g7dc91-cpu/gd32v/periph_pm_test)
...
mode 0 blockers: 1 
mode 1 blockers: 2 
mode 2 blockers: 0 
Lowest allowed mode: 2
> 
```
The garbage on UART interface after deep sleep is caused by the clock synchronisation that becomes necessary after deep sleep and is the same as for other boards.

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-24 14:38:28 +00:00
bors[bot]
d1072c287d
Merge #19170 #19190 #19191
19170: boards/sipeed-longan-nano: add definition for the Sipeed Longan Nano GD32VF103 board r=benpicco a=gschorcht

### Contribution description

This PR add the support for the [Sipeed Longan Nano](https://longan.sipeed.com/en) board, a GD32VF103 development board with the GigaDevice GD32VF103CBT8 RISC-V MCU. This includes moving the common board definitions for GDV32F103 boards from `boards/seeedstudio-gd32` to `boards/common/gd32v`.

**[Update]** At first glance, the existing peripheral definition for `seeedstudio-gd32` seems to fit exactly for `sipeed-longan-nano`. But at second glance it becomes clear that `seeedstudio-gd32` which is using the GD32VF103VBT6 instead of the GD32VF103CBT6 has more peripherals and much more peripheral pins are broken out. This allows a more extensive and flexible peripheral definition (more timers, more ADC pins, more UART interfaces, ...). So it doesn't seem to be a good idea to share the peripheral definitions between these boards.

This PR depends on PR #19166 and includes this PR for the moment.

### Testing procedure

t.b.d.

### Issues/PRs references

Depends on PR #19166

19190: pkg/wolfssl: Fix memory leaks in wolfSSL sock_tls r=benpicco a=Flole998

When sk->ssl is NULL it doesn't need to be free()d, otherwise it may be free()d

19191: Fix SX126X-STM32WL module in Kconfig r=MrKevinWeiss a=MrKevinWeiss

### Contribution description

Master is broken due to kconfig mismatch for the `nucleo-wl55jc`.  The radio was just not declared.

This fixes the board and cleans up some of the SX126X kconfig.


### Testing procedure

Murdock should pass

### Issues/PRs references



Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Flole998 <Flole998@users.noreply.github.com>
Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
2023-01-24 12:08:46 +00:00
MrKevinWeiss
75ece64581
boards/nucleo-wl55jc: Expose sx126x in kconfig 2023-01-24 11:12:38 +01:00
MrKevinWeiss
bb0efa89d1
drivers/sx126x: Fix kconfig modeling 2023-01-24 11:12:33 +01:00
Flole998
2b1506d6d4 pkg/wolfssl: Fix memory leaks in wolfSSL sock_tls 2023-01-24 01:55:06 +00:00
Gunar Schorcht
cfbda4022a cpu/gdv32: add pm_layered support 2023-01-24 00:52:02 +01:00
Gunar Schorcht
b02ffb21b8 cpu/gd32v: use NMSIS SDK package 2023-01-24 00:52:02 +01:00
Gunar Schorcht
7c6a0de23b pkg/nmsis_sdk: add NMSIS SDK for Nuclei-based MCUs
The GD32V MCU is a Nuclei-based RISC-V MCU. The NMSIS SDK provides some basic functions for the access to control and status registers of such MCUs.
2023-01-24 00:52:02 +01:00
Gunar Schorcht
42ec4f04eb tests: add sipeed-longan-nano to Makefile.ci 2023-01-24 00:39:55 +01:00