1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

11363 Commits

Author SHA1 Message Date
benpicco
1e29887660
Merge pull request #21219 from benpicco/event/periodic_callback
sys/event: add `event_deferred_callback_post()` helper
2025-02-28 12:49:57 +00:00
mguetschow
5018dc6bbf
Merge pull request #21241 from maribu/sys/net/nanocoap/fix-api-inconsistency
sys/net/nanocoap: fix API inconsistency
2025-02-24 12:56:32 +00:00
Marian Buschsieweke
be27eafc4f
sys/net/nanocoap: fix API inconsistency
For in-band signalling that a content format is not valid / present,
the magic number `COAP_FORMAT_NONE` was introduced and the type
`uint16_t` was used. Some APIs however used different in-band signalling
values and types:

- coap_reply_simple(): No signal available, `unsigned int`
- coap_build_reply_header(): negative values, `int`
    (Using `int` would prevent using larger content format numbers on
    8-bit and 16-bit archs, where `int` and `int16_t` have the same
    range.)

This changes the behavior to consistently use `COAP_FORMAT_NONE` as
"no content format" signal and `uint16_t` as type.
2025-02-24 12:05:35 +01:00
chrysn
0e6f92eba1 rust: Remove explicit panic=abort in Cargo.toml 2025-02-22 00:10:02 +01:00
Oleg Hahm
4d41dda9a7
Merge pull request #21221 from mguetschow/examples-names-short
examples: shorten subfolders' names
2025-02-21 09:07:48 +00:00
Mikolai Gütschow
9a45c30222
examples: shorten subfolders' names 2025-02-21 09:55:24 +01:00
benpicco
f67055c3b2
Merge pull request #19668 from benpicco/ieee802154_symbol_time_on_demand
ieee802154/submac: calculate symbol time on demand
2025-02-20 12:04:10 +00:00
Benjamin Valentin
73e45dd6ca ieee802154/submac: implement MR-FSK timings 2025-02-20 12:00:00 +01:00
Marian Buschsieweke
546b87a2e8
sys/net/nanocoap: fix dereferencing a null pointer
`coap_request_ctx_get_local()` may return `NULL` depending on module
selection. If it does, we cannot pass `NULL` to
`sock_udp_ep_is_multicast()`.

This changes the code assume the request is not received via multicast
when module `sock_aux_local` is not in use.

When the user binds the CoAP server to multiple endpoints (as needed
for using multicast), it is required that `sock_aux_local` is in use
anyway, as otherwise the server may not respond using the endpoint it
received the request on. (That in turn would render the client unable to
correlate the response to the request.)
2025-02-19 11:05:46 +01:00
krzysztof-cabaj
a2dfd78b27 treewide: fix double the in doc and comments 2025-02-18 13:25:02 +01:00
Benjamin Valentin
48f66692ef sys/event: add event_deferred_callback_post() helper 2025-02-17 13:04:03 +01:00
Marian Buschsieweke
4de6aa10e9
Merge pull request #21212 from mguetschow/examples-rename-match
treewide: fix example references in docs
2025-02-14 18:44:12 +00:00
Mikolai Gütschow
ca5fe72bf8
treewide: fix example references in docs
adapt to folder structure from #21135
2025-02-14 19:14:22 +01:00
Benjamin Valentin
82e892089e sys/net/gnrc/netif: pktqueue: don't clash with GNRC_NETIF_FLAGS_6LO_HC 2025-02-14 16:48:43 +01:00
krzysztof-cabaj
07c6630f45 sys/ztimer: fix small typo in doc 2025-02-12 14:47:50 +01:00
benpicco
837bc0c5ed
Merge pull request #20428 from cogip/fdcan
can: add CAN FD support to STM32G4 and native architecture
2025-02-10 16:31:39 +00:00
Benjamin Valentin
a886adf611 ieee802154/submac: implement MR-OFDM timings 2025-02-10 14:56:14 +01:00
Marian Buschsieweke
c700ead7e9
sys/suit: include nanocoap.h only when used 2025-02-05 15:09:10 +01:00
Marian Buschsieweke
5b6bac000a
sys/net/nanocoap: drop typedef hack
There is an `typdef void sock_udp_ep_t` hack in `nanocoap.h` that tries
allow using parts of nanocoap without a RIOT network stack.

There is a similar hack to allow it to be used without RIOT at all. This
has been used in the early days during development on Linux directly.
This however has not been tested and left bit rotting.

Both hacks are remove and nanocoap now just depends on sock/udp.h.

In a future cleanup, the CoAP packet parsing and building code of
nanocoap can be separated from the part that does the transmission and
reception of UDP packets. That way, using nanocoap's packet parsing and
building will again be available without using a network stack.

Until then, let's drop the hacks and just depend on a network stack.
2025-02-05 14:56:42 +01:00
Gilles DOFFE
f05fc0c70f can: introduce loop_delay
During the data phase of a FDCAN transmission only one node is
transmitting, all others are receivers. The length of the bus line has
no impact.
When transmitting via pin FDCAN_TX the protocol controller receives the
transmitted data from its local CAN transceiver via pin FDCAN_RX. The
received data is delayed by the CAN transceiver loop delay.
If this delay is greater than TSEG1 (time segment before sample point),
a bit error is detected. Without transceiver delay compensation, the bit
rate in the data phase of a FDCAN frame is limited by the transceiver's
loop delay.

Since this parameter is related to the transceiver used, there cannot be
a default value, and it must be explicitly defined with the
configuration variable CONFIG_FDCAN_DEVICE_TRANSCEIVER_LOOP_DELAY.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +01:00
Gilles DOFFE
3c026569f6 can: add CAN FD configuration
Add CAN FD specifities to CAN system library in RIOT:
* 64 bytes payload
* Bit rate switching
* Error State Indicator

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +01:00
Gilles DOFFE
f6f6f6973c can: introduce typedef can_frame_t
Whole CAN code in RIOT is using 'struct can_frame' to represent a CAN
frame.
However incoming CAN FD support will bring 'struct canfd_frame' to
represent CAN FD frames.
Even if the 'struct canfd_frame' has additional flags and a bigger
payload, it is aligned on 'struct can_frame' and thus they can be
referenced by the same pointers in the code.

As it is impossible to predict which one will be used in RIOT, just
define a new type 'can_frame_t' which will map to the right struct
according to the MCU CAN supported format.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:22 +01:00
Gilles DOFFE
ae51a22fbb can: use frame len instead of can_dlc
RIOT implementation of CAN bus relies on SocketCAN model.
Since commit c398e56 (can: add optional DLC element to Classical CAN
frame structure), '__u8 can_dlc' attribute of struct can_frame is
considered as deprecated in SocketCAN and kept for legacy support.
Attribute '__u8 len' should be used instead.

	union {
		/* CAN frame payload length in byte (0 .. CAN_MAX_DLEN)
		 * was previously named can_dlc so we need to carry that
		 * name for legacy support
		 */
		__u8 len;
		__u8 can_dlc; /* deprecated */
	};

Moreover, CAN FD frame structure does not support legacy attribute
'can_dlc', making 'len' mandatory for incoming CAN FD support in RIOT.

	struct canfd_frame {
		canid_t can_id;  /* 32 bit CAN_ID + EFF/RTR/ERR flags */
		__u8    len;     /* frame payload length in byte */
		__u8    flags;   /* additional flags for CAN FD */
		__u8    __res0;  /* reserved / padding */
		__u8    __res1;  /* reserved / padding */
		__u8    data[CANFD_MAX_DLEN]
__attribute__((aligned(8)));
	};

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:22 +01:00
mguetschow
57993ef263
Merge pull request #21159 from Vjorald/cord-doc
sys/cord/doc.txt: Update additional references to RFC 9176
2025-01-29 14:57:08 +00:00
Vjorald
d2658e21d0 sys/cord/doc: Update additional references to RFC 9176 2025-01-29 15:14:03 +01:00
mguetschow
d3676ca5e6
Merge pull request #20942 from benpicco/sys/chunked_ringbuffer-return_size
sys/chunked_ringbuffer: let `crb_end_chunk()` return size of the chunk
2025-01-29 13:09:31 +00:00
Benjamin Valentin
3429621911 sys/chunked_ringbuffer: let crb_end_chunk() return size of the chunk 2025-01-29 11:54:08 +01:00
Marian Buschsieweke
9fa2661621
sys/net/nanocoap: align request handling with spec
- Do not reply with a reset message to a reset or an ACK message
- Reply with a reset message when not able to process a CON/NON message
  (not even a suitable error reply)
2025-01-24 22:42:47 +01:00
Marian Buschsieweke
28caf32e98
sys/tiny_strerror: fix compilation with picolibc on Ubuntu
The picolibc shipped in Ubuntu does not provided non-POSIX errnos
by default. If the errno codes are not provided, we can also not
provide corresponding strings.

This guards the effected strings corresponding to non-POSIX errnos
behind `#ifdef`, so that they are only provided when the corresponding
errno is.
2025-01-24 12:05:00 +01:00
benpicco
139404df35
Merge pull request #21147 from maribu/sys/net/nanocoap/observe
sys/net/nanocoap: Implement Observe (Server-Side)
2025-01-23 15:49:26 +00:00
Marian Buschsieweke
feeb68470f
sys/net/nanocoap: implement observe
This adds the new `nanocoap_server_observe` module that implements the
server side of the CoAP Observe option. It does require cooperation
from the resource handler to work, though.

Co-Authored-By: mguetschow <mikolai.guetschow@tu-dresden.de>
Co-authored-by: benpicco <benpicco@googlemail.com>
2025-01-23 14:25:39 +01:00
Marian Buschsieweke
1c7ba9e055
sys/net/nanocoap: improve separate response handling
This allows sending a separate response with CoAP Options and adds a
helper to detect duplicate requests, so that resource handlers can
repeat their empty ACK on duplicates.
2025-01-23 14:25:02 +01:00
Benjamin Valentin
2374b9e2f1 gnrc/ipv6/nib: deprecate CONFIG_GNRC_IPV6_STATIC_LLADDR_IS_FIXED
This should just be the only behavior of CONFIG_GNRC_IPV6_STATIC_LLADDR.
2025-01-23 13:32:45 +01:00
Benjamin Valentin
28016ee416 gnrc/ipv6/nib: make CONFIG_GNRC_IPV6_STATIC_LLADDR_IS_FIXED the default
The auto-increment is very surprising and no actual use-cases for it are known.
2025-01-23 13:32:31 +01:00
Joshua DeWeese
9b2782d020
Merge pull request #21126 from maribu/sys/net/gnrc_sock/drop-timer-workaround
Revert "sock/udp: work around gnrc_sock_recv() returning early timeout"
2025-01-20 11:58:08 +00:00
Kevin "Tristate Tom" Weiss
8302223ba1
Merge pull request #21137 from benpicco/gnrc_netif_ipv6_wait_for_global_address-fix_timeout
gnrc_netif: fix timeout in `gnrc_netif_ipv6_wait_for_global_address()`
2025-01-20 10:03:17 +00:00
benpicco
cefa182d2b
Merge pull request #21080 from benpicco/gnrc_ipv6_auto_subnets_eui
gnrc/ipv6_auto_subnets: add option to derive subnet prefix from EUI
2025-01-16 17:19:54 +00:00
Benjamin Valentin
a95bd508a5 gnrc_netif: fix timeout in gnrc_netif_ipv6_wait_for_global_address() 2025-01-16 16:07:40 +01:00
Teufelchen
e09a800978
Merge pull request #21133 from chrysn-pull-requests/rust-updates
treewide: Update Rust dependencies
2025-01-14 11:39:47 +00:00
benpicco
6547f144d9
Merge pull request #21125 from maribu/sys/net/gcoap/fix-api-abuse
sys/net/gcoap: get rid of API abuse
2025-01-13 18:43:16 +00:00
chrysn
5d7bff869b treewide: Update riot-sys
This pulls in the changes of [144].

[144]: https://github.com/RIOT-OS/rust-riot-wrappers/pull/144
2025-01-13 18:49:18 +01:00
Benjamin Valentin
698d414733 gnrc/ipv6_auto_subnets: add gnrc_ipv6_auto_subnets_eui 2025-01-13 15:52:25 +01:00
chrysn
ee5e794341 treewide: Update Rust dependencies 2025-01-13 13:33:33 +01:00
chrysn
f1c34a275b treewide: Update riot-wrappers and riot-sys 2025-01-13 13:19:13 +01:00
Marian Buschsieweke
590ca5d7ff
sys/net/gcoap: get rid of API abuse
Calling `coap_get_token()` and `coap_get_token_length()` on an
(mostly) uninitialized `coap_pkt_t` did work so far due to
implementation details matching the expectations, but this is not
backed up by any API contract.

This fixes the API abuse by introducing and using a new API that does
read a token and token length from a CoAP over UDP packet out of a
buffer. This now provides the behavior expected by the caller and
commits to it via API contract.

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
Co-authored-by: benpicco <benpicco@googlemail.com>
2025-01-10 21:31:08 +01:00
Marian Buschsieweke
c562b6cbe9
Revert "sock/udp: work around gnrc_sock_recv() returning early timeout"
This reverts commit e3d00682bcad2e0f26ee15b1c73d5da022b18786, which
added a work around for two bugs:

- ztimer triggering too early (fixed in
  https://github.com/RIOT-OS/RIOT/pull/20924)
- gnrc_sock_recv() returning when an old "timeout" message is still
  in the message queue (fixed in
  https://github.com/RIOT-OS/RIOT/pull/21113)

With those bugs fixed, the work around should not longer be needed.
2025-01-10 21:25:34 +01:00
Benjamin Valentin
64c10f33a1 gnrc/ipv6_auto_subnets: unicast RA if upstream is 6lo 2025-01-10 18:56:42 +01:00
Marian Buschsieweke
ade999ab01
Merge pull request #21113 from maribu/sys/ztimer/ztimer_mbox_get_timeout
sys/ztimer: implement ztimer_mbox_get_timeout() and use it to fix race in gnrc_sock_recv()
2025-01-10 15:37:46 +00:00
Marian Buschsieweke
56ea5cd3d0
sys/net/gnrc_sock: fix race in gnrc_sock_recv()
Implement the timeout using ztimer_mbox_get_timeout() to fix a race
condition.
2025-01-10 16:19:00 +01:00
benpicco
758a92f6f0
Merge pull request #21085 from crasbe/pr/sys/stdio_nimble
sys/stdio_nimble: add version note to README
2025-01-08 08:52:52 +00:00