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

42964 Commits

Author SHA1 Message Date
Gunar Schorcht
9d2d9db73e makefiles/boards/stm32: fix DFU_USB_ID handling
The variable `DFU_USB_ID` is used by `dfu-util` to specify the device to be flashed. The STM32 make system prevents `dfu-util` from being used as programmer if this variable is not set, although `dfu-util.mk` generates a default value for this variable from the `USB_VID` and `USB_PID` variables if necessary. Therefore, checking the `DFU_USB_ID` variable is removed here. If a board requires a specific combination of VID/PID for `dfu_util`, it is responsible for setting the `DFU_USB_ID` variable.
2023-03-10 10:02:15 +01:00
bors[bot]
738e0c8318
Merge #19351
19351: tools/compile_like_murdock: Add features r=MrKevinWeiss a=MrKevinWeiss

### Contribution description

This adds a few nice-to-have features:
- The `-b all` allows all supported boards to build
- The `-v, -vv, -vvv` allows different levels of verbosity, the most useful might be `-v` which filters only the kconfig diffs
- All warning or STDERR based output from `info-*` are hidden
- The `-m` that only runs a diff of modules and packages, skipping any compilation

### Testing procedure

In induce a mismatch and check the output with `-v`, `-vv` options, clean it up and see the full output with `-vvv`:
```
./dist/tools/compile_test/compile_like_murdock.py -a APP -d -b BOARD -v
```

Check all supported boards are listed with
```
./dist/tools/compile_test/compile_like_murdock.py -a examples/hello-world/ -d -b all
```


### Issues/PRs references



Co-authored-by: MrKevinWeiss <weiss.kevin604@gmail.com>
2023-03-09 06:21:09 +00:00
MrKevinWeiss
c9cfd27d3b tools/compile_like_murdock: Add -m to only check mod/pkgs 2023-03-08 14:35:03 +01:00
bors[bot]
1a5cc2acbb
Merge #19365 #19366 #19367
19365: bootloaders: fix bootloader button logic r=benpicco a=dylad

### Contribution description

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

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

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

### Issues/PRs references
Fixes #19364 


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



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

### Contribution description

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

### Testing procedure

Check that the correct RFC is linked in the docs.

### Issues/PRs references

None


Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
2023-03-08 12:23:24 +00:00
Dylan Laduranty
48b07eb991 bootloaders: fix bootloader button logic
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-08 13:07:42 +01:00
b3439fc800
cord: bump reference from draft to rfc 2023-03-08 11:50:55 +01:00
Benjamin Valentin
d6e05dae7f nanocoap_sock: don't include token in empty ACK response 2023-03-08 11:38:09 +01:00
MrKevinWeiss
df3f0ce71c tools/compile_like_murdock: -v -vv -vvv verbosity settings 2023-03-08 07:59:57 +01:00
MrKevinWeiss
57899387a0 tools/compile_like_murdock: Allow 'all' boards 2023-03-08 07:59:56 +01:00
MrKevinWeiss
1bc8cdabc1 tools/compile_like_murdock: Ignore warning from info-* 2023-03-08 07:59:56 +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]
3575106380
Merge #19234
19234: Makefile.dep: pull in FEATURES_REQUIRED for periph r=maribu a=OlegHahm

### Contribution description

Whenever the module of a peripheral driver, i.e., periph_* should be used, the corresponding entry in the FEATURES_REQUIRED should be added. Conflicts between these modules are only checked when this entry is present.

### Testing procedure

Use, for example, the `default` example on a board with `periph_rtt` and `periph_rtc` available (e.g., the iotlab-m3). 
Change the Makefile from `FEATURES_OPTIONAL += periph_rtc` to `USEMODULE += periph_rtc`. Build and flash the application and call the `rtc gettime` shell command a couple of times.

#### On current master:
You should see incorrect timestamps because the `periph_rtc` conflicts with `periph_rtt` (which is pulled in by the `ztimer_periph_rtt` module).

#### With this PR:
You should see a warning like
```
The following features may conflict: periph_rtc periph_rtt
Rationale: On the STM32F1, the RTC and RTT map to the same hardware peripheral. Only one standard C library can be used. Only one GPIO IRQ implementation can be used. Package tinyUSB is not yet compatible with periph_usbdev.

EXPECT undesired behaviour!
```

Co-authored-by: Oleg Hahm <oleg@hobbykeller.org>
2023-03-07 23:15:37 +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
Oleg Hahm
60a77948a7 Makefile.dep: pull in FEATURES_REQUIRED for periph
Whenever the module of a peripheral driver, i.e., periph_* should be used, the corresponding entry in the
FEATURES_REQUIRED should be added. Conflicts between these modules are
only checked when this entry is present.
2023-03-07 21:06:24 +01:00
Joshua DeWeese
eeb359e80c 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.
2023-03-07 11:52:16 -05:00
Joshua DeWeese
6488fe7cb3 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.
2023-03-07 11:25:23 -05:00
Benjamin Valentin
ad8dd8d061 nanocoap_sock: ensure response address is the same as request address 2023-03-07 16:58:17 +01:00
Benjamin Valentin
a7866f78a1 gcoap: make use of sock_udp_ep_is_multicast() 2023-03-07 16:58:17 +01:00
Benjamin Valentin
15fd7a9a1c net/sock/udp: add sock_udp_ep_is_multicast() 2023-03-07 16:58:17 +01:00
MrKevinWeiss
89f2ae7f24
tests/cpp11_mutex: Cleanup deps 2023-03-07 13:08:58 +01:00
MrKevinWeiss
66570cb0fb
cpu/native: Use ztimer instead of xtimer 2023-03-07 13:08:58 +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
Gunar Schorcht
4845ed0409 boards/stm32f705-dk: add feature periph_usbdev_hs 2023-03-07 11:27:48 +01:00
Gunar Schorcht
aa125f50ab boards/stm32f746g-disco: add feature periph_usbdev_hs 2023-03-07 11:27:30 +01:00
Gunar Schorcht
38de94d243 boards/stm32f723e-disco: add feature periph_usbdev_hs 2023-03-07 11:27:13 +01:00
Gunar Schorcht
16f72dad2a kcfonfigs: introduce feture HAS_PERIPH_USBDEV_HS
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 `HAS_PERIPH_USBDEV_HS` is introduced.
2023-03-07 11:26:17 +01:00
Gunar Schorcht
744f59a2f0 drivers: introduce feture periph_usbdev_hs
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` is introduced.
2023-03-07 11:25:08 +01:00
Oleg Hahm
9aa0c0fc8c doc: add quicklink to boards in navbar 2023-03-06 18:50:17 +01:00
bors[bot]
777857ae4c
Merge #19340 #19352
19340: cpu/native: implement periph_rtc_ms r=benpicco a=benpicco



19352: pkg/tinydtls: don't require ztimer64 r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-03-06 17:34:53 +00: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
Benjamin Valentin
8af82305a0 pkg/tinydtls: don't require ztimer64
The RIOT integration makes no use of ztimer64, so drop it.
2023-03-06 14:10:07 +01:00
bors[bot]
bc517b5c47
Merge #19348
19348: boards/remote-*: drop custom led_init() r=MrKevinWeiss a=benpicco





Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-03-06 10:22:30 +00:00
Benjamin Valentin
66707ad367 boards/remote-*: drop custom led_init()
A custom rainbow boot-up animation/delay gets old pretty quick
and we didn't actually init the LEDs anyway, so it would not be shown.

Drop the custom led_init() so the generic led_init() kicks in
and properly initializes the LEDs.
2023-03-06 11:04:48 +01:00
bors[bot]
3a325ba91e
Merge #19347
19347: pkg/fatfs: bump to r0.15 r=maribu a=benpicco




Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
2023-03-05 10:15:44 +00:00
Benjamin Valentin
ce36460b16 cpu/native: implement periph_rtc_ms 2023-03-05 02:56:28 +01:00
Benjamin Valentin
6991b0975d pkg/fatfs: bump to r0.15
- Changed user provided synchronization functions in order to completely eliminate the platform dependency from FatFs code.
 - Fixed a potential error in f_mount when FF_FS_REENTRANT.
 - Fixed file lock control FF_FS_LOCK is not mutal excluded when FF_FS_REENTRANT && FF_VOLUMES > 1 is true.
 - Fixed f_mkfs creates broken exFAT volume when the size of volume is >= 2^32 sectors.
 - Fixed string functions cannot write the unicode characters not in BMP when FF_LFN_UNICODE == 2 (UTF-8).
 - Fixed a compatibility issue in identification of GPT header.
2023-03-05 00:46:06 +01:00
bors[bot]
a9310ed46c
Merge #19341 #19345
19341: Picolibc updates r=benpicco a=keith-packard

### Contribution description

Minor updates to picolibc support for newer versions of picolibc, including 1.8.


### Testing procedure

Here's the current build result for a board I happen to have on my bench right now:

```
$ make -C examples/blinky BOARD=nucleo-f103rb FEATURES_REQUIRED=picolibc
...
/home/keithp/src/RIOT/sys/picolibc_syscalls_default/syscalls.c:319:1: error: unknown type name '_READ_WRITE_RETURN_TYPE'
  319 | _READ_WRITE_RETURN_TYPE read(int fd, void *dest, size_t count)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/home/keithp/src/RIOT/sys/picolibc_syscalls_default/syscalls.c:351:1: error: unknown type name '_READ_WRITE_RETURN_TYPE'
  351 | _READ_WRITE_RETURN_TYPE write(int fd, const void *src, size_t count)
      | ^~~~~~~~~~~~~~~~~~~~~~~
...
```

### Description of changes

 1. Fix the read/write return values (Picolibc 1.8 uses POSIX standard types now)
 2. Add new symbols to linker scripts (Picolibc needs help dealing with TLS alignment)
 3. Align stack and thread local storage block during thread setup.


19345: cpu/riscv_common: convert to uword_t usage r=benpicco a=dylad

### Contribution description

This PR makes use of `uword_t` type in a few places in `cpu/riscv_common`.
This should not have any effect on produced binaries.

### Testing procedure

CI should be enough. 

### Issues/PRs references
Quickly adapt from #16994. It will help for 64 bits support one day ;)



Co-authored-by: Keith Packard <keithp@keithp.com>
Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-04 22:00:55 +00:00
Keith Packard
0ceb0804b0 core/thread: Fix up stack and TLS alignments
Make sure both the stack and TLS blocks are correctly aligned by
adjusting the TLS base address to the most strict alignment of the TLS
block and the stack.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-03-04 01:18:36 -08:00
Dylan Laduranty
5f699eeed3 cpu/riscv_common: convert to uword_t usage
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-03 22:16:25 +01:00
bors[bot]
8c6926d0ef
Merge #19344
19344: test/periph_rtc: reset struct tm time between tests r=benpicco a=kfessel

### Contribution description

while reviewing #19340 i found test/periph_rtc to be insufficient to prove rtc_set_time is working. this changes that and avoids accidental reuse of struct tm time and ms  values by resetting time and ms;

### Testing procedure

run the test

### Issues/PRs references

#19340

Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
2023-03-03 20:34:28 +00:00
Keith Packard
698abbaa04 sys/picolibc_syscalls_default: Fix read/write return for picolibc >= 1.8
Picolibc switched to standard posix types for read/write return in
version 1.8.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-03-03 12:04:48 -08:00
Karl Fessel
0cfdd3d679 test/periph_rtc: reset struct tm time between tests 2023-03-03 15:47:09 +01:00
Keith Packard
fb01e6a3fb cpu: Add TLS symbols for newer picolibc to linker scripts
Newer picolibc versions require some additional symbols defined in the
linker script to correctly manage alignment constraints on thread
local storage.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-03-02 22:55:22 -08: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
Dylan Laduranty
3671b009d8 tests: add test application for usbus msc
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-02 22:17:41 +01:00
Dylan Laduranty
854d3b7e94 dist/tools/doccheck: remove false positives
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-02 22:04:08 +01:00
Dylan Laduranty
a7e16536ab Kconfig: add Kconfig for USB MSC
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2023-03-02 22:04:08 +01: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
bors[bot]
8d800e92b4
Merge #18515
18515: libschc: initial import as package r=miri64 a=miri64



Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
2023-03-02 12:39:31 +00:00