Commit graph

581 commits

Author SHA1 Message Date
Cristian Bulacu
b3cc778c87 drivers: ieee802154: update mcxw ieee802154 driver
Updated driver based on changes done in SDK 25.06.00-pvw2.
Update hal_nxp to include BLE LL and IEEE 802.15.4 PHY NBU
combo firmware for MCXW72 boards.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-06-12 09:34:16 -07:00
Cristian Bulacu
5cf2d4585e drivers: ieee802154: Fix resolution in mcxw_get_time function.
Updated mcxw_get_time function to output its result in nanosecond
resolution and updated code accordingly.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-06-12 09:34:16 -07:00
Vincent van der Locht
a06ded8db6 drivers: ieee802154: added raw mode to mcxw ieee802154 driver
Add support for raw mode of mcxw ieee802154 driver.

Signed-off-by: Vincent van der Locht <vincent@synchronicit.nl>
2025-05-29 23:25:41 +02:00
Andrei Menzopol
137199b19f drivers: ieee802154: fix mcxw ieee802154 driver
Fix mcxw_cca function.
Remove not used / not implemented caps.
Select counter as dependency.

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>
2025-05-27 09:16:04 +02:00
Alexandre Bailon
db496c7a76 drivers: ieee802154: cc13xx_cc26xx: Don't filter beacon for OpenThread
OpenThread network discovery was not working.
The radio driver is filtering the beacon packets whereas
this is required for OpenThread.
Allow receiving beacon packets.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
2025-05-13 22:20:55 -04:00
Alexandre Bailon
c1bce30fe5 drivers: ieee802154: cc13xx/26xx: Add support of 802.15.4 ED Scan
This adds support of ED scanning to cc13xx/cc26xx.
This could be required to select the least busy channel
or to found neighboring networks.

Note:
Although the scanning is working, OpenThread still fails
to discover OpenThread networks.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
2025-04-28 12:54:59 -05:00
Damian Krolik
1e64c29ac3 drivers: ieee802154: nrf5: support reading EUI64 from UICR on nRF54L
Extend the existing code for reading EUI64 from UICR to
support nRF54L SoC series as well.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2025-04-28 16:41:23 +02:00
Benjamin Cabé
9dd1dbbbc6 drivers: ieee802154: fix spelling of "written"
s/writen/written/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-21 11:41:46 +00:00
Andrei Menzopol
f7167ed606 drivers: ieee802154: add mcxw ieee802154 driver
Add mcxw ieee802154 driver
Fix compliance errors for added files.
Update function names to snake_case style.

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>
2025-02-14 03:08:48 +01:00
Tom Hughes
5bb029893e drivers: ieee802154: Remove unused function
Building with clang warns:

drivers/ieee802154/ieee802154_dw1000.c:277:24: error: unused function
'dwt_reg_read_u16' [-Werror,-Wunused-function]
static inline uint16_t dwt_reg_read_u16(const struct device *dev,
                       ^

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-12 07:52:18 +01:00
Martin Jäger
2a95996a03 drivers: ieee802154: nrf5: cast payload ptr to void for debug output
Without this fix I get an MPU fault in samples/net/openthread/shell/
with CONFIG_IEEE802154_DRIVER_LOG_LEVEL_DBG=y.

Related commit: a7224830ce

Signed-off-by: Martin Jäger <martin@libre.solar>
2025-01-14 13:26:47 +01:00
Martin Jäger
6046368e59 drivers: ieee802154: unify FCS configuration in L2 packet
Use the same Kconfig for all drivers to configure if the FCS bytes
(checksum) should be included in the packets passed to L2.

The description is slightly reworded to make clear that it does not
only affect the length, but the packet content itself.

Signed-off-by: Martin Jäger <martin@libre.solar>
2025-01-07 11:52:51 +01:00
Martin Jäger
9d3d67d3d1 drivers: ieee802154: b91: fix status variable type in RX ISR
The status variable stores the return value of `net_recv_data`, which
is an `int` and may be negative.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-12-30 19:47:05 +01:00
Pieter De Gendt
45be45d7e0 drivers: crypto: Place API into iterable section
Add wrapper DEVICE_API macro to all crypto_driver_api instances.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-06 12:13:37 +01:00
Przemyslaw Bida
63e1bb41b1 net: openthread: Add modcarrier command to OT diag module.
Commit add `modcarrier` shell command for Openthread diagnostic mode.
Command can transmit modulated carrier out of device for test purposes.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2024-12-04 12:10:11 +01:00
Przemyslaw Bida
e0f94f8823 drivers: ieee802154: New API for modulated carrier wave transmission.
Added new API function to start modulated carrier wave transmission

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2024-11-29 21:46:46 +01:00
Damian Krolik
8ce12aaa04 net: openthread: add wake-up coordinator support
Add Kconfig option `OPENTHREAD_WAKEUP_COORDINATOR` to enable
the Wake-up Coordinator role. Implement API to set Coordinated
Sampled Transmitting sample time and period for a driver that supports
`IEE802154_OPENTHREAD_HW_CST` capability.

The feature is be enabled on with ieee802154_nrf5 driver with option
by setting default value of CONFIG_IEEE802154_NRF5_CST_ENDPOINT.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Co-authored-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-11-16 15:09:07 -05:00
Damian Krolik
c9dbce36c0 drivers: ieee802154_nrf5: cabability IEE802154_OPENTHREAD_HW_CST
The new Kconfig option `IEEE802154_NRF5_CST_ENDPOINT` is added.
When it is enabled, then capability `IEE802154_OPENTHREAD_HW_CST`
is supported by the ieee802154_nrf5 driver and allows to set the
CST period and CST expected transmission time point.
This feature is an OpenThread-specific extention to the
ieee802154_nrf5 driver.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Co-authored-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-11-16 15:09:07 -05:00
Damian Krolik
502c9ffb32 drivers: ieee802154_nrf5: skip Enh Ack conf for invalid short address
If the invalid short address (0xfffe) is specified,
configure the Enhanced Ack just for the extended address.
This is needed because Header IEs for Enhanced Ack must be
configured before the short address has been assigned to
the child.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2024-10-31 09:24:03 -05:00
Andrzej Kuros
30c449d9e6 drivers: ieee802154_nrf5: support IEEE802154_SELECTIVE_TXCHANNEL
The ieee802154_nrf5 supports the IEEE802154_SELECTIVE_TXCHANNEL
Kconfig option and advertises the IEEE802154_HW_SELECTIVE_TXCHANNEL
capability.
The ieee802154_nrf5 driver now allows to schedule timed transmission
requests with selective tx channel, that is set at the latest
possible moment. This improves reception performance when the
timed transmissions are requested.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-10-22 14:04:33 +02:00
Andrzej Kuros
2fbba82591 drivers: ieee802154: add Kconfig IEEE802154_SELECTIVE_TXCHANNEL
The Kconfig `IEEE802154_SELECTIVE_TXCHANNEL` is added along with
the new capability `IEEE802154_HW_SELECTIVE_TXCHANNEL`.
The new capability of the ieee802154 drivers allows to schedule
CSL transmissions as stated in IEEE 802.15.4-2020 chapter 6.12.2.7
CSL over multiple channels. The benefit of the new API is that
additional call to `ieee802154_radio_api::set_channel()` is not
required. The drivers will switch to the new channel as late as
possible for CSL transmissions thus will not interrupt any reception
that might be in progress until the very late moment when the
transmission actually starts.
This improves reception performance when CSL transmissions are used.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-10-22 14:04:33 +02:00
Florian Grandel
f55cf43ddf drivers: ieee802154: ieee802154_uart_pipe: replace magic number
Replaces a magic number by the appropriate definition.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-09-29 21:20:20 +02:00
TOKITA Hiroshi
a88ee692b9 drivers: ieee802154: mcr20a: Specify the dependency on HAL_MCUX
The mcr20a driver referencing `MCR20Overwrites.h` which is under
`hal/nxp/mcux`.

So, put `depends HAS_MCUX` for clarify the dependency.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-09-19 15:14:06 +02:00
Alexandre Bailon
3341298c0c drivers: ieee802154: cc13xx_cc26xx: Enable support of OpenThread L2
This updates the driver to enable support of OpenThread L2.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
2024-09-18 15:32:09 +02:00
Alexandre Bailon
f44072c299 drivers: ieee802154: cc13xx_cc26xx: Fixup a bus error
Sometime, the radio causes a bus error.
This happens because we cast a struct and access to a member
that doesn't exists in the original struct.
This updates the driver to use the right struct to make the cast safe.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
2024-09-18 15:32:09 +02:00
Pieter De Gendt
ad63ca284e kconfig: replace known integer constants with variables
Make the intent of the value clear and avoid invalid ranges with typos.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-27 20:49:15 +03:00
Jordan Yates
91f8c1aea9 everywhere: replace #if IS_ENABLED() as per docs
Replace `#if IS_ENABLED()` with `#if defined()` as recommended by the
documentation of `IS_ENABLED`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-28 07:20:32 -04:00
Yong Cong Sin
c9d08fc876 driver: ieee802154: remove deprecated Kconfigs
The following Kconfigs have been deprecated for more than 2
releases, remove them:

- `IEEE802154_CC13XX_CC26XX_SUB_GHZ_RADIO_TX_RETRIES`
- `CONFIG_IEEE802154_2015`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Ayush Singh
cab48b0743 ieee802154: ieee802154_cc13xx_cc26xx_subg: Fix tcp timeout
- If status == PROP_ERROR_RXBUF, that means rx buffer head is not empty.
  In case of this, RF_EventRxEntryDone is never triggered and thus we
  enter an infinite loop of nothing happening. Due to this, TCP socket
  times out.
- To fix this, we need to free rx buffer current head. However, it seems
  better to free all the elements that are already finished instead of
  just head.
- Before 128354ae17, the buffer was reset
  every time drv_rx_start was called. However, that also seems wrong for
  a ring buffer. So I am freeing the finished buffers instead.
- Tested on Beagleconnect Freedom.
- Fixes https://github.com/zephyrproject-rtos/zephyr/issues/71191

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-06-13 20:18:12 -04:00
Piotr Koziar
9037a708ee drivers: ieee802154_nrf5: Use BLE.ADDR instead of FICR to create EUI64.
Use BLE.ADDR to create unique (to some extent) EUI64
on nRF54H20 in some cases inside the IEEE 802.15.4 driver.

The amount of EUI64-s available in such a way is very limited
(~16 million).
However, currently there does not seem to be another feasible way to
get device identifiers on nRF54H20 (such are kept in SICR, to which the
radio core has no access).

Signed-off-by: Piotr Koziar <piotr.koziar@nordicsemi.no>
2024-06-10 15:00:01 +03:00
Eduardo Montoya
01b0d8736e drivers: ieee802154: nrf5: sleep if idle when RxOnWhenIdle=0
When RxOnWhenIdle is set to False, turn the radio off
if no operation is ongoing in order to save power.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2024-06-01 10:25:31 +02:00
Jędrzej Ciupis
b457645423 drivers: ieee802154: nrf5: fix default value for nRF54H20
The default value of IEEE802154_NRF5_DELAY_TRX_ACC Kconfig option is
based on a symbol that is undefined for nRF54H20. It evaluates as empty,
which leads to compilation errors with very cryptic logs.

This commit assures that a sane value for IEEE802154_NRF5_DELAY_TRX_ACC
is selected at all times, avoiding the compilation errors.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-05-13 10:21:08 +02:00
Jędrzej Ciupis
774dd16555 drivers: ieee802154: gracefully handle invalid Ack timestamp
The nRF IEEE 802.15.4 driver might report a received Ack frame with
invalid timestamp, if the timestamp could not have been taken. The upper
layers are not prepared to handle such a case as they expect that for a
received frame, the timestamp is always present and valid.

This commit detects this situation and handles it gracefully by
reporting the transmission as failed as if no Ack was received.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-04-09 07:37:10 -04:00
Fin Maaß
9e8e21b36f drivers: ieee802154: use sys_rand_get directly
use sys_rand_get() directly.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-04-05 12:28:46 +02:00
Georgios Vasilakis
7a8d454e22 soc: nordic: Refactor soc_secure.h
The soc_secure_* function are used by the non-secure application
to access hardware resources which are mapped as secure.
Using these functions for hardware resources mapped as non-secure
is missleading.

We have some soc_secure_* functions which read FICR values.
In nRF91 and nRF53 platforms this made sense since FICR
has hardware fixed mapping as secure.
For nRF54 though the FICR has hardware fixed mapping as non-secure.

This change refactors the soc_secure.h to exclude the functions
which read FICR values from being included when FICR is mapped as
non-secure.

Also updates the hwinfo and ieee802154 drivers to adjust to this change.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
2024-04-04 13:17:13 -05:00
Andrzej Kuros
8e8d4af6c1 drivers: ieee802154_nrf5: Use Radio IRQ number from DT
Used RADIO_IRQ number is based on information provided by DT rather
than direct use of RADIO_IRQn.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
2024-03-05 12:22:08 +01:00
Tomasz Bursztyka
af85c8a11d drivers/ieee802154: Use net_pkt API for reading data on upipe driver
Some legacy left overs.
Just simplifying how to read data into a net_pkt.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2024-03-01 15:33:53 +01:00
Ayush Singh
7c9dbde659 ieee802154: ieee802154_cc13xx_cc26xx_subg: Fix 6lowpan for cc1352p7
- Fix using custom setup function
- Enable pRegOverrideTxStd and pRegOverrideTx20 in
  ieee802154_cc13xx_subg_radio_div_setup struct

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-02-17 21:14:30 +01:00
Maciej Baczmanski
dbe74b3299 Revert "drivers: ieee802154: nrf: cache radio channel"
This reverts commit 780b12854c.
"drivers: ieee802154: nrf: cache radio channel"

Implementation affected RCP devices in openthread as MAC layer
does not call `Receive()` functions after transmit is done.

Additionally, after sending a frame to a new channel (for example
while discovery operation), radio switches to RX state immediately
after TX, but continues to listen on old channel for about 5ms,
until MAC layer calls `Receive` operation, forcing to change the
channel.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-02-07 15:35:29 +00:00
Maciej Baczmanski
0f1747e4e7 net: openthread: upmerge to 7761b81
additionaly, implement `otPlatRadioResetCsl` functionality

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-01-26 10:48:02 +01:00
Maciej Baczmanski
d76bcd346c drivers: ieee802154: fix ACK header IE implementation
- In `set_vendor_ie_header_lm`, case when
`link_metrics_data_len == 0` has been ignored.
This commit fixes that by setting `header_ie->length = 0`
before returning.
- current implementation of enh ACK header IE returns
`-ENOTSUP` when `ack_ie.header_ie == NULL` or
`ack_ie.header_ie->length == 0`. This commit fixes that by
refactoring checks in `nrf5_configure`.

Co-authored-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-01-26 10:48:02 +01:00
Jędrzej Ciupis
8f9a86cf5e drivers: ieee802154: fix nRF5 Rx error handling
The current implementation implicitly assumes that if the device is
configured to have the capability of acting as a CSL endpoint then in
case a delayed reception with matching ID finishes with a timeout no
action is needed. This assumption is correct when RxOnWhenIdle mode is
disabled because the transition to sleep is done automatically by the
driver below. However, it's wrong when RxOnWhenIdle is enabled. This
commit fixes that case by adding a call to event handler that notifies
the higher layer about the event and allows it to transition to RxOff if
needed.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-01-19 07:25:43 -06:00
Gerard Marull-Paretas
87bb281a9f drivers: ieee802154: b91: add missing PLIC include
Driver was using RISC-V PLIC API without including the necessary
headers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-15 09:58:03 +01:00
Pisit Sawangvonganan
80e1482ddd drivers: ieee802154: set 'ieee802154_radio_api' as 'static const'
This change marks each instance of the 'api' as 'static const'.
The rationale is that 'api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-01-05 09:04:28 +01:00
Eduardo Montoya
586eca8ad2 drivers: ieee802154: nrf5: add IEEE802154_RX_ON_WHEN_IDLE capability
Add `IEEE802154_RX_ON_WHEN_IDLE` capability.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2024-01-05 09:04:17 +01:00
Eduardo Montoya
780b12854c drivers: ieee802154: nrf: cache radio channel
Cache configured radio channel and apply them only when a relevant
radio task is requested.

This allows to configure the channel in the transmit metadata, thus
avoiding unneeded `nrf_802154` API calls in some scenarios.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-01-05 09:04:17 +01:00
Eduardo Montoya
5767998d4f drivers: ieee802154: nrf: make selective tx power the default
Remove `IEEE802154_SELECTIVE_TXPOWER` option.

Cache the tx power value in nRF5 driver and make use of it on each
operation.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-01-05 09:04:17 +01:00
Jędrzej Ciupis
7afeb62e20 drivers: ieee802154: support Key Identifier Mode > 1
IEEE 802.15.4-2020 defines four possible values for Key Identifier Mode
field of the Auxiliary Security Header. The current ieee802154 driver
API only supports two of them: b00 and b01. This commit adds support for
the two remaining Key Identifier Mode values. It's done by replacing a
field that can only hold Key Index into a field that can holds a pointer
to the entire Key Identifier field.

See IEEE 802.15.4-2020, sections 9.4.2.3 and 9.4.4 for further reference.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-12-13 13:57:24 +01:00
Jędrzej Ciupis
0bad09c7fa drivers: ieee802154: nrf5: support raw mode
When CONFIG_IEEE802154_RAW_MODE is set there is no network interface
that could provide pointer to the device the interface is running on top
of. The current implementation of nRF5 ieee802154 driver implicitly
assumes that such an interface is always present, which leads to crashes
when raw mode is enabled.

This commit adds support for IEEE802154_RAW_MODE in nRF5 ieee802154
driver by latching pointer to the ieee802154 device on initialization if
needed so that it doesn't have to be retrieved using the network
interface in run-time.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-11-24 09:25:11 +01:00
Jamie McCrae
90dfbf99d8 drivers: ieee802154: nrf5: Fix missed variable rename
Fixes and issue with a variable that has been renamed but whose
reference in the source file has not

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-22 09:54:23 +01:00