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

10781 Commits

Author SHA1 Message Date
db19f6f546
sys/puf_sram: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:54 +02:00
50ed85a2fa
sys/entropy_source: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:53 +02:00
113200f9b2
sys/can: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:53 +02:00
9fb5708efe
sys/pm_layered: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:52 +02:00
643c239b27
sys/phydat: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:52 +02:00
1c57e7355d
sys/senml: cleanup dependency resolution 2023-06-15 10:24:52 +02:00
090ccc5d21
sys/saul_reg: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:51 +02:00
ab61a0f978
sys/sched_round_robin: move deps resolution in its own Makefile.dep 2023-06-15 10:24:51 +02:00
79207fa17b
sys/schedstatistics: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:50 +02:00
16b2606bac
sys/cpp11-compat: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:50 +02:00
cc27ff217b
sys/log_color: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:50 +02:00
2b658246b0
sys/luid: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:49 +02:00
fb167c7a9c
sys/sema*: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:49 +02:00
7ce942ab54
sys/isrpipe: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:48 +02:00
4e3290bece
sys/od: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:48 +02:00
1070a66ead
sys/trickle: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:48 +02:00
932ad3fc1f
sys/ssp: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:47 +02:00
85c640d415
sys/trace: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:47 +02:00
384469bc38
sys/eepreg: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:46 +02:00
f9bc119ac9
sys/coding: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:46 +02:00
a554738a0c
sys/arduino: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:45 +02:00
9d58ff8ca2
sys: cleanup shell dependency resolution 2023-06-15 10:24:45 +02:00
bors[bot]
5e7c6c2ff7
Merge #19697 #19725
19697: drivers/sx127x: reduce use of floats r=benpicco a=maribu

### Contribution description

Convert the floating point arithmetic to integer arithmetic.


19725: buildsystem: add target debug-client r=benpicco a=fabian18



Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
2023-06-13 19:08:40 +00:00
bors[bot]
c463bc9c11
Merge #18156
18156: pkg/opendsme: add initial support for IEEE 802.15.4 DSME time-slotted MAC r=jia200x a=jia200x



Co-authored-by: Jose Alamos <jose@alamos.cc>
2023-06-13 12:11:07 +00:00
Marian Buschsieweke
826095d56e
drivers/sx127x: reduce use of floats 2023-06-12 13:54:06 +02:00
bors[bot]
98370beb4f
Merge #19721
19721: nanocoap, gcoap: homogenize name of the module r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-06-08 19:03:32 +00:00
bors[bot]
2268caa811
Merge #19212 #19360 #19401 #19645 #19720
19212: shell/rtc: use rtc_tm_normalize() to sanitize input r=benpicco a=benpicco



19360: gcoap: make use coap_build_reply() in gcoap_resp_init() r=benpicco a=benpicco



19401: shell/cmds: add genfile command r=benpicco a=benpicco



19645: sys/isrpipe: Replace xtimer with ztimer_usec r=benpicco a=MrKevinWeiss



### Contribution description

Getting ready for the xtimer dep.


### Testing procedure

Green murdock, there is no explicit test for isrpipe but since it runs xtimer compat it should operate the same.

### Issues/PRs references



19720: tests: remove unnecessary use of floating point r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-06-08 16:02:09 +00:00
Benjamin Valentin
d4042eedde gcoap: homogenize name of the module 2023-06-08 16:33:05 +02:00
Benjamin Valentin
661829f43f nanocoap: homogenize name of the module 2023-06-08 16:29:12 +02:00
Benjamin Valentin
aba5e9bcde gcoap: make use coap_build_reply() in gcoap_resp_init() 2023-06-08 15:29:03 +02:00
Benjamin Valentin
94353145a2 shell/cmds: add genfile command 2023-06-08 13:11:43 +02:00
Benjamin Valentin
923c9a32ef nanocoap: clean up coap_iterate_option(), make it public 2023-06-07 16:07:17 +02:00
bors[bot]
24a26c91cf
Merge #19693
19693: sys/color: extend unittest and fix module r=maribu a=kfessel

### Contribution description

this extends the unittest for sys_color testing more colors 

### Testing procedure

```
RIOT_tree/tests/unittests$ make tests-color test
```
will fail since our `rgb2hsv` implementation is wrong (or is using an other colorspace than hsv2rgb (without documenting))

the new `hsv2rgb` test will succeed

### Issues/PRs references

#19614  was the reason i had a look at this 

#1315 added the rgb2hsv and hsv2rgb function

#9940 added the test for black special case

https://www.vagrearg.org/content/hsvrgb << some optimization for that function (avoiding float)


Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
2023-06-06 05:38:55 +00:00
Benjamin Valentin
34d002754b imath: add powi() function 2023-06-05 19:09:11 +02:00
Benjamin Valentin
eefa1b86b5 imath: add sqrti() function 2023-06-05 19:09:07 +02:00
Benjamin Valentin
c23cec9776 sys/imath: add integer math module 2023-06-05 18:42:24 +02:00
Benjamin Valentin
660c77e2c3 nanocoap: implement extended tokens (RFC 8974) 2023-06-05 18:35:29 +02:00
Karl Fessel
19a194c4a8 sys/color: fix rgb2hsv function 2023-06-05 13:00:23 +02:00
MrKevinWeiss
d283919f1c
sys/usb/Kconfig: Fix default PID 2023-06-02 12:47:01 +02:00
Jose Alamos
a6648a2c7f
sys/shell/commands/sc_opendsme: add gts commands 2023-05-31 16:31:27 +02:00
Jose Alamos
6f261ecfd3
sc_gnrc_netif: add opendsme shell commands 2023-05-31 16:31:25 +02:00
Jose Alamos
70838d379c
auto_init_nrf802154: add opendsme support 2023-05-31 16:31:25 +02:00
Jose Alamos
d7b51c687b
opendsme: add initial support 2023-05-31 16:31:24 +02:00
Jose Alamos
efc0d3d3d9
ieee802154: add DSME configs 2023-05-31 16:31:20 +02:00
MrKevinWeiss
7f8bce4a08
sys/sydio: Kconfig fallback to usb stdio 2023-05-31 12:55:53 +02:00
MrKevinWeiss
7f134c6c74
sys/usb: Add PID/VID check in macro 2023-05-31 12:55:53 +02:00
MrKevinWeiss
d419898d6a
sys/usb: Rework usb kconfig model 2023-05-31 12:55:52 +02:00
MrKevinWeiss
adff099d61
sys/Kconfig.stdio: Add FORCE_ and REQUIRES_ USB 2023-05-31 12:55:51 +02:00
MrKevinWeiss
e481571b4e
cpu/esp32: Move MODULE_STDIO_USB_SERIAL_JTAG to cpu 2023-05-31 12:55:51 +02:00
bors[bot]
d742513b62
Merge #19664
19664: usbus: don't trigger assertion in usbus_urb_submit() r=maribu a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-05-31 07:13:24 +00:00
bors[bot]
67c011f5a4
Merge #19686 #19687
19686: sys/string_utils: add memchk() r=maribu a=benpicco



19687: tests/unittests: remove old workaround for SAML1X and gcc9.X bug r=maribu a=dylad

### Contribution description
This reverts #13462, this workaround is no longer needed with newer GCC version.

### Testing procedure

Try to compile tests/unittests for `saml11-xpro` or `saml10-xpro`

### Issues/PRs references

This is a revert of #13462.


Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-05-30 23:26:16 +00:00
Benjamin Valentin
4476b2a024 sys/net/gnrc_pktbuf: make use of memchk() 2023-05-30 20:45:13 +02:00
Benjamin Valentin
c57b13f1e8 sys/string_utils: add memchk()
Check if all bytes in a buffer are set to s certain value - inverse
of memset().
2023-05-30 20:39:10 +02:00
Benjamin Valentin
23790a3f52 sys/string_utils: fix doxygen title 2023-05-30 20:11:17 +02:00
bors[bot]
00b5bc12a2
Merge #19610 #19670 #19678 #19679 #19680 #19681
19610: drivers/periph/rtc: improve doc on rtc_set_alarm r=maribu a=maribu

### Contribution description

- point out behavior on denormalized time stamps
- use errno codes to indicate errors (and adapt the few instances of actual error handling to use them)


19670: cpu/stm32: stm32f4 BRR from BSRR r=maribu a=kfessel

### Contribution description

sometimes one wants to save one instruction :) 
just write the bits we need to write.

### Testing procedure

tests/periph/gpio_ll tests this 

### Issues/PRs references

`@maribu` might know some reference

maybe #19407

19678: gnrc_sixlowpan_iphc: fix NULL pointer dereference r=maribu a=miri64



19679: gnrc_sixlowpan_frag_sfr: fix ARQ scheduler race-condition r=maribu a=miri64



19680: gnrc_sixlowpan_frag_rb: fix OOB write in _rbuf_add r=maribu a=miri64



19681: sys/xtimer: improve documentation r=maribu a=maribu

### Contribution description

- Add a warning that xtimer is deprecated, so that new code hopefully starts using ztimer
- Add a hint that `ztimer_xtimer_compat` can be used even after `xtimer` is gone


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
2023-05-30 17:11:06 +00:00
Marian Buschsieweke
9454a50df3
sys/xtimer: improve documentation
- Add a deprecation note to xtimer, so that new code hopefully
  starts using ztimer
- Add a hint that `ztimer_xtimer_compat` can be used even after `xtimer`
  is gone
2023-05-30 17:32:48 +02:00
Martine Lenders
1aeb90ee55
gnrc_sixlowpan_frag_rb: fix OOB write in _rbuf_add 2023-05-30 16:44:09 +02:00
Martine Lenders
31c6191f61
gnrc_sixlowpan_frag_sfr: fix ARQ scheduler race-condition 2023-05-30 16:42:35 +02:00
Martine Lenders
dc333463d8
gnrc_sixlowpan_frag_sfr: Mark feature as experimental 2023-05-30 14:51:07 +02:00
Martine Lenders
6ea04e19e7
gnrc_sixlowpan_frag_sfr: fix reference in documentation 2023-05-30 14:50:46 +02:00
Martine Lenders
c9d7863e56
gnrc_sixlowpan_iphc: fix NULL pointer dereference 2023-05-30 14:27:13 +02:00
bors[bot]
d58f2c8501
Merge #19268
19268: shell_lock: don't set CONFIG_SHELL_SHUTDOWN_ON_EXIT r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-05-27 22:23:54 +00:00
bors[bot]
1710650256
Merge #19601
19601: SUIT: Prepared manifests r=chrysn a=chrysn

### Contribution description

While SUIT can generally be used already with manifests that are "dropped into memory" (by any mechanism), the convenient SUIT worker thread mechanism so far could not be used with it.

This adds the suit_worker_try_prepare / suit_worker_trigger_prepared
pair for using the SUIT worker, and breaks suit_handle_manifest_buf out
of suit_handle_url (where the latter now calls the former).

#### By-catch

As part of factoring out reaping of the zombie worker thread, a locking
error that deadlocks the SUIT worker in case the race between the mutex
being unlocked and the thread being reaped hits the necessary handling
code is fixed (and mutex_unlock is called in the error path).

### Testing procedure

SUIT tests should pass.

https://github.com/RIOT-OS/RIOT/pull/19659 provides a demo of how the new API is used.

### Issues/PRs references

I think that the currently employed mechanism of having a resource to which a URL with the manifest gets posted is contrary to the design goals of SUIT -- the signed manifest should be what justifies the device to spend resources (eg. get data from a server), not a URI that is just *not* signed.

This PR makes it easier to implement a resource to which the manifest can be POSTed, rather than a CoAP URI that represents the manifest, as is proposed (but not mature) in 
https://github.com/RIOT-OS/RIOT/pull/19659.

[edit: Adjusted to reflect decisions made during review]

Co-authored-by: chrysn <chrysn@fsfe.org>
2023-05-27 19:14:05 +00:00
chrysn
8d6a375537 sys/suit: Fix missing include 2023-05-27 21:01:18 +02:00
chrysn
763474b485 sys/suit: Introduce functions to provide a manifest in memory
This adds the suit_worker_try_prepare / suit_worker_trigger_prepared
pair for using the SUIT worker, and breaks suit_handle_manifest_buf out
of suit_handle_url (where the latter now calls the former).

As part of factoring out reaping of the zombie worker thread, a locking
error that deadlocks the SUIT worker in case the race between the mutex
being unlocked and the thread being reaped hits the necessary handling
code is fixed (and mutex_unlock is called in the error path).
2023-05-27 21:01:18 +02:00
Benjamin Valentin
c0a4acf32d sys/shell_lock: lock shell on EOF 2023-05-26 15:04:36 +02:00
Benjamin Valentin
f58384832c shell_lock: don't set CONFIG_SHELL_SHUTDOWN_ON_EXIT 2023-05-26 15:04:35 +02:00
Benjamin Valentin
153dbd2495 usbus: don't trigger assertion in usbus_urb_submit() 2023-05-24 18:25:34 +02:00
bors[bot]
7d16a1b289
Merge #19636
19636: sys: model ecc, evtimer, pipe and shell_lock in kconfig r=aabadie a=aabadie



Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
2023-05-24 10:00:26 +00:00
e9f040cc8c
sys/net: add missing timex.h include 2023-05-24 09:53:36 +02:00
5851db7c03
sys/shell_lock: model in Kconfig 2023-05-24 09:53:35 +02:00
cc789235f5
sys/pipe: model in Kconfig 2023-05-24 09:53:35 +02:00
89911043d0
sys/evtimer: model in Kconfig 2023-05-24 09:53:34 +02:00
08fdb23185
sys/evtimer: remove support for xtimer backend 2023-05-24 09:53:33 +02:00
7eb50c5f05
sys/ecc: model in Kconfig 2023-05-24 09:53:33 +02:00
bors[bot]
e93d597510
Merge #19658
19658: sys/posix/sockets: fix code style & set sin6_scope_id in _ep_to_sockaddr()  r=benpicco a=maribu

### Contribution description

- Fix double indent of switch cases to single indent, as per coding convention. (Whitespace only change.)
- Set sin6_scope_id to netif in `_ep_to_sockaddr()`


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-05-24 02:20:38 +00:00
Marian Buschsieweke
77afc5e637
sys/posix/sockets: set sin6_scope_id in _ep_to_sockaddr()
Fixes https://github.com/RIOT-OS/RIOT/issues/19486
2023-05-23 22:04:12 +02:00
Marian Buschsieweke
afa3b134f4
sys/posix/sockets: fix code style
Fix double indent of switch cases to single indent, as per coding
convention.
2023-05-23 22:03:51 +02:00
bors[bot]
a272abb15d
Merge #19618 #19639 #19644 #19649 #19656
19618: cpu/stm32: fix riotboot settings for L4 and WB r=benpicco a=gschorcht

### Contribution description

This PR fixes the `riotboot` configuration for L4 and WB.

The family is not called `stm32l4` or `stm32wb` but `l4` and `wb`. That is, the `riotboot` configuration didn't work at all. Furthermore, a minimum `RIOTBOOT_LEN` of `0x2000` is required for L4.

Found when investigating the compilation errors for `bootloaders/riotboot_serial` in PR #19576.

### Testing procedure

1. Green CI.
2. Use the following commands:
    ```
    BOARD=nucleo-l496zg make -C tests/riotboot info-debug-variable-RIOTBOOT_HDR_LEN
    BOARD=p-nucleo-wb55 make -C tests/riotboot info-debug-variable-RIOTBOOT_HDR_LEN
    ```
    In master these commands give
    ```
    0x400
    ```
    With this PR these commands give
    ```
    0x200
    ```
    as expected.
3. Use the following commands:
    ```
    BOARD=nucleo-l496zg make -C tests/riotboot info-debug-variable-RIOTBOOT_LEN
    BOARD=p-nucleo-wb55 make -C tests/riotboot info-debug-variable-RIOTBOOT_LEN
    ```
    In master these commands give
    ```
    0x1000
    ```
    With this PR these commands give
    ```
    0x2000
    ```
    as expected.

### Issues/PRs references


19639: tests/net/gnrc_mac_timeout: add automated test r=aabadie a=aabadie



19644: gnrc_ipv6_nib: include RIO with all subnets in downstream RA r=benpicco a=benpicco



19649: gnrc_sixlowpan_iphc: prefix bits outside context must be zero r=benpicco a=benpicco



19656: gnrc/ipv6_auto_subnets: allow to configure minimal prefix length r=benpicco a=benpicco



Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-05-23 20:02:58 +00:00
bors[bot]
3469fce248
Merge #19335 #19581 #19612 #19643 #19655
19335: ipv6/nib: 6LBR should not send RS on their downstream interface r=fabian18 a=fabian18



19581: cpu/samd5x: enable FDPLL1 at 200MHz r=benpicco a=dylad

### Contribution description

This PR allows to use the second FDPLL (the first one is used to generated the 120MHz frequency used by the core and some peripherals). The second FDPLL is setup to run at 200MHz which is the maximum allowed by this MCU.
In fact, I reused the existing function which setup FDPLL0 so it can be used in a generic way for both PLL (since they are the same IP).

I change the way the computation offset (left shift by 5)  is done because 200MHz << 5 wouldn't fit inside an `uint32_t` and I wanted to avoid using an `uint64_t` here

Two additional commits are present for a small cleanup and a fix.

This is currently unused in our codebase, so it shouldn't impact this platform too much as the `ONDEMAND` bit is set. the FDPLL will not be running out of the box. But `@gschorcht` might need it pretty soon.

### Testing procedure

This PR can be tested on a `same54-xpro` and an oscilloscope using the following the patch:
```
From 76490845ec72387b24116bdd364a61365c186aa1 Mon Sep 17 00:00:00 2001
From: Dylan Laduranty <dylan.laduranty@mesotic.com>
Date: Thu, 11 May 2023 17:42:16 +0200
Subject: [PATCH] removeme! for debug purpose

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
---
 cpu/samd5x/cpu.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cpu/samd5x/cpu.c b/cpu/samd5x/cpu.c
index f778991a5b..2866c8c9e5 100644
--- a/cpu/samd5x/cpu.c
+++ b/cpu/samd5x/cpu.c
`@@` -220,7 +220,7 `@@` static void fdpll_init(uint8_t idx, uint32_t f_cpu)
 }
 
 static void gclk_connect(uint8_t id, uint8_t src, uint32_t flags) {
-    GCLK->GENCTRL[id].reg = GCLK_GENCTRL_SRC(src) | GCLK_GENCTRL_GENEN | flags | GCLK_GENCTRL_IDC;
+    GCLK->GENCTRL[id].reg = GCLK_GENCTRL_SRC(src) | GCLK_GENCTRL_GENEN | flags | GCLK_GENCTRL_OE | GCLK_GENCTRL_IDC;
     while (GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL(id)) {}
 }
 
`@@` -384,6 +384,12 `@@` void cpu_init(void)
     dma_init();
 #endif
 
+    sam0_gclk_enable(SAM0_GCLK_200MHZ);
+    /* output both FDPLL (GCLK0 and GCLK4) to gpios */
+    gpio_init_mux(GPIO_PIN(PB, 14), GPIO_MUX_M);
+    gpio_init_mux(GPIO_PIN(PB, 10), GPIO_MUX_M);
+    /* PB14 -> EXT2    PB10 -> QSPI SCK */
+
     /* initialize stdio prior to periph_init() to allow use of DEBUG() there */
     early_init();
 
-- 
2.35.3
```

It will output both FDPLLs to PB14 and PB10. Their frequency can then be measured using an oscilloscope.


### Issues/PRs references
None.

19612: pkg/ndn-riot: drop unmaintained pkg r=benpicco a=maribu

### Contribution description

Upstream [1] has seen no activity since 2018, so it safe to assume this is dead. It is reasonable to assume that any users - if there ever were any - have moved on.

Fixes https://github.com/RIOT-OS/RIOT/issues/15638

[1]: https://github.com/named-data-iot/ndn-riot


19643: examples/suit_update: some test fixes r=aabadie a=kaspar030



19655: net/ipv6: make use of clz in ipv6_addr_match_prefix() r=benpicco a=benpicco



Co-authored-by: Fabian Hüßler <fabian.huessler@st.ovgu.de>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-05-23 16:23:19 +00:00
Benjamin Valentin
2a7691176b gnrc/ipv6_auto_subnets: allow to configure minimal prefix length 2023-05-23 17:46:39 +02:00
Benjamin Valentin
9358a4430d gnrc/ipv6_auto_subnets: remove superfluous newline 2023-05-23 17:46:39 +02:00
Benjamin Valentin
771e9e9a14 gnrc/ipv6_auto_subnets: remove superfluous newline 2023-05-23 16:48:17 +02:00
Benjamin Valentin
41f9c2593d gnrc_ipv6_nib: include RIO with all subnets in downstream RA 2023-05-23 16:46:41 +02:00
Benjamin Valentin
d8438c47cf net/ipv6: make use of bitarithm_clzb() in ipv6_addr_match_prefix() 2023-05-23 16:15:25 +02:00
Fabian Hüßler
e0d64b1a38 ipv6/nib: 6LBR should not send RS on their downstream interface 2023-05-23 15:44:48 +02:00
Benjamin Valentin
7e9308dd8c gnrc_sixlowpan_iphc: prefix bits outside context must be zero 2023-05-23 14:16:47 +02:00
Benjamin Valentin
8966c14f60 gnrc_ipv6_nib: set default RIO preference to zero
Linux will ignore RIOs with preference NONE, so set the preference
to zero instead.
2023-05-23 13:02:36 +02:00
bors[bot]
dc0fe5283f
Merge #19611 #19640
19611: sys/net/rpl: fix possible NULL dereference r=benpicco a=maribu

### Contribution description

As the title says


19640: core/thread: drop unused thread_arch_t r=benpicco a=maribu

### Contribution description

No architecture makes use of thread_arch_t anymore, so let's drop it.


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-05-22 14:10:24 +00:00
MrKevinWeiss
17ca5db1f5
sys/isrpipe: Replace xtimer with ztimer_usec 2023-05-22 13:27:44 +02:00
bors[bot]
eb10a5ccd8
Merge #19604
19604: gnrc/ipv6/nib: fix 6Lo ND options on non 6Lo interface r=fabian18 a=fabian18



Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
2023-05-22 09:48:14 +00:00
Marian Buschsieweke
28c1630f54
sys/usb/usbus_msc: fix typo in C expression
Rather than setting the correct blk_len, the code only wrote 1 and 0
into the three bytes due to the use of a logic and where a bitwise
and should be used.
2023-05-20 22:18:27 +02:00
bors[bot]
975f150383
Merge #19621 #19622 #19623 #19626 #19627
19621: sys: add Kconfig support for clif r=MrKevinWeiss a=aabadie



19622: sys: add some missing kconfig + adapt related tests when possible r=aabadie a=aabadie



19623: pkg/libbase58: add kconfig support r=MrKevinWeiss a=aabadie



19626: sys/gnrc_lorawan: remove deprecated tx port option r=aabadie a=aabadie



19627: makefiles/pseudomodules: remove deprecated event_thread_lowest module r=aabadie a=aabadie



Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
2023-05-20 07:13:34 +00:00
bors[bot]
a46b49a24c
Merge #19605 #19624 #19625
19605: drivers/at86rf2xx: setting rx timestamp based on symbol counter for ATmega*RFR2 r=maribu a=chudov



19624: pkg/tensorflow-lite: remove deprecated package r=maribu a=aabadie

Use tflite-micro instead



19625: sys/hashes: remove deprecated aes cmac hashing r=maribu a=aabadie



Co-authored-by: chudov <chudov@gmail.com>
Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
2023-05-19 17:05:02 +00:00
558d7dd8f2
makefiles/pseudomodules: remove deprecated event_thread_lowest module 2023-05-19 16:15:10 +02:00
889d753ed6
sys/ 2023-05-19 16:07:01 +02:00
cfb5000d5c
sys/gnrc/lorawan: remove handling of deprecated tx port 2023-05-19 16:06:53 +02:00
0eb5bac330
sys/hashes: remove deprecated ase cmac hashing 2023-05-19 16:01:12 +02:00
chudov
c52f6e71c2 drivers/at86rf2xx: rx timestamp generation for ATmegaRFR2
Signed-off-by: chudov <chudov@gmail.com>
2023-05-19 15:33:15 +02:00
27cf550f74
sys/ut_process: add missing Kconfig 2023-05-19 15:09:56 +02:00
d39af66176
sys/uuid: add missing Kconfig 2023-05-19 15:09:55 +02:00
67391afe1a
sys/ssp: add missing Kconfig 2023-05-19 15:09:55 +02:00
4c9d6c0b49
sys/sema_inv: add missing Kconfig 2023-05-19 15:09:55 +02:00
5d351632d1
sys/coding: add missing Kconfig 2023-05-19 15:09:54 +02:00
f28d0f1b7b
sys: add Kconfig support for clif 2023-05-19 15:03:42 +02:00
Marian Buschsieweke
273f92a411
sys/net/rpl: fix possible NULL dereference
fixes https://github.com/RIOT-OS/RIOT/issues/15006
2023-05-18 01:25:13 +02:00
Fabian Hüßler
ea9995ecca gnrc/ipv6/nib: fix 6Lo ND options on non 6Lo interface
If a 6Lo router sends and RA over a non-6Lo interface it should not include the options which are specifically for 6Lo ND
2023-05-17 15:49:46 +02:00
Marian Buschsieweke
0747f5816c
sys/shell: Add coreclk command to shell_cmd_sys
The coreclk shell command now prints the CPU frequency in Hz, which
can be useful for boards with RC generated CPU frequency (e.g.
RP2040, FE310, or MPS430Fx1xx MCUs allow this) which may quite a bit
off the target frequency.
2023-05-16 10:58:06 +02:00
bors[bot]
bbe952cb8c
Merge #19553
19553: nanocoap_sock: remove nanocoap_get() r=maribu a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-05-15 20:47:28 +00:00
bors[bot]
951b83d08d
Merge #19594
19594: sys: drop broken and legacy Mac OS handling r=maribu a=maribu

### Contribution description

This drops special handling for Mac OS (X) `native`, which is not supported anymore anyway and causing issues when building for non-`native` targets on Mac OS.


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-05-15 17:28:08 +00:00
Marian Buschsieweke
8df1522a15
sys: drop broken and legacy Mac OS handling
This drops special handling for Mac OS (X) `native`, which is not
supported anymore anyway and causing issues when building for
non-`native` targets on Mac OS.
2023-05-15 15:35:50 +02:00
chudov
516df5cdb6 gnrc/gnrc_netif_hdr_print: printout timestamp if enabled
Signed-off-by: chudov <chudov@gmail.com>
2023-05-15 12:52:35 +02:00
c735b958cc
sys: fix remaining broken paths to tests 2023-05-13 19:08:39 +02:00
5f3a9de7fa
treewide: fix path to ztimer test applications 2023-05-13 19:08:38 +02:00
96271df7c6
sys/test_utils: fix path to rmutex test in doc 2023-05-13 18:27:58 +02:00
3989cd79ff
treewide: fix path to shell related tests in doc 2023-05-13 18:27:58 +02:00
Marian Buschsieweke
30ebacd784
sys/shell/cmd_gnrc_icmpv6_echo: fix format specifier
At a cast to `unsigned` so that the format specifier `%u` matches the
type. I think this won't have an impact on the generated machine code.
2023-05-10 13:00:41 +02:00
bors[bot]
cf7ef55b8d
Merge #19490
19490: sys/shell/gnrc_netif: don't always build lora options with ifconfig r=aabadie a=aabadie



Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
2023-05-09 12:46:59 +00:00
Benjamin Valentin
82929ccea3 nanocoap_sock: remove nanocoap_get()
The function has been deprecated in favor of nanocoap_sock_get()
2023-05-05 15:17:34 +02:00
bors[bot]
26c61beda7
Merge #19477
19477: sys /cpp11-compat: remove pseudo anonymous namespaces r=MrKevinWeiss a=kfessel

### Contribution description

remove pseudo anonymous namespaces in favor of defines that are used thoughout the rest of riot 

### Testing procedure

cpp test do not fail 

### Issues/PRs references



Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
2023-05-04 12:35:45 +00:00
bors[bot]
718a4513b5
Merge #19368 #19529 #19531
19368: debug: add DEBUG_BREAKPOINT() macro, set breakpoint on failed assertion r=benpicco a=benpicco



19529: cpu/stm32/periph/dac: optimize setting DAC r=benpicco a=Enoch247

### Contribution description

The current implmentation right shifted the 16 bit value passed into `dac_set()` down to the 12 bits that the DAC is actually capable of. This patch drops the shift and instead writes the 16 bit value to the DAC's left aligned 12 bit wide data holding register.


### Testing procedure

do something like:
``` c
#include "perip/dac.h"

int main(void)
{
    dac_set(DAC_LINE(0), 0xffff/2);
    return 0;
}
```
- observe DAC's output is half of vref


### Issues/PRs references

- none known


19531: tests/unittests: allow passing `UNIT_TESTS` via env r=benpicco a=kaspar030



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2023-05-02 18:08:42 +00:00
bors[bot]
c4b27d8241
Merge #19523 #19527 #19530 #19532 #19533 #19535
19523: boards/iotlab-m3: enable l3g4200d_ng r=benpicco a=benpicco



19527: drivers/sdcard_spi: small cleanup r=benpicco a=gschorcht

### Contribution description

This PR provides a small cleanup:
- the copy of `sdcard_spi_params_t` is removed (commit bfc2a51f70)
- the documentation was changed to fit the 100 characters per line. (commit 36f0162b34)

It is not necessary to hold a complete copy `sdcard_spi_params_t` in the device descriptor. Constant parameters can be used directly from ROM instead. This saves 24 bytes of RAM.

### Testing procedure

Use any board with SD Card SPI interface. The driver test should still work, for example:
```
BOARD=esp32-wrover-kit make -j8 -C tests/driver_sdcard_spi flash term
```
```
main(): This is RIOT! (Version: 2023.07-devel-176-g7213c-drivers/sdcard_spi_cleanup)
SD-card spi driver test application
insert SD-card and use 'init' command to set card to spi mode
WARNING: using 'write' or 'copy' commands WILL overwrite data on your sd-card and
almost for sure corrupt existing filesystems, partitions and contained data!
> init
Initializing SD-card at SPI_0...
[OK]
> 
```

### Issues/PRs references


19530: sys/xtimer: add missing "modules.h" include to `xtimer.h` r=benpicco a=kaspar030



19532: tests/unittests: tests-core-mbox: add missing `container.h` include r=benpicco a=kaspar030



19533: core: move macros/math.h to core/lib/include/macros r=benpicco a=kaspar030



19535: nanocoap_sock: defuse nanocoap_sock_get() API footgun r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2023-05-02 13:37:57 +00:00
Benjamin Valentin
f6f5b13744 nanocoap_sock: don't use return buffer for request 2023-05-02 15:02:56 +02:00
16117566cc sys/xtimer: add missing "modules.h" include to xtimer.h 2023-05-02 13:52:48 +02:00
Marian Buschsieweke
8fbbc40b3e
sys/ztimer: fix typo in debug output 2023-05-02 09:53:16 +02:00
Marian Buschsieweke
c3500eb6e0
tree wide: fix typos in comments found by codespell
This will not change generated binaries, only the Doxygen output and
source code will have less typos.
2023-05-02 09:52:06 +02:00
Benjamin Valentin
b88c9c5f1f debug: add DEBUG_BREAKPOINT() macro 2023-04-27 13:19:17 +02:00
bors[bot]
23f7087845
Merge #19315
19315: cpu/native: add host fs access via VFS r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-04-25 23:14:45 +00:00
Benjamin Valentin
f78911ebf7 gcoap_fileserver: set permissions on create 2023-04-26 00:53:14 +02:00
Benjamin Valentin
5708ca1945 vfs: add auto_unmount_vfs() 2023-04-26 00:53:14 +02:00
Benjamin Valentin
c438c80548 cpu/native: add host fs access via VFS 2023-04-26 00:53:14 +02:00
bors[bot]
46af92d3a0
Merge #18620 #19296 #19504 #19506
18620: core: add core_mutex_debug to aid debugging deadlocks r=maribu a=maribu

### Contribution description

Adding `USEMODULE += core_mutex_debug` to your `Makefile` results in
on log messages such as

    [mutex] waiting for thread 1 (pc = 0x800024d)

being added whenever `mutex_lock()` blocks. This makes tracing down
deadlocks easier.

### Testing procedure

Run e.g.

```sh
USEMODULE=core_mutex_debug BOARD=nucleo-f767zi make -C tests/mutex_cancel flash test
```

which should provide output such as

```
Welcome to pyterm!
Type '/exit' to exit.
READY
s
[mutex] waiting for thread 1 (pc = 0x8000f35)
START
main(): This is RIOT! (Version: 2022.10-devel-841-g5cc02-core/mutex/debug)
Test Application for mutex_cancel / mutex_lock_cancelable
=========================================================

Test without cancellation: OK
Test early cancellation: OK
Verify no side effects on subsequent calls: [mutex] waiting for thread 1 (pc = 0x800024d)
OK
Test late cancellation: [mutex] waiting for thread 1 (pc = 0x0)
OK
TEST PASSED
```

```sh
$ arm-none-eabi-addr2line -a 0x800024d -e tests/mutex_cancel/bin/nucleo-f767zi/tests_mutex_cancel.elf 
0x0800024d
/home/maribu/Repos/software/RIOT/tests/mutex_cancel/main.c:51
```

### Issues/PRs references

Depends on and includes https://github.com/RIOT-OS/RIOT/pull/18619

19296: nanocoap: allow to define CoAP resources as XFA r=maribu a=benpicco



19504: cpu/cc26xx_cc13xx: Fix bogus array-bound warning r=maribu a=maribu

### Contribution description

GCC 12 create a bogus array out of bounds warning as it assumes that because there is special handling for `uart == 0` and `uart == 1`, `uart` can indeed be `1`. There is an `assert(uart < UART_NUMOF)` above that would blow up prior to any out of bounds access.

In any case, optimizing out the special handling of `uart == 1` for when `UART_NUMOF == 1` likely improves the generated code and fixes the warning.

    /home/maribu/Repos/software/RIOT/cc2650/cpu/cc26xx_cc13xx/periph/uart.c:88:8: error: array subscript 1 is above array bounds of 'uart_isr_ctx_t[1]' [-Werror=array-bounds]
       88 |     ctx[uart].rx_cb = rx_cb;
          |     ~~~^~~~~~
    /home/maribu/Repos/software/RIOT/cc2650/cpu/cc26xx_cc13xx/periph/uart.c:52:23: note: while referencing 'ctx'
       52 | static uart_isr_ctx_t ctx[UART_NUMOF];
          |                       ^~~
    /home/maribu/Repos/software/RIOT/cc2650/cpu/cc26xx_cc13xx/periph/uart.c:89:8: error: array subscript 1 is above array bounds of 'uart_isr_ctx_t[1]' [-Werror=array-bounds]
       89 |     ctx[uart].arg = arg;
          |     ~~~^~~~~~
    /home/maribu/Repos/software/RIOT/cc2650/cpu/cc26xx_cc13xx/periph/uart.c:52:23: note: while referencing 'ctx'
       52 | static uart_isr_ctx_t ctx[UART_NUMOF];
          |                       ^~~

### Testing procedure

The actual change is a pretty obvious one-liner, so that code review and a green CI should be sufficient. If not, running any UART example app without regression should do.

### Issues/PRs references

None

19506: tools/openocd: Fix handling of OPENOCD_CMD_RESET_HALT r=maribu a=maribu

### Contribution description

The OPENOCD_CMD_RESET_HALT was not longer correctly passed to the script. This fixes the issue.

### Testing procedure

Flashing of e.g. the `cc2650-launchpad` with upstream OpenOCD should work again.

### Issues/PRs references

The change was added to https://github.com/RIOT-OS/RIOT/pull/19050 after testing the PR and before merging. I'm not sure if the fix never worked because of this, or if behavior of `target-export-variables` or GNU Make changed.

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-04-25 15:46:11 +00:00
chrysn
6724e851ca Rust: Update riot-wrappers
This fixes a regression by merging https://github.com/RIOT-OS/rust-riot-wrappers/pull/55
(the "G" unit has been deprecated, but that deprecation was done wrong
in https://github.com/RIOT-OS/rust-riot-wrappers/pull/50).
2023-04-25 09:20:58 +02:00
chrysn
5f91bd8812 Rust: Update non-RIOT dependencies 2023-04-24 11:38:59 +02:00
chrysn
de410314a3 Rust: Update riot-sys and riot-wrappers
This pulls in several fixes from these repositories:

* riot-sys:
    * Add `random` module to `riot-headers` (https://github.com/RIOT-OS/rust-riot-sys/pull/26)
    * README: fix 2 typos (https://github.com/RIOT-OS/rust-riot-sys/pull/31)
    * bindgen: Use 0.64 (https://github.com/RIOT-OS/rust-riot-sys/pull/30)
    * wolfSSL support added (https://github.com/RIOT-OS/rust-riot-sys/pull/28)
    * extern-types: Generate replacement types dynamically (https://github.com/RIOT-OS/rust-riot-sys/pull/27)
    * Extern types: Add netq_t, make them large (https://github.com/RIOT-OS/rust-riot-sys/pull/25)
    * doc: Suppress warnings about things C2Rust does not uphold (https://github.com/RIOT-OS/rust-riot-sys/pull/23)
    * export macro_DAC_LINE (https://github.com/RIOT-OS/rust-riot-sys/pull/22)
    * Add BINDGEN_OUTPUT_FILE export (https://github.com/RIOT-OS/rust-riot-sys/pull/21)
* riot-wrappers:
    * DAC: Add wrapper around RIOTs DAC-interface (https://github.com/RIOT-OS/rust-riot-wrappers/pull/36)
    * saul: Compatibly rename G* variants (https://github.com/RIOT-OS/rust-riot-wrappers/pull/50)
    * tests: Add test for auto-init when auto-init debug is active (https://github.com/RIOT-OS/rust-riot-wrappers/pull/48)
    * gcoap: Provide link encoder (https://github.com/RIOT-OS/rust-riot-wrappers/pull/47)
    * Drop SUIT support in riot-wrappers (https://github.com/RIOT-OS/rust-riot-wrappers/pull/44)
    * Add an auto init module (https://github.com/RIOT-OS/rust-riot-wrappers/pull/45)
    * gcoap: Allow registration without scope for 'static listeners (https://github.com/RIOT-OS/rust-riot-wrappers/pull/43)

Through direct dependency changes (the bindgen update), the number of
transitive dependencies could be reduced.
2023-04-24 11:29:52 +02:00
bors[bot]
0101663e39
Merge #19485
19485: sys/shell: Fix missing dependency r=aabadie a=maribu

### Contribution description

The shell commands depend on the shell module being use. This was already the case in KConfig, but was overlooked in the shell's `Makefile.dep`.

In addition, this uncovered that `tests/memarray` had a bogus dependency on shell commands without every using the shell.

### Testing procedure

Ideally binaries should not differ (except for debug section).

### Issues/PRs references

Split out of https://github.com/RIOT-OS/RIOT/pull/19483

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-04-22 06:21:38 +00:00
ba92b3f3af
sys/shell: fix Kconfig description of shell_cmd_gnrc_netif_lorawan 2023-04-22 08:17:45 +02:00
ea1c1c84ab
sys/shell: add shell_cmd_gnrc_netif_lora to Kconfig support 2023-04-22 08:17:45 +02:00
fc82153385
sys/shell/gnrc_netif: don't always build lora options
Just build them if the shell_cmd_gnrc_netif_lora module is pulled in
2023-04-22 08:17:44 +02:00
bors[bot]
ca4be42d88
Merge #19488
19488: usbus: remove deprecated USBUS_HANDLER_FLAG_TR_FAIL flag r=gschorcht a=dylad

### Contribution description

This PR removes the deprecated `USBUS_HANDLER_FLAG_TR_FAIL` flag.

### Testing procedure

CI should be enough.

### Issues/PRs references

Was deprecated by #17046

Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-04-21 10:17:28 +00:00
0c52207544
Merge pull request from GHSA-xqm8-xj74-fjw2
gnrc_sixlowpan_iphc: check IPHC dispatch for truncation
2023-04-21 11:56:49 +02:00
287f030af2
Merge pull request from GHSA-xfj4-9g7w-f4gh
fixes for CVE-2023-24826
2023-04-21 11:54:57 +02:00
Martine Lenders
709ddd2ba7 gnrc_sixlowpan_iphc: check IPHC dispatch for truncation 2023-04-21 11:45:27 +02:00
Martine Lenders
4f1e2a3709 gnrc_rpl_srh: check header fields consistency before substraction 2023-04-21 11:40:47 +02:00
Martine Lenders
eb9e50aafe gnrc_sixlowpan_frag_sfr: move timer initialization to init function 2023-04-21 11:30:59 +02:00
Marian Buschsieweke
69b3e05f01
sys/shell: restructure deps
Move deps on sys/shell to sys/Makefile.dep and only keep deps of
sys/shell in sys/shell/Makefile.dep
2023-04-21 09:45:45 +02:00
Dylan Laduranty
b1ffce3ccd usbus: remove deprecated USBUS_HANDLER_FLAG_TR_FAIL flag
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-04-19 20:54:30 +02:00
Marian Buschsieweke
6448258aac
sys/shell: Add missing dependency
The shell_cmds module depends on the shell module. This was correctly
added to KConfig, but the Makefile dependencies missed this one. This
commit adds the missing dep.
2023-04-19 12:25:00 +02:00
Karl Fessel
da17ebbde7 sys /cpp11-compat: remove pseudo anonymous namespaces 2023-04-18 16:30:43 +02:00
Gunar Schorcht
3b2da3e9e0 sys: define CPU_RAM_SIZE as hex number
Some platforms such as RISC-V don't support numbers given with unit (32K)
2023-04-18 06:20:14 +02:00
Gunar Schorcht
2e32d4ee8b sys/riotboot: uses SLOT1_OFFSET in hex format
Using hex number for addresses and address offsets improves the readability.
2023-04-18 06:20:14 +02:00
Gunar Schorcht
06426c41b0 sys/riotboot: common default NUM_SLOT, SLOT_* config 2023-04-18 06:20:14 +02:00
Gunar Schorcht
f4f716a062 sys/riotboot: fix compilation error of riotboot_slot
`riotboot_slot` uses `ARRAY_SIZE` which is defined in `container.h` but not yet included on some plattforms.
2023-04-18 06:20:14 +02:00
bors[bot]
2b6dc6471e
Merge #19436
19436: cpp11-compat: thread::sleep_for in microseconds r=benpicco a=kfessel

### Contribution description

after reviewing #19369  i found that there is a conversion to nanoseconds just to convert it to microseconds some instrunctions later for ztimer64_usec to handle it this removes one of the conversions (convert once direct to microseconds)

### Testing procedure

run the cpp tests

### Issues/PRs references

#19369

Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
2023-04-17 18:20:28 +00:00
bors[bot]
a87634cf91
Merge #19475
19475: gnrc_netif/lorawan: fix setting nwkskey via NETOPT r=MrKevinWeiss a=jia200x



Co-authored-by: Jose Alamos <jose@alamos.cc>
2023-04-17 13:04:37 +00:00
Karl Fessel
90d2ae83fb cpp11-compat: thread::sleep_for in microseconds 2023-04-17 13:27:14 +02:00
Jose Alamos
3c1f5a0dbd
gnrc_netif/lorawan: fix setting nkskey via NETOPT 2023-04-17 12:40:42 +02:00
Gunar Schorcht
e46fa4a0b2 sys/usbus: use USBDEV_SET_ADDR_AFTER_STATUS
Use symbol `USBDEV_SET_ADDR_AFTER_STATUS` to determine whether the device address has to be set directly after SETUP stage or after the associated STATUS stage.
2023-04-16 17:14:08 +02:00
d733314ebe
sys/shell: fix missing generic lora settings in ifconfig 2023-04-13 10:55:23 +02:00
7b2db7bf2b
usbus: Implement GET STATUS and SET/CLEAR FEATURE requests
This extends support for the GET STATUS requests to support endpoints
and interfaces as recipient. It also adds the SET and CLEAR FEATURE
requests for the endpoints with support to set and clear the halt
condition on an endpoint.
2023-04-11 11:12:53 +02:00
13b4f8de2c
usbus: Implement endpoint halt condition.
Instead of directly stalling an endpoint, handlers should enable the
halt condition on an usbus endpoint to signal error condition.
This can then be cleared via a CLEAR FEATURE request from the host.
2023-04-11 11:12:49 +02:00
Gunar Schorcht
44e9db86c0 sys/usbus/msc: fix EP sizes and buffer alignment for HS in DMA-mode 2023-04-07 19:06:24 +02:00
Dylan Laduranty
608d49c51a usbus/msc: ready MSC bulk OUT endpoint in USB_MSC_SETUP_REQ_GML request
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-04-05 20:16:53 +02:00
Dylan Laduranty
9e88db7f50 usbus/msc: remove call to usbdev_control_slicer_ready()
This function should not be called by the driver as USBUS will handle it already. So remove this call to prevent duplication

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-04-05 20:14:59 +02:00
8044e578b5
cdc_ecm: Update max supported transfer size after reset 2023-03-31 16:43:44 +02:00
8b41443913
usbus: Add functions to query max packet sizes 2023-03-31 16:43:44 +02:00
86e2953470
usbopt: add USBOPT_ENUMERATED_SPEED 2023-03-31 16:43:44 +02:00
bors[bot]
7f95ee7558
Merge #19373
19373: examples/suit_update: improve default module selection r=bergzand a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-03-29 09:44:59 +00:00
MrKevinWeiss
4f6448ed05
sys/cpp11-compat: Use ztimer64_usec instead of xtimer 2023-03-24 12:36:45 +01:00
Benjamin Valentin
9495dc4e2e nanocoap_server: add nanocoap_server_auto_init 2023-03-22 14:43:19 +01:00
bors[bot]
189d1c598c
Merge #19400
19400: sys/bitfield: don't touch unrelated bits in bf_{set, clear}_all() r=kaspar030 a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-03-20 11:30:53 +00:00
bors[bot]
2fcedf923f
Merge #19402 #19404 #19405
19402: sys/net/gnrc/netif: fixing no global address wait r=benpicco a=jan-mo

### Contribution description

The function `gnrc_netif_ipv6_wait_global_address()` will always return true, even if no global address is attached to the interface.
Currently the function only waits for any message and does not check if it was from the bus or not. So in `msg.content.ptr` is no valid address and therefore it returns true.

I added just the check, if the message is from the bus of any interface and then checking the address. We could also first check if the address in `msg.content.ptr` is valid, but this will just hide the bug. Also the timeout was never checked. It was just assuming that no other message will be received during the wait.


### Testing procedure

Use two devices, one works as a border router and supports the global address, the other will wait for the global address. You can call the function `gnrc_netif_ipv6_wait_global_address()` on the waiting node and see whether it returns true and finds the global address in the given time-range.


19404: sys/trickle: cleanup deps r=benpicco a=MrKevinWeiss

### Contribution description

Cleans the dependencies of the `trickle` module. This removes the deprecated xtimer and models kconfig.

### Testing procedure

Green murdock

### Issues/PRs references


19405: cpu/efm32: pwm_init errors are zeros r=benpicco a=chrysn

### Contribution description

pwm_init is documented to return 0 on errors, and has an unsigned return value.

EFM32's initialization function returned negative values, which through implicit casting become 0xffffffff or 0xfffffffe, which are successful by the documentation.

This makes all the EFM32 error paths return 0 as they should.

Also, it fixes a variable name and the corresponding error message that used to talk of "initiation" (which would be the start of a process) rather than "initialization" (which is a process that is completed before something else can happen).

### Testing procedure

* on stk3700, tests/periph_pwm, run `init 0 0 10 1000` / `set 0 0 500`
* The init used to respond with "The pwm frequency is set to 4294967294", and the set does nothing.
* The init now responds with "Error: device is not <del>initiated</del><ins>initialized</ins>". The set still does nothing, but then one doesn't expect it to any more.

(But really, looking at the patch and the docs should suffice).

### Issues/PRs references

By-catch from testing the Rust wrappers provided by `@remmirad` at https://github.com/RIOT-OS/rust-riot-wrappers/pull/38

Co-authored-by: Jan Mohr <jan.mohr@ml-pa.com>
Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
Co-authored-by: chrysn <chrysn@fsfe.org>
2023-03-17 13:06:11 +00:00
Jan Mohr
72107a0873 sys/net/gnrc/netif: fixing no global address wait 2023-03-17 13:45:35 +01:00
MrKevinWeiss
c309f21e97
sys/trickle: Model kconfig 2023-03-17 12:09:01 +01:00
MrKevinWeiss
cbde66f610
sys/trickle: Remove xtimer and only use ztimer 2023-03-17 12:04:44 +01:00
Benjamin Valentin
2d704a2c59 sys/bitfield: don't set unrelated bits in bf_{set, clear}_all() 2023-03-17 00:08:10 +01:00
bors[bot]
1a787d4669
Merge #19392 #19398 #19399
19392: ztimer: Fix doc on ztimer_remove r=benpicco a=bergzand

### Contribution description

See the subject 


### Testing procedure

Read the modified docs


### Issues/PRs references

None

19398: gnrc_ipv6_static_addr: fix build with only static address r=benpicco a=benpicco



19399: drivers/usbdev_synopsys_dwc2: add ESP32x power management r=benpicco a=gschorcht

### Contribution description

This PR adds power management handling for ESP32x SoCs.

### Testing procedure

Use and ESP32-S2 or ESP32-S3 board and flash `tests/periph_pm` using the `stdio_cdc_acm`
```
USEMODULE=stdio_cdc_acm BOARD=esp32s3-devkit make -j8 -C tests/periph_pm flash
```
Connect the terminal to the board and execute command:
```
set_rtc 1 1
```
The console should continue to work after the 1-s light sleep.

### Issues/PRs references


Co-authored-by: Koen Zandberg <koen@bergzand.net>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-03-16 12:09:46 +00:00
Benjamin Valentin
a473ca9ed5 gnrc_static: auto-select interface if there is only one 2023-03-16 12:28:00 +01:00
Benjamin Valentin
3f2d36d14f gnrc_static: fix build if only static address is set 2023-03-16 11:19:53 +01:00
Martine Lenders
dd969745ab
ztimer/ztimer64: uncrustify code 2023-03-15 15:13:48 +01:00
bors[bot]
fd38db6b38
Merge #19371 #19382
19371: sys/usbus: check for the number of required and provided EPs in static configurations r=dylad a=gschorcht

### Contribution description

This PR provides a static check at compile time whether the number of EPs required in a static configuration does not exceed the number of EPs provided by the USB device.

#### Background

In issue #19359 the problem was reported that `usbus_cdc_ecm` didn't work together with `stdio_cdc_acm` on some STM32 boards. The reason for some of the boards was simply that the application tried to allocate more EPs than available and simply ignored this and just didn't work.

#### Solution

Since `auto_init_usb` uses a static configuration with exactly one USBUS stack instance and one USB device, at least in case `auto_init` is used a static check can be carried out to make sure that the number of EPs required by the application doesn't exceed the number of EPs provided by the USB device. For this purpose, each `usbus_*` module defines the number of IN and OUT EPs required by that module. Each USB device driver defines the number of EPs provided by USB device if it differs from the default of 8 EPs. During the auto initialization the total number of required IN and OUT EPs is then compared with the number of EPs provided by the USB device using a static assert.

### Testing procedure

1. Green CI
2. Compilation of
   ```python
   USEMODULE='stdio_cdc_acm' BOARD=nucleo-f439zi make -j8 -C tests/usbus_cdc_ecm
   ```
   should lead to compilation error
   ```python
   sys/auto_init/usb/auto_init_usb.c:81:1: error: static assertion failed: "Number of required IN endpoints exceeded"
    _Static_assert(USBUS_EP_IN_REQUIRED_NUMOF <= USBDEV_NUM_ENDPOINTS,
    ^~~~~~~~~~~~~~
   Makefile.base:146: recipe for target 'tests/usbus_cdc_ecm/bin/nucleo-f439zi/auto_init_usbus/auto_init_usb.o' failed
   ```
   while compilation of
   ```
   USEMODULE='stdio_cdc_acm' BOARD=nucleo-f767zi make -j8 -C tests/usbus_cdc_ecm
   ```
   should work.

### Issues/PRs references

Fixes issue #19359 partially.

19382: tests/pkg_nanors: use static allocation r=benpicco a=benpicco



Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-03-15 08:41:57 +00:00
fa0ab40920
ztimer: Fix doc on ztimer_remove 2023-03-14 18:16:47 +01:00
5205151876
cord: convert to ztimer 2023-03-14 18:15:21 +01:00
bors[bot]
5b61449d75
Merge #19386
19386: usbus/dfu: do not create alt interface if NUM_SLOTS=1 r=benpicco a=dylad

### Contribution description

In some cases, it is really useful to build `riotboot` with `NUM_SLOTS=1`.
When use in combination with `riotboot_dfu`, there is no need to export the second slot if `riotboot` is built with `NUM_SLOTS=1`.
Thus, prevent the alt interface declaration in dfu if `NUM_SLOTS=1` so that only slot0 can be used to flash.


### Testing procedure
Add `NUM_SLOTS=1` to `bootloaders/riotboot_dfu/Makefile`
Flash the riotboot DFU bootloader to any board supported by USBUS:
`make BOARD=xxx -C bootloaders/riotboot_dfu flash`
and run
`dfu-util -l`

With NUM_SLOTS=2 you will get:
```
dfu-util -l  
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [1209:7d02] ver=0100, devnum=11, cfg=1, intf=0, path="1-4", alt=1, name="RIOT-OS Slot 1", serial="AB88DCAE80893484"
Found DFU: [1209:7d02] ver=0100, devnum=11, cfg=1, intf=0, path="1-4", alt=0, name="RIOT-OS Slot 0", serial="AB88DCAE80893484"
```

with NUM_SLOTS=1 you will get:
```
dfu-util -l 
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [1209:7d02] ver=0100, devnum=14, cfg=1, intf=0, path="1-4", alt=0, name="RIOT-OS Slot 0", serial="AB88DCAE80893484"
```





### Issues/PRs references



Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-14 01:50:31 +00:00
Dylan Laduranty
65475af1bb usbus/dfu: do not create alt interface if not needed
If riotboot is built with NUM_SLOTS=1, there is no reason to advertise a second slot in the bootloader

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-13 21:52:06 +01:00
bors[bot]
9142d9c375
Merge #19383 #19385
19383: cord: include gcoap_req_send returning 0 in error r=benpicco a=bergzand

### Contribution description

gcoap_req_send returns 0 if it was unable to send the CoAP request. CoRD did not include that case in the return code checks. This changes CoRD to include it and drop the registration if CoAP could not send the request. The old behaviour made the CoRD thread lock up.

### Testing procedure

- Check with the gcoap API docs.
- I can reliable trigger the issue with a RIOT application including both the `cord_ep_standalone` module and some measurement reported both sending requests to the same application. If at some point the application is shut down, gcoap has all its memo's occupied with the measurement reporting and can't add the CoRD update request. Thus the CoRD update request fails with a zero code and the thread (previously) would lock up.

### Issues/PRs references

None

19385: cpu/stm32/periph/timer: fix clobered IRQ flag r=benpicco a=Enoch247

### Contribution description

From the git commit:

> The STM32 periph_timer driver reads the timer's status flags, then clears them all. It is possible that a timer interrupt could occur between reading the flag and clearing it. This would lead to a lost interrupt.
> 
> The timer's status flags can be cleared by software, but can only be set by the hardware. This patch takes advantage of this by only clearing the flags it knows are set. The rest of the flags are set, which doesn't actually change their state.

I had trouble finding anything in ST's datasheet saying that software could not set the timer's status flags, but testing showed that this is how it works in practice. Further, [ST's own HAL ](https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h#L1258)confirms this. If the hardware didn't work this way, it would be impossible to atomically read-modify-write the flags.

### Testing procedure

I tested by doing the following:

1. `make -C tests/periph_timer BOARD=nucleo-f767zi all flash term`
2. press s
3. press [ENTER]
4. observe test passes
5. `make -C tests/periph_timer_periodic BOARD=nucleo-f767zi all flash term`
6. press s
7. press [ENTER]
8. observe test passes
9. `make -C tests/periph_timer_short_relative_set BOARD=nucleo-f767zi all flash term`
10. press s
11. press [ENTER]
12. observe test passes


### Issues/PRs references

- none known

Co-authored-by: Koen Zandberg <koen@bergzand.net>
Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
2023-03-13 20:25:27 +00:00
Gunar Schorcht
af0eaa99ce sys/auto_init/usb: add a check for the number EPs
Since `auto_init_usb` provides a static auto configuration for a single USBUS stack instance using a single USB device, a static assert can be used here to check whether the number of EPs required by the configuration does not exceed the number of EPs provided by the USB device.
2023-03-13 12:58:33 +01:00
19ff949404
cord: include gcoap_req_send returning 0 in error
gcoap_req_send returns 0 if it was unable to send the CoAP request. CoRD
did not include that case in the return code checks. This changes CoRD
to include it and drop the registration if CoAP could not send the
request. The old behaviour made the CoRD thread lock up.
2023-03-13 11:49:37 +01:00
Gunar Schorcht
6d273e7966 sys/usbus: define the number of required EPs for each class
To be able to check during compilation that the number of endpoints provided by a USB peripheral is not exceeded, each interface class has to define the number of IN and OUT endpoints it requires.
2023-03-12 13:15:44 +01:00
Gunar Schorcht
1fa988d135 sys/usbus: handle exceeding of number of endpoints
If the number of endpoints is not sufficient for an application, it should not be silently ignored and cause a non-working application. Rather, should cause an assertion as it is a configuration issue.
2023-03-10 07:59:14 +01:00
Benjamin Valentin
d16d8f362a sys/suit: drop superfluous ')' in output 2023-03-10 02:27:43 +01:00
bors[bot]
513676f6e0
Merge #17086
17086: usbdev: Add dedicated stall functions r=benpicco a=bergzand

### Contribution description

This PR adds dedicated stall functions for usbdev peripherals. Two
functions are added. The first function (usbdev_ep_stall) to enable and
disable the stall condition on generic endpoints. The second function is
a dedicated function to set the stall condition on endpoint zero in both
directions. This status can only be set and should automatically be
cleared by the usbdev implementation (or hardware) after a new setup
request is received from the host.

### Testing procedure

- examples/usbus_minimal should still enumerate correctly on the host side.
- #17085 can be used to demonstrate the ep0_stall function with the `tests/usbus_cdc_acm_stdio/` test

### Issues/PRs references

None

Co-authored-by: Koen Zandberg <koen@bergzand.net>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-03-10 00:12:40 +00:00
bors[bot]
bdecf57516
Merge #19356
19356: usbus/msc: add CONFIG_USBUS_MSC_AUTO_MTD option to create LUNs on init r=dylad a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-03-09 19:49:51 +00:00
Benjamin Valentin
73400cb248 tests/usbus_msc: don't use custom usbus 2023-03-09 16:57:17 +01:00
Benjamin Valentin
bbda85221e usbus/msc: add CONFIG_USBUS_MSC_AUTO_MTD option to create LUNs on init 2023-03-09 16:57:17 +01:00
Benjamin Valentin
cc30b819eb gcoap: include CoAP resrouces from NANOCOAP_RESOURCE() XFA 2023-03-09 14:09:15 +01:00
bors[bot]
1a5cc2acbb
Merge #19365 #19366 #19367
19365: bootloaders: fix bootloader button logic r=benpicco a=dylad

### Contribution description

In lastest master, the `BTN_BOOTLOADER_INVERTED` logic doesn't work as expected.
This PR fixes the underlying logic by replacing the `BTN_BOOTLOADER_INVERTED` macro definition by a runtime function.
In fact the current code:
```
#ifndef BTN_BOOTLOADER_INVERTED
#if (BTN0_MODE == GPIO_IN_PD)
#define BTN_BOOTLOADER_INVERTED false
#else
#define BTN_BOOTLOADER_INVERTED true
#endif
#endif
```
cannot work because both `BTN0_MODE` and `GPIO_IN_PD` are not known by the precompiler as they are enum values defined at cpu level.
Thus, replaces it by a runtime function in our bootloader applications.
I've also add `GPIO_OD_PU` along side `GPIO_IN_PU` and add a new define (which can be override at board level or app level) in case an external pullup is used.

### Testing procedure
Flash the riotboot_dfu bootloader:
`make BOARD=saml21-xpro -C bootloaders/riotboot_dfu flash`
Then, flash any test app:
`PROGRAMMER=dfu-util USEMODULE=usbus_dfu make BOARD=saml21-xpro -C tests/shell riotboot/flash-slot0`

With master, the application will not start.
With this PR, the application will start after flashing.

### Issues/PRs references
Fixes #19364 


19366: nanocoap_sock: don't include token in empty ACK response r=benpicco a=benpicco



19367: cord: bump reference from draft to rfc r=benpicco a=bergzand

### Contribution description

The draft is an RFC, this bumps the "see also" in the docs to the rfc.

### Testing procedure

Check that the correct RFC is linked in the docs.

### Issues/PRs references

None


Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
2023-03-08 12:23:24 +00:00
Dylan Laduranty
48b07eb991 bootloaders: fix bootloader button logic
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-08 13:07:42 +01:00
b3439fc800
cord: bump reference from draft to rfc 2023-03-08 11:50:55 +01:00
Benjamin Valentin
d6e05dae7f nanocoap_sock: don't include token in empty ACK response 2023-03-08 11:38:09 +01:00