1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-15 01:23:49 +01:00

47148 Commits

Author SHA1 Message Date
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
Martine Lenders
b9c63f6e24
Merge pull request #21191 from miri64/examples/fix/gnrc_pktdump_dep
examples/default: fix dependency modeling
2025-02-05 11:09:19 +00:00
Martine Lenders
64756e4428
examples/default: fix dependency modeling 2025-02-05 11:51:02 +01:00
Martine Lenders
3445cdc0ff
Merge pull request #21118 from OlegHahm/pr/feature/ia_na_for_6lbr
Request temporary address (IA_NA) for the 6lbr example
2025-02-05 10:20:27 +00:00
benpicco
77a1e2e622
Merge pull request #21185 from maribu/cpu/esp_common/flash-file-size-fix
cpu/esp_common: create partitions.csv more robustly
2025-02-04 18:43:51 +00:00
Marian Buschsieweke
423e5ad690
cpu/esp_common: create partitions.csv more robustly
The generated `partitions.csv` needs to state the size of the flash
file. This so far used `ls -l | awk '{print $5}'` to achieve that, but
that is not robust, as the columns of `ls -l` depend on the tool and
system configuration used.

This commit replaces the call with `wc -c`, which should be more robust,
as `wc -c` behavior is POSIX specified.

Co-Authored-By: Karl Fessel <karl.fessel@ml-pa.com>
Co-Authored-By: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2025-02-04 17:51:12 +01:00
Marian Buschsieweke
fb8d9e3321
Merge pull request #21189 from MrKevinWeiss/pr/updatereleasenotes
release-notes.txt: add 2025.01 release notes
2025-02-04 16:26:33 +00:00
MrKevinWeiss
7d70b0c235
release-notes.txt: add 2025.01 release notes 2025-02-04 17:19:45 +01:00
Dylan Laduranty
c81a103a96
Merge pull request #21188 from maribu/doc/periph_i2c_spi_init
drivers/periph_{i2c,spi}: fix doc on initialization
2025-02-04 12:05:35 +00:00
Marian Buschsieweke
a82573558d
drivers/periph_{i2c,spi}: fix doc on initialization
Both SPI and I2C peripheral drivers *MUST NOT* be initialized by the
application code / (non-peripheral) device driver, as this is done
automatically be default. Some peripheral drivers have a non-idempotent
initialization and initializing them twice will break things.

Sadly, the doc states the exact opposite.

This updates the documentation to match the implementation. In addition
the special case is pointed out of disabling the automatic
initialization during boot, in which case the app indeed has to do the
initialization.
2025-02-04 09:22:40 +01:00
Marian Buschsieweke
2416dc3efd
Merge pull request #21128 from basilfx/bmp-auto-detect
dist/tools/bmp: additional improvements to auto-detection
2025-02-02 22:13:31 +00:00
Bas Stottelaar
b27eb50a19 dist/tools/bmp: detect unsupported targets
Instead of listing 'no targets found', detect unsupported targets as
well. Once we need to attach, assert that the target is supported.

Starting with firmware 2.0.0 of the BMP, not all targets are supported
by defaults (depends on the firmware flavor). Adding support for this
case therefore makes sense.
2025-02-02 23:10:23 +01:00
Bas Stottelaar
b07f32d2ab dist/tools/bmp: improve auto-detection of firmware
Parse the version number from the product description as returned by
libusb. This works for stable firmware releases, and ensures that
older firmwares work out of the box.
2025-02-02 23:10:23 +01:00
Bas Stottelaar
7a1128fb4a dist/tools/bmp: use f-strings in stead of interpolation 2025-02-02 23:10:22 +01:00
Bas Stottelaar
3d3f0f9623 dist/tools/bmp: set argument type 2025-02-02 23:10:22 +01:00
Marian Buschsieweke
c5d23ba5fb
Merge pull request #20411 from OlegHahm/pr/tapsetup_dhclient_nowait
dist: tools: avoid hanging tapsetup in the absence of a DHCP server
2025-02-02 18:32:05 +00:00
Marian Buschsieweke
8665ba932e
Merge pull request #21181 from maribu/cpu/samd5x/can-fix-rx
cpu/samd5x/periph_can: fix RX
2025-02-01 13:23:41 +00:00
Marian Buschsieweke
c48525fc4e
cpu/samd5x/periph_can: fix RX
CAN required CLK_CANx_APB and CLK_CANx_APB to be running and will not
request any clock by itself. We can ensure both clocks to be running
by preventing the MCU from entering IDLE state.

The SAMD5x/SAME5x Family Data Sheet says in Section
"39.6.9 Sleep Mode Operation" says:

> The CAN can be configured to operate in any idle sleep mode. The CAN
> cannot operate in Standby sleep mode.
>
> [...]
>
> To leave low power mode, CLK_CANx_APB and GCLK_CANx must be active
> before writing CCCR.CSR to '0'. The CAN will acknowledge this by
> resetting CCCR.CSA = 0. Afterwards, the application can restart CAN
> communication by resetting bit CCCR.INIT.

tl;dr: At most SAM0_PM_IDLE is allowed while not shutting down the CAN
controller, but even that will pause communication (including RX).

Apparently, the CAN controller was never tested without also using the
USB peripheral, which kept the clocks running as side effect.
2025-02-01 14:13:42 +01:00
mguetschow
775f59623d
Merge pull request #21070 from chrysn-pull-requests/own-cosy
tools: Use RIOT maintained cosy
2025-01-31 13:24:02 +00:00
chrysn
4201f4f09f tools: Use RIOT maintained cosy 2025-01-31 14:13:01 +01:00
dylad
193390bbdd cpu/sam3: optimize gpio ISR processing
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
2025-01-31 10:24:34 +01:00
Alexandre Abadie
500a0f3ad6
Merge pull request #21177 from dylad/pr/cpu/sam3/fix_hwrng_reg_access
cpu/sam3: fix hwrng peripheral register access
2025-01-31 08:47:36 +00:00
Dylan Laduranty
6d641ffcf5 cpu/sam3: fix hwrng peripheral register access
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2025-01-30 20:59:09 +01:00
Dylan Laduranty
529a1e4d73
Merge pull request #21172 from benpicco/cpu/sam0_common/eth-hang
cpu/sam0_eth: fix hang with broken PHY
2025-01-30 13:02:45 +00:00
Benjamin Valentin
c791ff278f cpu/sam0_eth: fix hang with broken PHY 2025-01-30 11:16:18 +01:00
mguetschow
287324cc42
Merge pull request #21171 from mguetschow/shell-commands-xfa
examples: migrate to XFA SHELL_COMMAND
2025-01-30 09:05:37 +00:00
Oleg Hahm
63a8f46d9e examples/gnrc_border_router: request temp address
Additionally to requesting a delegated prefix via DHCPv6 this also
enables to ask for a temporary (non-permanent) address on the 6lbr. If
the upstream DHCP server provides one, this can be used to establish
end-to-end connectivity from the 6lbr towards an Internet host directly.
2025-01-29 22:57:09 +01:00
Gilles DOFFE
0bf08aa89b tests/conn_can: make test support CAN FD
Increase Shell buffer size for 64 bytes payload length of CAN FD frame.
This also implies to increase main thread stack size and especially for
native architectures.
Add two new sub-commands to test_can command:
* fdsend: to send a CAN FD frame
* fdsendrtr: to send a CAN FD RTR frame (payload length = 0).

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +01:00
Gilles DOFFE
38ea423a8a boards/nucleo-g431rb: enable periph_can
Enable periph_can to add CAN FD support to nucleo-g431rb.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +01:00
Gilles DOFFE
f5ee91d357 cpu/native: enable CAN FD support
As CAN FD is already supported by SocketCAN on Linux, just enable the
fdcan pseudomodule and allow CAN FD frames.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +01:00
Gilles DOFFE
5d48376a21 cpu/stm32: add FDCAN support to STM32G4 family
Until now, STM32 MCUs classic CAN support is coded in can.c file.
However CAN FD in STM32G4 family is designed in a very different way:
* CAN FD channels are independant
* CAN FD channel configuration is done in a dedicated RAM block called
  message RAM, with one message RAM per channel
* Each message RAM is divided this way:
  - 11-bit filter (28 elements / 28 words)
  - 29-bit filter (8 elements / 16 words)
  - Rx FIFO 0 (3 elements / 54 words)
  - Rx FIFO 1 (3 elements / 54 words)
  - Tx event FIFO (3 elements / 6 words)
  - Tx buffers (3 elements / 54 words)

Due to these design differences with other STM32 MCUs, the choice is
made to split the driver in two files:
* classiccan.c for STM32 MCUs that support classical CAN. This file
  has just been renamed (previously can.c) to avoid build conflicts
  but does not introduce changes
* fdcan.c for STM32 MCUs that support CAN FD

Message RAM definitions is not provided in CMSIS headers of the STM32G4
family, they are defined in fdcandev_stm32.h. Those definitions could be
extracted to a new file for each STM32 families as some differences
exist with other STM32 families that support CAN FD (for instance
STM32H7). This could be done in a futher commit, according to new
families requirements.

CAN hardware parameters stay similar and are kept in can_params.h.

There are 36 filters per channel:
* 28 first filters are standard ID (11 bit) filters
* 8 last filters are extended ID (29 bit) filters

On each Tx frame sent, the STM32G4 can store Tx events in a dedicated
FIFO. This feature is not yet implemented and Tx event FIFO is disabled
by default.
Automatic retransmission on arbitration loss is enabled by default by
the STM32G4.

About Rx, if no filter is configured, all frames are accepted by
default.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:23 +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
b55f269d17 makefiles: introduce fdcan pseudomodule
This pseudomodule is used to enable code depending on CAN FD support.

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:22 +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
Mikolai Gütschow
8f5f268d99
examples: migrate to XFA SHELL_COMMAND 2025-01-29 13:54:01 +01:00
Benjamin Valentin
3429621911 sys/chunked_ringbuffer: let crb_end_chunk() return size of the chunk 2025-01-29 11:54:08 +01:00
mguetschow
f097c89638
Merge pull request #21138 from mguetschow/psa-cc310-dma-check
pkg/driver_cryptocell_310: check for input data to be in RAM
2025-01-29 10:31:22 +00:00
Mikolai Gütschow
36aafd4d03
pkg/driver_cryptocell_310: require all data to be in RAM
as documented on https://docs.nordicsemi.com/bundle/ps_nrf52840/page/cryptocell.html\#ariaid-title14
2025-01-29 11:21:34 +01:00
Martine Lenders
2e40d92164
Merge pull request #21117 from OlegHahm/pr/feature/enable_dns_in_6lbr_by_default
Configure default DNS resolver in 6lbr example
2025-01-28 20:26:36 +00:00
mguetschow
5ebef09e55
Merge pull request #21170 from miri64/doc/enh/RIOT_FILE_RELATIVE
doc: add documentation on RIOT_FILE_RELATIVE
2025-01-28 20:24:24 +00:00
Mikolai Gütschow
ee23dedf77
tests/sys/psa_crypto_hashes: place input data in RAM, test larger input 2025-01-28 21:07:46 +01:00
Mikolai Gütschow
41766e168d
tests/sys/psa_crypto_{ecdsa,mac}: place input data in RAM 2025-01-28 21:07:46 +01:00
Mikolai Gütschow
17915037b8
examples/psa_crypto: place input data in RAM 2025-01-28 21:07:45 +01:00
Martine Lenders
e2f43682b2
doc: add documentation on RIOT_FILE_NOPATH 2025-01-28 20:58:48 +01:00
Martine Lenders
9e1437910f
doc: add documentation on RIOT_FILE_RELATIVE 2025-01-28 20:42:41 +01:00