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
Jan Romann
cebb374c19 coap: add missing option numbers 2023-08-11 08:47:43 +02:00
Gunar Schorcht
00275326a8 drivers/mtd: add SDMMC support 2023-08-08 09:09:12 +02:00
Benjamin Valentin
ae28f11e3a gnrc_static: fix static PID assignment 2023-08-01 23:27:20 +02:00
bors[bot]
bff745236c
Merge #19817 #19826 #19841 #19842
19817: compile_and_test_for_boards: Add no-compile flag r=benpicco a=MrKevinWeiss


### Contribution description

Since we have a no-test flag that prevents executing tests, I think a no-compile flag is a nice compliment. Why? Well if I want to use this script for running multiple boards at the same time, RIOT is not so great handling parallel compile steps with conflicts on lockfiles happening, mostly due to packages. With this I can compile a list of boards sequentially, then flash and run tests in parallel, skipping the compile step.


### Testing procedure

Run the following once to compile and clean:
```
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native --applications tests/sys/shell --clean-after
```

Then try to run without the compile step and it should fail due to lack of the binary
```
./dist/tools/compile_and_test_for_board/compile_and_test_for_board.py . native --applications tests/sys/shell --no-compile
```

### Issues/PRs references


19826: ztimer/periodic: reinit remove from right clock and handle aquired ztimer r=benpicco a=kfessel

### Contribution description

#19806 added some retinit handling for ztimer periodic removing the timer from the new clock 

This tries to detect if this is a reinit and remove the timer from the old clock
this also removes the ztimer_acquire/_release handling by removing now calls in favour of set return value and now values  that are allready in ztimer,
that also has the potential to reduce the jitter of the periodic calls and bus-usage (for cpus that take their time to get "now") 

### Testing procedure

read

run tests/sys/ztimer_periodic

### Issues/PRs references

Fixes #19806 

19841: boards/adafruit-itsybitsy-nrf52: Add configuration for DotStar LED r=benpicco a=jimporter



19842: cpu/stm32: fix ld script for SRAM4 r=benpicco a=gschorcht

### Contribution description

This PR fixes the LD script for STM32.

Since the CCM and SRAM4 length are defined as symbols with perifx `_`, the LD script didn't use them correctly. Instead of using `ccmram_length` and `sram4_length`, `_ccmram_length` and `_sram4_length` have to be used. Furthermore, the location counter for the SRAM has to be set to the beginning of SRAM4 to work.

BTW, I don't understand why the `ccmram` region is defined. There is no section definition that would use it to place code or data with attribute `.ccmram.*` there.

Without the fix in this PR, defined symbols in `tests/sys/malloc` for the `b-u585i-iot02a` board were:
```python
00000000 T _sheap2     <== wrong start position because of wrong location counter
28000000 T _eheap2     <== wrong end position because of `sram4_length` is 0.
```
Although the `tests/sys/malloc` crashes for `b-u585i-iot02a` at the end of the heap (known problem, see [here](https://github.com/RIOT-OS/RIOT/pull/17410#issuecomment-996556823)), it uses only the backup RAM before it crashes:
```
Allocated 512 Bytes at 0x200bf600, total 756072
Allocated 512 Bytes at 0x200bf818, total 756592
Allocated 512 Bytes at 0x200bfa30, total 757112
Allocated 512 Bytes at 0x200bfc48, total 757632
Allocated 512 Bytes at 0x40036408, total 758152
Allocated 512 Bytes at 0x40036610, total 758672
Allocated 512 Bytes at 0x40036818, total 759192
```

With the fix in this PR, defined symbols in `tests/sys/malloc` for the `b-u585i-iot02a` board are:
```python
28000000 T _sheap2     <== correct start position
28004000 T _eheap2     <== correct end position
```
`tests/sys/malloc` also crashes for the `b-u585i-iot02a` at the end of the heap, but it uses also the SRAM4 before it crashes.
```
Allocated 512 Bytes at 0x200bf600, total 756072
Allocated 512 Bytes at 0x200bf818, total 756592
Allocated 512 Bytes at 0x200bfa30, total 757112
Allocated 512 Bytes at 0x200bfc48, total 757632
Allocated 512 Bytes at 0x40036408, total 758152
Allocated 512 Bytes at 0x40036610, total 758672
Allocated 512 Bytes at 0x40036818, total 759192
Allocated 512 Bytes at 0x28000008, total 759712
Allocated 512 Bytes at 0x28000210, total 760232
Allocated 512 Bytes at 0x28000418, total 760752
...
Allocated 512 Bytes at 0x280038e8, total 774272
Allocated 512 Bytes at 0x28003af0, total 774792
Allocated 512 Bytes at 0x28003cf8, total 775312
```

### Testing procedure

1. Flash `tests/sys/malloc` and use `MAX_MEM` limit to stop `malloc` before the crash:
   ```
   CFLAGS='-DMAX_MEM=774800 -DCHUNK_SIZE=512 -DDEBUG_ASSERT_VERBOSE' \
   BOARD=b-u585i-iot02a make -j8 -C tests/sys/malloc flash
   ```
   Without the PR it crashes at the end of the backup RAM. With the PR it works.

2. Check `_sheap2` and `_eheap2` with
   ```
   nm -s tests/sys/malloc/bin/b-u585i-iot02a/tests_malloc.elf | grep heap2 | sort
   ```
   Without the PR it will be:
   ```
   00000000 T _sheap2
   28000000 T _eheap2
   ```
   With the PR it should be:
   ```
   28000000 T _sheap2
   28004000 T _eheap2
   ```

### Issues/PRs references


Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Co-authored-by: Jim Porter <jporterbugs@gmail.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-07-24 10:50:36 +00:00
Benjamin Valentin
5a0550e96e sys/net/sock: add sock_aux_ttl 2023-07-18 16:41:42 +02:00
Marian Buschsieweke
fd3ae2993f
sys/ztimer: work around bug in old LLVM
The sum of an `uint16_t` variable and a literal `1` should still be of
type `uin16_t`. And at least with LLVM 16 this seems to be the case,
but not with the LLVM version in our build container :/

So cast what should have been `uint16_t` anyway explicitly to `uint16_t`
to make that buggy version of LLVM happy.
2023-07-18 12:24:08 +02:00
Marian Buschsieweke
dd7bec50b5
sys/usb/usbus_hid: fix compilation with clang
Well, it is actually a cosmetic issue. But I agree with clang that it
is ugly enough to refuse compiling over it :D
2023-07-18 12:24:08 +02:00
Marian Buschsieweke
a4e4c1f2a7
sys/suit: fix compilation with clang 2023-07-18 12:24:08 +02:00
Marian Buschsieweke
ec699db9f4
sys/suit/storage: fix compilation with LLVM 2023-07-18 12:24:08 +02:00
Marian Buschsieweke
2ae3c7c84f
sys/stdio_nimble: fix -Wformat-nonliteral warning 2023-07-18 12:24:08 +02:00
Marian Buschsieweke
72184a3afd
sys/shell_lock: fix compilation with llvm
Make writes to `the_same` "observable behavior" by declaring it
`volatile` to prevent compiler optimization rather than GCC specific
attributes.

Likely, either doesn't a super good job at resulting in constant
time code. But with the plain text password stored in flash, this
likely also isn't what should keep one up at night when actually using
this module.
2023-07-18 12:24:08 +02:00
Marian Buschsieweke
4709bbb952
sys/net/gnrc_lorawan: make clang happy
`clang` doesn't propagate the packed attribute to members. I think
this incorrect, but explicitly adding it won't hurt and makes clang
happy. So let's have it.
2023-07-18 12:24:08 +02:00
Marian Buschsieweke
76347a83d7
sys/cpp11-compat: fix compilation with clang++ 2023-07-18 12:24:08 +02:00
Marian Buschsieweke
3336a8d173
sys/cpp_new_delete: fix compilation with clang
Fix `-Wimplicit-exception-spec-mismatch` warning.
2023-07-18 12:24:08 +02:00
Fabian Hüßler
dd52f5fedd sys/net: add l2scan list module 2023-07-14 20:27:10 +02:00
Karl Fessel
4f2237dd0b ztimer/periodic: stop timer before reinit, remove aquire/release
- not ztimer_now calls outsid irq -> remove aquire
2023-07-14 18:27:06 +02:00
bors[bot]
7dd7d1e3a7
Merge #19806 #19814
19806: ztimer/periodic: remove timer on init if already running r=kaspar030 a=benpicco



19814: boards/sipeed-longan-nano: revert default to variant with TFT r=benpicco a=gschorcht

### Contribution description

This PR reverts commit 69fb00bdfa to fix CI compilation.

### Testing procedure

Green CI with full build.

### Issues/PRs references


Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-07-12 20:03:13 +00:00
Benjamin Valentin
eadb3741e3 ztimer/periodic: remove timer on init if already running 2023-07-12 15:03:48 +02:00
bors[bot]
72ca81b65c
Merge #19487 #19808
19487: nanocoap: implement extended tokens (RFC 8974) r=benpicco a=benpicco



19808: boards: add ESP32-S3-USB-OTG support r=benpicco a=gschorcht

### Contribution description

This PR provides the support for the [ESP32-S3-USB-OTG](https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32s3/esp32-s3-usb-otg/user_guide.html) board.

The SD card can only be used in SPI mode at the moment. As soon as PR #19786 is merged, the SD/MMC support can be enabled and the SD card can then be used in SD mode with 4-bit data bus width.

The display uses uses the ST7789 driver IC that is compatible with the ST7735. For that purpose the ST7735 driver is extended by a pseudomodule definition `st7789` for the ST7789 which is enabled by the board and enables automatically the `st7789` (e57c48a33ee2a869c15603788e5306ba066f91cf). Vise versa, board's `Makefile.dep` enables automatically the `st7789` pseudomodule if the `st7735` is used. The pseudomodule `st7789` is just used to increase the upper limit for supported lines. This change is also part of PR #19807.

~The PR includes a very small documentation fix for ESP32-S3-DevKit board that was noticed during the development of this board definition (1155b6ac1b8efa39d8a0bd7150e602095159fdc1).~

### Testing procedure

The board has been tested with all basic tests for supported hardware including `tests/driver/st3375`:

![IMG_20230707_105556](https://github.com/RIOT-OS/RIOT/assets/31932013/88d4ac11-0c02-4339-a423-7900e1c0904c)

- [x] tests/drivers/st3375
- [x] tests/periph/gpio
- [x] tests/periph/pwm
- [x] tests/periph/spi
- [x] tests/periph/uart
- [x] tests/sys/usbus_cdc_ecm 

### Issues/PRs references


Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-07-07 17:41:40 +00:00
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
Dylan Laduranty
a1051f8ea8 sys/od: increase the size of str_pos variable
Otherwise the function will only displays the first 256 ASCII representation of the bytes in a loop

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-07-06 13:27:58 +02:00
zvecr
9139813d17 Implement USB_FEATURE_DEVICE_REMOTE_WAKEUP handling 2023-07-05 23:40:07 +01:00
bors[bot]
ddf1fe252d
Merge #19733 #19747 #19769 #19782
19733: cpu/msp430: reorganize code r=maribu a=maribu

### Contribution description

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:

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

This moves peripheral drivers shared between the two families to msp430_common and splits the SPI and UART driver into two MCU families.

In addition, it cleans up the `msp430_regs.h` by dropping most of it and using the macros and symbols provided by the vendor header files. There is little reason for us to maintain constants when TI is already doing that.

[MSP430 x1xx]: https://www.ti.com/lit/ug/slau049f/slau049f.pdf
[MSP430 F2xx/G2xx]: https://www.ti.com/lit/ug/slau144k/slau144k.pdf


19747: gnrc/ipv6/nib: reset rs_sent counter also for not-6LN interfaces r=maribu a=fabian18



19769: cpu/nrf53: add initial support with nRF5340DK-APP board r=maribu a=dylad

### Contribution description

This PR adds support for nRF5340 MCU and its associated Nordic development board, nRF5340DK.
This MCU provides a dual Cortex-M33, one application core running at up to 128MHz, and one network core running at up to 64MHz.
Peripherals are inherited from others Nordic MCUs families so it shouldn't be hard to add more of them in followup PRs.

For now, only the minimal set of peripherals is supported:
- GPIO / GPIO_IRQ
- UART
- TIMER

### Testing procedure
Build the usual test application for the supported peripherals and flash the board.
nRF5340DK provides two serial ports on its embedded debugger. RIOT's shell should be available on the first one (/dev/ttyACM0)


### Issues/PRs references
#18576
#19267 


19782: cpu/msp430: fix for ti's msp430-gcc-opensource package ld version r=maribu a=hugueslarrive

### Contribution description
My msp430 toolchain (https://www.ti.com/tool/MSP430-GCC-OPENSOURCE) was broken by #19484:
```
hugues@p700:~/github/cpu_msp430_common/RIOT$ BOARD=msb-430 make -j64 -C examples/hello-world
make : on entre dans le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world »
Building application "hello-world" for "msb-430" with MCU "msp430fxyz".

"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/init
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/msb-430
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/core
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/core/lib
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/msb-430
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers/periph_common
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/auto_init
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/div
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/libc
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/malloc_thread_safe
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/newlib_syscalls_default
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz/periph
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/preprocessor
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/stdio_uart
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common/periph
/opt/ti/msp430-gcc/bin/../lib/gcc/msp430-elf/9.3.1/../../../../msp430-elf/bin/ld: .rodata not found for insert
collect2: error: ld returned 1 exit status
make: *** [/home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world/../../Makefile.include:761 : /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world/bin/msb-430/hello-world.elf] Erreur 1
make : on quitte le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world »
hugues@p700:~/github/cpu_msp430_common/RIOT$ /opt/ti/msp430-gcc/msp430-elf/bin/ld --version
GNU ld (Mitto Systems Limited - msp430-gcc 9.3.1.11) 2.34
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
hugues@p700:~/github/cpu_msp430_common/RIOT$ /opt/ti/msp430-gcc/msp430-elf/bin/ld --version | grep -Eo '[0-9]\.[0-9]+'
9.3
1.11
2.34
hugues@p700:~/github/cpu_msp430_common/RIOT$ /opt/ti/msp430-gcc/msp430-elf/bin/ld --version | grep -Eo '[0-9]\.[0-9]+$'
2.34
```


### Testing procedure
```
hugues@p700:~/github/cpu_msp430_common/RIOT$ BOARD=msb-430 make -j64 -C examples/hello-world
make : on entre dans le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world »
Building application "hello-world" for "msb-430" with MCU "msp430fxyz".

"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/init
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/msb-430
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/core
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/core/lib
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/msb-430
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers/periph_common
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/auto_init
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/div
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/libc
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/malloc_thread_safe
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/newlib_syscalls_default
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/preprocessor
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/stdio_uart
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz/periph
"make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common/periph
   text	   data	    bss	    dec	    hex	filename
   8612	    722	    866	  10200	   27d8	/home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world/bin/msb-430/hello-world.elf
make : on quitte le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world »
```


### Issues/PRs references
Introduced by #19484, highlighted in #16727.


Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: Hugues Larrive <hlarrive@pm.me>
2023-07-04 18:43:26 +00:00
Marian Buschsieweke
a461cd8b94
sys/arduino: move pseudo modules to makefiles
This allows using the arduino_pwm feature (which is translated into a
module) without the arduino module; e.g. for only using the Arduino
I/O mapping but not the Arduino API.
2023-06-28 09:09:31 +02:00
Marian Buschsieweke
043e8cc88e
boards,sys/arduino: major clean up
- Rename all `arduino_pinmap.h` to `arduino_iomap.h`
    - An empty `arduino_pinmap.h` that just includes `arduino_iomap.h`
      is provided for backward compatibility
    - Move all info from `arduino_board.h` into the new file as trivial
      macros, so that they can also be used outside of sketches
    - The new name reflects the fact not just pin mappings, but also
      other I/O features such as PWMs are mapped
- Drop all `arduino_board.h`
    - `arduino_board.h` and `arduino_iomap.h` now provide the exact
      same information, just in a different format
    - a generic `arduino_board.h` is provided instead that just
      uses the info in `arduinio_iomap.h` and provides them in the
      format the code in `sys/arduino` expects it
- Add fine grained features to indicate for mappings
    - availability of mappings for analog pins, DAC pins, PWM pins,
      UART devices, SPI/I2C buses to the corresponding RIOT
      identification can now be expressed:
        - `arduino_pins`: `ARDUINO_PIN_0` etc. are available
        - `arduino_analog`: `ARDUINO_A0` etc. are available
        - `arduino_pwm`: `ARDUINO_PIN_13_PWM_DEV` etc. are available
        - `arduino_dac`: `ARDUINO_DAC0` etc. are available
        - `arduino_uart`: `ARDUINO_UART_D0D1` or similar are available
        - `arduino_spi`: `ARDUINO_SPI_ISP` or similar are available
        - `arduino_i2c`: `ARDUINO_I2C_UNO` or similar are available
    - mechanical/electrical compatibility with specific form factors
      can now be expressed as features:
        - `aruino_shield_nano`: Arduino NANO compatible headers
        - `aruino_shield_uno`: Arduino UNO compatible headers
        - `aruino_shield_mega`: Arduino MEGA compatible headers
        - `aruino_shield_isp`: ISP header is available

This provides the groundwork to implement shield support as modules
that can rely on the I/O mappings, rather than having to provide a
configuration per board.
2023-06-26 17:24:07 +02:00
bors[bot]
655211129e
Merge #19749
19749: sys/net/rpl: fix missing assignment operator r=maribu a=szsam




Co-authored-by: Mingjie Shen <shen497@purdue.edu>
2023-06-24 16:04:59 +00:00
bors[bot]
9ba1d78c55
Merge #19756
19756: all/gnrc: fix null pointer dereference r=miri64 a=szsam



Co-authored-by: Mingjie Shen <shen497@purdue.edu>
2023-06-23 05:13:31 +00:00
Mingjie Shen
51ff6c3675 all/gnrc: fix null pointer dereference
Check return values of following functions for null:
    - gnrc_netif_iter
    - gnrc_netif_hdr_build
    - gnrc_pktsnip_search_type
    - gnrc_netif_get_by_pid
    - gnrc_netif_hdr_get_netif
    - _nib_drl_get
2023-06-22 19:43:30 -04:00
Mingjie Shen
4fc1c25082 sys/net/rpl: fix missing assignment operator
GNRC_RPL_COUNTER_INCREMENT has no external side effects.
2023-06-21 14:05:07 -04:00
Fabian Hüßler
7ea264e310 gnrc/ipv6/nib: reset rs_sent counter also for not-6LN interfaces 2023-06-20 14:28:44 +02:00
bors[bot]
561e19303d
Merge #19718 #19737 #19746
19718: drivers/dht: busy wait reimplementation r=benpicco a=hugueslarrive

### Contribution description

In PR #19674, I also provided quick and dirty fixes to restore functionality on esp8266 and enable operation on AVR. While reviewing PR #18591, it became apparent to me that this driver needed a refresh, particularly its migration to ztimer.

The cause of the malfunction on esp8266 was that since the default switch to ztimer as the backend for xtimer, XTIMER_BACKOFF was no longer taken into account. Therefore, the correction I provided in PR #19674 simply made explicit what was previously done implicitly with xtimer and now needs to be done explicitly with ztimer (spinning instead of sleeping).

Moreover, it was unnecessarily complex to measure the pulse duration in a busy-wait implementation, which required 2 calls to ztimer_now() and  32-bit operations expensive on 8-bit architecture. Instead, it is sufficient to read the state of the bus at the threshold moment.

Finally, in practice, it is possible to reduce the read interval (down to less than 0.5s for DHT22) by "harassing" the DHT with start signals until it responds.

This re-implementation brings the following improvements:
- Many backports from `@maribu's` IRQ based implementation (#18591):
  - Use of ztimer
  - Use of errno.h
  - Use of a dht_data structure to pass arguments, to facilitate integration
  - Adaptation of the bit parsing technique to parse bits into the data array
- Reintroduction of DHT11/DHT22 differentiation.
- Separation of `dht_read()` steps into functions for better readability and the ability to share certain functions among different implementations
- Sensor presence check in `dht_init()`
- ~~Automatic adjustment to a minimum data hold time~~
- Default input mode changed to open drain (a pull-up resistor should be placed close to the output if necessary but not close to the input)
- AVR support without platform-specific handling by avoiding  ztimer_spin() and using the overflow of an 8-bit variable as a pre-timeout to minimize time-consuming ztimer_now() calls

Regarding the changes in the start signal sequence and the removal of the `_reset()` function:
![nano_dht_read_2](https://github.com/RIOT-OS/RIOT/assets/67432403/95966813-2b5f-4a0f-a388-8ac630526ab2)

~~In the previous implementation, there was an unnecessary spike at the beginning of the signal sequence, corresponding to START_HIGH_TIME. This spike has been removed in the re-implementation, as it is unnecessary. Instead, the MCU now simply pulls the signal low for START_LOW_TIME and then releases the bus, which is sufficient for initiating communication with the DHT sensor.~~ Actually, it is necessary to raise the bus level; otherwise, the _wait_for_level() called immediately after to check the response of the DHT may read the port before the signal level is raised, resulting in a false positive.

Additionally, the previous implementation had an issue where the MCU switched back to output mode and went high immediately after reading the 40 bits of data. However, the DHT sensor was still transmitting 2 or 3 additional bytes of '0' at that point, causing a conflict. This issue has been resolved in the re-implementation:
![nano_dht_read_optimized](https://github.com/RIOT-OS/RIOT/assets/67432403/ff124839-5ec5-4df3-bab7-5348d8160a25)

~~Regarding the optimization for AVR, I have performed measurements of `_wait_for_level()` until timeout (85 loops):~~
~~- on esp8266-esp-12x: 264 µs, which is 3.11 µs per loop~~
~~- on nucleo-f303k8: 319 µs, which is 3.75 µs per loop~~
~~- on arduino-nano: 3608 µs, which is 42.45 µs per loop~~
~~Duration measurements on the Arduino Nano:~~


19737: dist/tools/openocd: start debug-server in background and wait r=benpicco a=fabian18



19746: buildsystem: Always expose CPU_RAM_BASE & SIZE flags r=benpicco a=Teufelchen1

### Contribution description

Hello 🐧 

This moves the definition of `CPU_RAM_BASE/SIZE` from being only available in certain situation to be always available.
Reason for change is to simplify common code in the cpu folder.

In cooperation with `@benpicco` 

### Testing procedure

Passing CI


### Issues/PRs references

First usage will be in the PMP driver. Although there is more code in RIOT that could be refactored to use these defines instead of hacks / hardcoded values.

Co-authored-by: Hugues Larrive <hlarrive@pm.me>
Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
Co-authored-by: Teufelchen1 <bennet.blischke@outlook.com>
2023-06-20 10:40:01 +00:00
Teufelchen1
791d4e3a4d buildsystem: Always expose CPU_RAM_BASE & SIZE flags 2023-06-20 12:16:06 +02: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]
ef82aa6acc
Merge #19651
19651: sys/stdio_semihosting: model in Kconfig r=MrKevinWeiss a=aabadie



Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
2023-06-19 07:07:59 +00:00
3b505a2883
pkg/tinyusb: sys: fix stdio buffered inclusion in Kconfig 2023-06-17 15:12:31 +02:00
Mingjie Shen
fe92f676b4 gnrc/rpl: fix incorrect addition overflow check
Checking for overflow of integer addition by comparing against one of
the arguments of the addition does not work when the result of the
addition is automatically promoted to a larger type.

Fix by using an explicit cast to make sure that the result of the
addition is not implicitly converted to a larger type.
2023-06-17 02:25:11 -04:00
f72cb049eb
sys/Kconfig.stdio: model stdio_semihosting in Kconfig 2023-06-16 11:36:42 +02:00
1826331529
sys/usbus: move dependency resolution in its own Makefile.dep 2023-06-15 10:27:38 +02:00
03d2792f8b
sys/congure: move dependency resolution in its own Makefile.dep 2023-06-15 10:27:38 +02:00
d9047a063f
sys/ut_process: move dependency resolution in its own Makefile.dep 2023-06-15 10:27:38 +02:00
bec4c3e0b3
sys/evtimer: move dependency resolution in its own Makefile.dep 2023-06-15 10:27:37 +02:00
6cfafbde6c
sys/uri_parser: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:57 +02:00
ff4b2d1680
sys/fido2: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:57 +02:00
9bd7950a1a
sys/suit: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:57 +02:00
d617d864e6
sys/riotboot: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:56 +02:00
1f4adb2775
sys/uuid: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:56 +02:00
8256424480
sys/benchmark: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:55 +02:00
9386e08ecf
sys/event: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:55 +02:00
c164007425
sys/vfs*: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:54 +02:00
c8d4256c84
sys/random: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:54 +02:00
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