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

4278 Commits

Author SHA1 Message Date
bors[bot]
735d371f7d
Merge #19800
19800: usbus: Implement USB_FEATURE_DEVICE_REMOTE_WAKEUP handling r=dylad a=zvecr



Co-authored-by: zvecr <git@zvecr.com>
2023-07-07 09:54:15 +00:00
zvecr
9139813d17 Implement USB_FEATURE_DEVICE_REMOTE_WAKEUP handling 2023-07-05 23:40:07 +01:00
Marian Buschsieweke
ff7f8ae2f0
cpu/msp430: reorganize code
RIOT supports two distinct families of the MSP430: The [MSP430 x1xx]
MCU family and the [MSP430 F2xx/G2xx] MCU family. For both incompatible
MCU families the code was located in the msp430fxyz folder, resulting
in case of the UART driver in particularly bizarre code looking roughly
like this:

    #ifndef UART_USE_USCI
    /* implementation of x1xx peripheral ... */
    #else
    /* implementation of F2xx/G2xx peripheral ... */
    #endif
    /* zero shared code between both variants */

This splits the peripheral drivers for USCI and USART serial IP blocks
into separate files and relocates everything in cpu/msp430, similar to
how cpu/stm32 is organized.

[MSP430 x1xx]: https://www.ti.com/lit/ug/slau049f/slau049f.pdf
[MSP430 F2xx/G2xx]: https://www.ti.com/lit/ug/slau144k/slau144k.pdf
2023-06-19 17:14:57 +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
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
923c9a32ef nanocoap: clean up coap_iterate_option(), make it public 2023-06-07 16:07:17 +02: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
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
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
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
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
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
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
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
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
08fdb23185
sys/evtimer: remove support for xtimer backend 2023-05-24 09:53:33 +02:00
Benjamin Valentin
41f9c2593d gnrc_ipv6_nib: include RIO with all subnets in downstream RA 2023-05-23 16:46:41 +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
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
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
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
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
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]
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
16117566cc sys/xtimer: add missing "modules.h" include to xtimer.h 2023-05-02 13:52:48 +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
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
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
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
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
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
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
Martine Lenders
dd969745ab
ztimer/ztimer64: uncrustify code 2023-03-15 15:13:48 +01:00
fa0ab40920
ztimer: Fix doc on ztimer_remove 2023-03-14 18:16:47 +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
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
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
bors[bot]
fae992e82b
Merge #19343 #19349 #19353 #19361 #19363
19343: ztimer: add ztimer_stopwatch convenience functions r=benpicco a=benpicco



19349: cpu/native: Switch to ztimer for gettimeofday r=benpicco a=MrKevinWeiss

### Contribution description

A xtimer is somewhat taken over by ztimer this explicitly uses ztimer instead of relying on the compatibility layer.

### Testing procedure

`make all test -C tests/cpp11_mutex/`

and green murdock I guess.

### Issues/PRs references


19353: doc: add quicklink to boards in navbar r=benpicco a=OlegHahm

### Contribution description

Finding a list of supported boards and how to use them is an essential information. Currently this list is somewhat hidden under "Modules" which is not very intuitive. Hence, I propose to (at least) put a link in the side menu to this overview page.

### Testing procedure

1. Call `make doc`
2. Check the sidebar `${RIOT_BASE}/doc/doxygen/html/index.html` for an entry "Supported Boards"

19361: nanocoap_sock: ensure response address is the same as request address r=benpicco a=benpicco



19363: Fix stm32 timer periodic r=benpicco a=Enoch247

### Contribution description

From the commit msg:

>     cpu/stm32/periph/timer: remove unneeded header
>     
>     I see no reason this header should be included. It does not exist in
>     RIOT's source tree. This patch removes the include.

and 

>     cpu/stm32/periph/timer: fix execution flow
>     
>     The implmentation of `timer_set_absolute()` has The following problems.
>     First, it attempts to restore the auto reload register (ARR) to it's
>     default if the ARR was previosly set by `timer_set_periodic()` by
>     comparing it to the channel's capture compare (CC) register _after_ it
>     has already set the CC register. Secondly, it clears spurious IRQs
>     _after_ the CC register has been set. If the value being set is equal to
>     the timer's current count (or the two become equal before the supurios
>     IRQ clearing happens), this could cause a legitimate IRQ to be cleared.
>     
>     The implmentation of `timer_set()` has the same error in handling the
>     ARR as described above.
>     
>     This patch reorders the operations of both functions to do:
>     
>     1. handle ARR
>     2. clear spurious IRQs
>     3. set channel's CC
>     4. enable IRQ
>     
>     Additionally, the calulation of `value` in `timer_set()` is moved
>     earlier in the function's exec path as a pedantic measure.


### 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: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
Co-authored-by: Oleg Hahm <oleg@hobbykeller.org>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
2023-03-08 02:09:42 +00:00
bors[bot]
6c1de71606
Merge #19358
19358: sys/usbus/cdc/ecm: fix High-Speed mode r=dylad a=gschorcht

### Contribution description

This PR provides some changes to fix the USBUS CDC ECM interface in High-Speed mode.

In High-Speed mode, the EP data size has to be at least 512 bytes instead of 64 Byte in Full-Speed mode. To be able to define configurations like EP data sizes depending on whether Full-Speed or High-Speed USB device peripherals are used, the feature `periph_usbdev_hs`/`HAD_PERIPH_USBDEV_HS` is introduced.

### Testing procedure

Use `tests/usbus_cdc_ecm`  and any board with USB HS connector, for example:
```
USEMODULE=periph_usbdev_hs_utmi BOARD=stm32f723e-disco make -j8 -C tests/usbus_cdc_ecm flash
```
`ping` command works with this PR but doesn't work without this PR.

### Issues/PRs references

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-03-07 20:17:01 +00:00
Benjamin Valentin
15fd7a9a1c net/sock/udp: add sock_udp_ep_is_multicast() 2023-03-07 16:58:17 +01:00
Gunar Schorcht
4f49fc817c usbus/cdc/ecm: increase EP data size in HS mode
CDC ECM driver/netdev is only working in High-Speed mode if the EP data size is at least 512 byte.
2023-03-07 11:29:39 +01:00
Benjamin Valentin
d91c0e8bd4 sys/benchmark: make use of ztimer stopwatch 2023-03-06 14:31:09 +01:00
Benjamin Valentin
fef20d4f04 ztimer: add ztimer_stopwatch convenience functions 2023-03-06 14:25:09 +01:00
bors[bot]
743ae3f095
Merge #19242
19242: usbus/msc: add initial Mass Storage Class support r=benpicco a=dylad

### Contribution description

This PR adds the initial support for Mass Storage Class in USBUS. This PR relies on the RIOT MTD implementation to implement the Mass Storage Class support. With the provided test application, a MTD device will be accessible as a normal storage device on your host computer.
Read and Write operations are allowed.
Multiple LUNs are supported so several MTD devices can be exported through USB.
The MSC relies on SCSI protocol to operate.

Currently there are some limitations:
    Supported host : Linux & Windows (macOS is untested)
    MSC cannot be used if MTD page size > 4096
    MTD device must have at least 512 bytes of memory to be exported.

Please be aware that performance are not so great.

### Testing procedure
Flash `tests/usbus_msc` application on a board with at least one MTD device.
Once the shell has started, prepare one or several MTD devices to be exported using `add_lun` command.
Once ready, start the USB connection with `usb_attach`

All MTD exported should appear as` /dev/sdX` on Linux.

### Issues/PRs references
Supersede #15941 


Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-02 22:19:41 +00:00
bors[bot]
b0626401d8
Merge #19331
19331: pkg/tinydtls: Adjust defaults r=miri64 a=chrysn

### Contribution description

This adjusts two defaults in tinydtls:

* Default verbosity is set to warning. At the info level, this module produces way more output (several lines per new connection, and even per message) than is common in RIOT.
* If gcoap is used, the buffer size is adjusted to the gcoap buffer size plus overhead. Otherwise, CoAP-over-DTLS works fine until one happens to request larger resources.

### Testing procedure

* Run examples/gcoap_dtls
* Send a CoAP request from outside, eg. with `aiocoap-client 'coaps://[fe80::3c63:beff:fe85:ca96%tapbr0]/.well-known/core' --credentials testserver.json` (where testserver.json is `{"coaps://[fe80::3c63:beff:fe85:ca96%tapbr0]/*": {"dtls": {"psk": {"ascii": "secretPSK"}, "client-identity": {"ascii": "Client_identity"}}}}`).

Before, there are messages shown for every request; now there are none.

Modify `examples/gcoap/server.c` as follows:

```patch
diff --git a/examples/gcoap/server.c b/examples/gcoap/server.c
index bf2315cd01..28e1faac27 100644
--- a/examples/gcoap/server.c
+++ b/examples/gcoap/server.c
`@@` -68,7 +68,7 `@@` static const coap_resource_t _resources[] = {
 };
 
 static const char *_link_params[] = {
-    ";ct=0;rt=\"count\";obs",
+    ";ct=0;rt=\"count\";obs;looooooooooooooooooooooong-attribute=\"loooooooooooooooooooooooooooooong\"",
     NULL
 };
```

The request passes; without this patch, it is stuck in retransmissions until "Network error: Retransmissions exceeded".

### Issues/PRs references

This contributes to making #19289 usable with a minimum level of security. (That module fills up the gcoap buffer to the brim). While the module handles the verbosity as well as it can (occasionally admitting that it lost bytes of output), the previous verbosity produces an infinite stream of stdout data. (But the default should be quiet immaterial of that particular PR).

Co-authored-by: chrysn <chrysn@fsfe.org>
2023-03-02 15:40:31 +00:00
chrysn
f2d5928ee5 dtls, tinydtls: Raise default number of connections 2023-03-02 09:16:22 +01:00
Dylan Laduranty
d49ed218ab usbus/msc: add initial support for Mass Storage Class
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-01 21:50:13 +01:00
Martine Lenders
13f613429d gnrc_sixlowpan_frag_sfr_congure: add congure_abe support 2023-03-01 20:23:32 +01:00
Martine Lenders
33402296d3
gnrc_sixlowpan_frag_sfr_congure: add congure_reno support 2023-03-01 16:32:31 +01:00
Martine Lenders
d0986caf03
gnrc_sixlowpan_frag_sfr_congure: add congure_quic support 2023-03-01 13:08:17 +01:00
bors[bot]
04ef37274f
Merge #16158
16158: gnrc_sixlowpan_frag_sfr_congure_sfr: initial import r=miri64 a=miri64



Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
2023-03-01 08:32:45 +00:00
Benjamin Valentin
44c267c84a nanocoap: allow to define CoAP resources as XFA 2023-02-28 20:13:18 +01:00
bors[bot]
4ccf0af0b1
Merge #19320
19320: sys/vfs: add force option to vfs_umount() r=miri64 a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
2023-02-28 16:55:56 +00:00
Benjamin Valentin
3b587d9268 sys/vfs: add force option to vfs_umount() 2023-02-28 17:24:03 +01:00
bors[bot]
f0b60d5a0d
Merge #17091 #18148
17091: USBUS: Add URB support r=benpicco a=bergzand

### Contribution description

This commit adds support for URBs (USB Request/Response Blocks). These
allow for submitting multi-transfer sized buffers with USBUS handling
the individual usbdev xmits. Multiple URBs can be queued at once for a
single endpoint and USBUS will handle them in the order of submission.

OUT endpoint URBs must always consist of a whole number of full-sized
transfers (N x MaxEndpointSize). They will automatically finish after
the endpoint received a transfer less than the endpoint size.

IN endpoints can be arbitrary-sized and do not have to consist of a
whole number of full-sized transmissions. They support a flag to
indicate that the last transfer in the sequence must be less than a full
sized transfer (USBUS_URB_FLAG_AUTO_ZLP) and this adds a zero length
transfer at the end of the transmissions if the last transfer was equal
to the maximum transfer size.

URBs can be cancelled, but if the URB is already being processed it will
be cancelled after the current transmission within the URB is finished.
If it is still in the queue it will immediately be removed from the
queue.

### Testing procedure

- `tests/usbus_cdc_ecm` should still work. Testing one of the usbdev-supported platform should be sufficient here.

### Issues/PRs references

Needs #17064 


18148: sys/flash_utils: helpers to store data in flash r=benpicco a=maribu

### Contribution description

This helpers that allow storing, accessing, and working with data in flash that works for both classical Harvard architectures (which do not map flash also into the address space) as well as modern Harvard architectures and von-Neumann architectures.

With this, `examples/default` again runs on the Arduino Uno / Nano. Since this board is still the "entry kit" for many people to embedded hardware, it would be nice to support it with our default example.

### Testing procedure

`examples/default` should run and work on ATmega boards (especially ATmega328P and ATmega32U4 based boards) as well on all other boards now.

### Issues/PRs references

None

Co-authored-by: Koen Zandberg <koen@bergzand.net>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-02-27 11:57:20 +00:00
Marian Buschsieweke
29cfeb752e
sys/phydat: use flash_utils 2023-02-27 12:31:03 +01:00
Marian Buschsieweke
2825f5f2ae
sys/shell: use flash_utils 2023-02-27 12:31:03 +01:00
Marian Buschsieweke
4e3c0777fc
sys/flash_utils: add helpers for placing variables in flash
This adds a layer of convenience abstraction over classical Harvard
architectures (like most AVRs) that do not map the flash memory into
the data address space and modern Harvard architectures or von-Neumann
architectures that do so. The motivation is to safe a lot of RAM for
AVR by storing constant strings into flash.
2023-02-27 12:31:03 +01:00
ba88608749
usbus/cdc_ecm: Make use of URBs for inbound frames 2023-02-27 10:09:55 +01:00
7bfdd73818
usbus: Add URB support
This commit adds support for URBs (USB Request/Response Blocks). These
allow for submitting multi-transfer sized buffers with USBUS handling
the individual usbdev xmits. Multiple URBs can be queued at once for a
single endpoint and USBUS will handle them in the order of submission.

OUT endpoint URBs must always consist of a whole number of full-sized
transfers (N x MaxEndpointSize). They will automatically finish after
the endpoint received a transfer less than the endpoint size.

IN endpoints can be arbitrary-sized and do not have to consist of a
whole number of full-sized transmissions. They support a flag to
indicate that the last transfer in the sequence must be less than a full
sized transfer (USBUS_URB_FLAG_AUTO_ZLP) and this adds a zero length
transfer at the end of the transmissions if the last transfer was equal
to the maximum transfer size.

URBs can be cancelled, but if the URB is already being processed it will
be cancelled after the current transmission within the URB is finished.
If it is still in the queue it will immediately be removed from the
queue.
2023-02-27 10:09:53 +01:00
bors[bot]
d4422a074a
Merge #18682
18682: pkg/lwext4: add lightweight implementation of the ext2/3/4 filesystem r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2023-02-25 18:59:07 +00:00
Benjamin Valentin
e798d21b3b pkg/lwext4: add lwEXT4 2023-02-25 14:01:20 +01:00
bors[bot]
4809b687b6
Merge #19292 #19307
19292: sys/phydat: Fix unit confusion r=miri64 a=maribu

### Contribution description

Previously, `UNIT_G` was used for g-force with the correct symbol `g`, `UNIT_GR` for gram (as in kilogram) with the incorrect symbol `G` (which would be correct for Gauss), and `UNIT_GS` for Gauss with symbol `Gs` (which is an alternative correct symbol).

To avoid confusion between G-Force, Gauss, and Gram the units have been renamed to `UNIT_G_FORCE`, `UNIT_GRAM`, and `UNIT_GAUSS`. In addition, gram now uses the correct symbol `g`; which sadly is the same as for g-force. But usually there is enough context to tell them apart.

### Testing procedure

Green CI

### Issues/PRs references

None

19307: nanocoap_link_format: fix off-by-one error r=miri64 a=benpicco



Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-23 21:25:12 +00:00
bors[bot]
72a0f1972d
Merge #18746 #19161
18746: sys/clif: Fixing out of bounds read under certain conditions r=maribu a=Teufelchen1

Hi 😈

This fixes a potential out of bounds read in clif_encode_link. There is no code in RIOT that can be exploited.
The fix does not break the current API but alters the behaviour slightly. Before the change, the length attributes of `clif_attr_t` where optional. If missing, the length was deduced using `strlen()`. This fix makes those parameters required and if they are `0` it operates as if the length really is `0`. This might not be ideal but it is the only non api breaking fix I could think off. 
```c
typedef struct {
    char *value;                  
    unsigned value_len;    NO LONGER OPTIONAL
    const char *key;               
    unsigned key_len;       NO LONGER OPTIONAL
} clif_attr_t;
```
Depends on #18744

cc `@leandrolanzieri` 

19161: bors.yaml: re-activate labels check + add block_labels r=miri64 a=miri64



Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
2023-02-23 16:39:44 +00:00
Marian Buschsieweke
3c287c058d
sys/phydat: Fix unit confusion
Previously, `UNIT_G` was used for g-force with the correct symbol `g`,
`UNIT_GR` for gram (as in kilogram) with the incorrect symbol `G` (which
would be correct for Gauss), and `UNIT_GS` for Gauss with symbol `Gs`
(which is an uncommon but correct symbol).

To avoid confusion between G-Force, Gauss, and Gram the units have been
renamed to `UNIT_G_FORCE`, `UNIT_GRAM`, and `UNIT_GAUSS`. In addition,
gram now uses the correct symbol `g` and Gauss uses `G`.
2023-02-23 16:44:24 +01:00
Teufelchen1
8c295ab7cf sys/clif: Fixing out of bounds read under certain conditions 2023-02-23 15:45:03 +01:00
bors[bot]
0cce1bc067
Merge #19299 #19301
19299: Add missing newline to output of telnet example r=benpicco a=Enoch247

### Contribution description

From the commit msg:

> The telnet example prints a line to the console, but it is not ended with a newline. When using pyterm, the last line is then never shown as it reads the console line by line and is waiting for the end of the line.
> 
> This patch swaps use of `printf` for `puts` for the last line printed. This means the missing newline character gets added. This is also done to be consistent with the rest of the file, where puts is used whenever possible instead of printf.


### Testing procedure

1. `cd examples/telnet`
2. `make all flash term`
3. observe the final line "Local shell disabled" is printed, but would not have without this patch


### Issues/PRs references

- none known


19301: fib: document unused state r=benpicco a=benpicco



Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-02-22 15:50:59 +00:00