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

10515 Commits

Author SHA1 Message Date
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
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