Commit Graph

273 Commits

Author SHA1 Message Date
Alberto Escolar Piedras 2947109e8d nrfx ppib: Strict C compliance warning waive
Enumerate values need to fit in the range of
int if we are to be strictly standad compliant.
But for this emum in question, its highest value
is generated from a bitmask of the 31st bit,
which, as a possitive number is out the int range.

This can cause warnings for compilers
which are run in a pedantic enough mode.
GCC is one of this, producing a warning like:
"warning: ISO C restricts enumerator values to range of ‘int’"
when run with "-Wpedantic"
Let's disable these warnings for this enum definition
when building for GCC.
Apart from this warning, GCC seems to properly handle this case.

Note that as this definition is in a header, the issue is triggered
when users try to compile their code with the corresponding warnings
enabled.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-24 12:09:29 +02:00
Krzysztof Chruściński bdef8b66d5 nrfx: hal: nrf_cache: Add nrf_cache_lineaddr_get
Add function for getting LINEADDR register content.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-23 11:59:13 +02:00
Alberto Escolar Piedras 827224f29e haly grtc: Use appropriate static inline macro
Use the NRFY static inline macro for the nrfy code,
so this code works properly for simulation too.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-19 14:09:47 +02:00
Krzysztof Chruściński f8e4d73a78 nrfx: drivers: nrfx_uarte: Add event clearing after RX disable
Clear RX events after blocking wait for RX disable.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-19 10:07:05 +02:00
Krzysztof Chruściński 729169433a mdk: nrf54l15: Fix UARTE MAXCNT value
MDK has a bug and indicates that UARTE DMA transfer length is
limited to 8 bits when it should be 16.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-19 10:07:05 +02:00
Krzysztof Chruściński 04f0829708 nrfx_uarte: Fix race condition and optimize isr
If interrupt was executed exactly when ENDRX occurred it is possible

that RXSTARTED (which is read before ENDRX) is read as false but it
actually occurred (if there is a linked reception). It must be read
again to ensure that it is handled in the same interrupt call.
Otherwise there is a risk that on next interrupt it will be too late
to handle it.

Additionally, Read int mask only once in the irq handler to reduce
time spent in the handler.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-19 10:07:05 +02:00
Nikodem Kastelik fc2bab706f nrfx: fix support for nRF54 Series in the PWM HAL
MAXCNT register as well as LOOPSDONE-SEQSTART[n] shortcut
are present on nRF54 Series, but under different names.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-04-08 14:31:52 +02:00
Nikodem Kastelik 37e11ef2ae nrfx: mdk: fix PWM peripheral description for nRF54 Series
SEQSTART[n] tasks are on different offset.
LOOPSDONE_SEQSTART[n] short is missing.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-04-08 14:31:52 +02:00
Krzysztof Chruściński 7803a3e6b6 hal: nrf_common: Fix address checking in nrf_dma_accessible_check
Function was not covering whole DMA capable regions.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-03 10:42:48 +02:00
Nikodem Kastelik 13ac55b5b5 nrfx: Update to version 3.4.0
Update nrfx to the recently released version. See
https://github.com/NordicSemiconductor/nrfx/blob/v3.4.0/CHANGELOG.md
for a list of changes that this version introduces.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v3.4.0
commit: 7c47cc0a56ce44658e6da2458e86cd8783ccc4a2
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External
2024-03-12 13:47:46 +01:00
Andrzej Głąbek 5470822384 nrfx: Fix compilation failures in nrfx_gppi_dppi_ppib.c
Remove dependency on the nrfx_atomic component that is not present
in hal_nordic.
Add missing `soc/` part in one interconnect header inclusion.

These are temporary changes in files imported from the nrfx repository
and they are supposed to be overwritten by the next update of nrfx.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-03-06 11:38:59 +01:00
Andrzej Kuros daf8752851 nrf_802154: rev cc772ff0a57506bd728ff3d08d03ee4ef8ffbb9d
This commit updates revision of the nrf_802154 component.

Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
2024-02-26 09:47:57 +01:00
Nikodem Kastelik dce8519f7d nrfx: samples: update to version 3.3
New version of nrfx samples adds alignments
to updated GPIOTE driver API.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-02-13 11:22:42 +01:00
Nikodem Kastelik 0c2b881a2d nrfx: mdk: Restore handling of APPROTECT on nRF91
Apply corrections that make it possible to disable APPROTECT mechanism
(which is enabled by default in hardware) on the nRF91 Series SiPs.

These are temporary changes in files imported from the nrfx repository
and they are supposed to be overwritten by the next update of nrfx.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-02-13 11:22:42 +01:00
Gerard Marull-Paretas 62a1fc4679 utils: add script to invoke autogeneration of files
This script should be run every time source files are updated.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 14:34:37 +01:00
Gerard Marull-Paretas 3fdd4a5cea utils: add a utility script to generate register offsets
In some areas MDK files cannot be used, e.g. dt-bindings, so we need
plain header files. This utility script can be used to generate a header
with register offsets for a given peripheral.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 14:34:37 +01:00
Jędrzej Ciupis 4362d0fcdb nrf_802154: rev e45bb47f0a4a43b69d19a145bdf15001d67e02dd
This commit updates revision of the nrf_802154 component.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-01-24 10:56:25 +01:00
Alberto Escolar Piedras a5f11c3386 drivers: nrfx_uarte: Fixes for simulation
Break 2 busy wait loops with a very small delay
to avoid the simulation hanging.
These changes have no effect on real HW as they
are conditionally compiled.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-23 14:41:15 +01:00
Andrzej Kuros 64bd075a06 nrf_802154: rev ff6aba3a0496b36a8ffb25b97233187e721400af
This commit updates revision of the nrf_802154 component.

Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
2024-01-09 14:26:40 +01:00
Nikodem Kastelik b55cfbbf02 nrfx: Update to version 3.3.0
Update nrfx to the recently released version. See
https://github.com/NordicSemiconductor/nrfx/blob/v3.3.0/CHANGELOG.md
for a list of changes that this version introduces.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v3.3.0
commit: d0d0a36419d7b43f33c3d1d4df8b5a44e58c60c3
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-01-08 12:22:29 +01:00
Jędrzej Ciupis 3786c55424 nrf_802154: rev 1bff96a60a6f40dae3a9262cb4a828035008df21
This commit updates revision of the nrf_802154 component.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-01-03 16:29:00 +01:00
Adam Wojasinski b9633ecea6 nrfx_qspi: Correct use of workaround for anomaly 215 and 43 in nrfx_qspi
The code that accesses QSPI registers above 0x600 needs to apply
workaround for anomaly 215 on nRF52840 or anomaly 43 on nRF5340.

The commit removes check if a custom instruction long transfer
is ongoing from deactivate function. The check could trigger
anomalies and now it's user responsibility to be sure that custom
instruction long transfer has ended otherwise it will be interrupted.

Change affects behaviour of nrfx_qspi_uinit() and nrfx_qspi_deactivate()
what is mentioned in documentation for that functions.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-12-08 11:53:08 +01:00
Andrzej Kuros eeb9ad8b11 nrf_802154: rev f8b1797b9cece579b7179dea342c278813531d9f
This commit updates revision of the nrf_802154 component.

Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
2023-12-08 10:45:11 +01:00
Jędrzej Ciupis 6efb0fdef0 nrf_802154: rev aaff0ad8570c2f7069ae9fc8f60153941275a6ae
This commit updates revision of the nrf_802154 component.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-12-06 10:44:56 +01:00
Andrzej Głąbek 56e0b052df nrfx_wdt: Remove incorrect assertion
Since nrfx 3.0.0 it is allowed to initialize the driver without
providing an initial configuration. Remove an assertion that still
ensures that such configuration was actually provided.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-11-21 09:19:18 +01:00
Nikodem Kastelik 2ff8ce6e6c nrfx_nfct: remove spurious assert from nrfx_nfct_parameter_set
This function can be called before nrfx_nfct_init.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2023-10-24 07:14:56 +02:00
Nikodem Kastelik 507d33a2d3 nrfx: Update to version 3.2.0
Update nrfx to the recently released version. See
https://github.com/NordicSemiconductor/nrfx/blob/v3.2.0/CHANGELOG.md
for a list of changes that this version introduces.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v3.2.0
commit: 7ef620bedd3fd41828e0f81523a1d08a986b8a0e
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2023-10-24 07:14:56 +02:00
Adam Wojasinski 427ee1a519 nrfx: Fix overflow of pin_flags array on nRF52820 in GPIOTE driver
GPIOTE driver was incorrectly defining the size of the `pin_flags` array
on nRF52820 SoC. The target has 18 pins - as the value of
the `P0_PIN_NUM` symbol. However, those pins are not consecutive pins
from 0 to 17. The nRF52820 has routed pins 0-8, 14-18, 20 and 28-30.

As a result, accessing pin 18 and above marks in reads/writes
that exceed the boundary of the `pin_flags` array.
To mitigate that issue, the `MAX_PIN_NUMBER` symbol that is used
to define the `pin_flags` array size is now defined as 32 for
the nRF52820 device.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2023-10-17 14:22:22 +02:00
Adam Wojasinski 568a5e90b8 nrfx: improve nRF91 anomaly 7 workaround in the NVMC driver
Now the interrupts are disabled to make sure
no context switch happens when workaround is applied.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2023-10-12 11:26:44 +02:00
Nikodem Kastelik 6d5c69ce9b nrfx: integrate MDK 8.58.0
Update the MDK in nrfx to version 8.58.0.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2023-10-12 11:26:44 +02:00
Andrzej Kuros 275548e2dc nrf_802154: rev d062f8597079db0d964762fc7666a367ff2fca4c
This commit updates revision of the nrf_802154 component.

Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
2023-10-02 19:13:34 +02:00
Alberto Escolar Piedras d054a315eb drivers: nrf_802154: Minor fixes for simulated nrf5340
Two erratas fixes cannot be applied to the simulated
nrf5340. Let's conditionally compile them out.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-28 12:13:35 +02:00
Tomasz Moń 092eb78ed1 nrfx_usbd: Prevent spurious bad DMA request
Ensure that total number of bytes transferred by DMA is even before USBD
is disabled. This prevents bad DMA request from happening on first DMA
after re-enabling DMA if the total bytes transferred was odd.

The bad DMA request was observed as SPU FLASHACCERR when building for
nrf5340dk_nrf5340_cpuapp_ns target. The bad DMA request would manifest
itself as device failing to reconnect after USB cable was reconnected.
The issue was especially visible with CDC ACM sample because SET LINE
CODING request has 7 bytes payload.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-09-25 09:57:16 +02:00
Adam Wojasinski 03807f7548 nrfx_pwm: Replace nrfy_egu calls with nrf_egu in PWM driver
When `NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED` was set
nrfy_egu function calls were causing build error as HALY for EGU
doesn't exist.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-09-15 07:38:54 +02:00
Andrzej Kuros 9ae7c76598 drivers: nrf_802154: Update the IEEE 802.15.4 component
This commit updates the nRF 802.15.4 radio driver to feature the latest
changes.

sdk-nrf-802154 commit: d08f6e6e546e23fa5894296ed4859111b3b9dc46

Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
2023-08-17 15:41:27 +02:00
Witold Lukasik cf6e9fc5f7 nrfx_pwm: Fix multiple pwm_stopped_check calling
After receiving NRF_PWM_EVENT_STOPPED event,
driver state should be changed to NRFX_DRV_STATE_INITIALIZED
as in irq_handler function.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-07-27 10:32:15 +02:00
Adam Wojasinski 20ae0a7be9 nrfx: Update to version 3.1.0
Update nrfx to the recently released version. See
https://github.com/NordicSemiconductor/nrfx/blob/v3.1.0/CHANGELOG.md
for a list of changes that this version introduces.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v3.1.0
commit: 98d6f433313a3d8dcf08dce25e744617b45aa913
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-07-13 12:08:40 +02:00
Jędrzej Ciupis 0d68181c95 drivers: nrf_802154: Update the IEEE 802.15.4 component
This commit updates the nRF 802.15.4 radio driver to feature the latest
changes.

sdk-nrf-802154 commit: 43a0e760e7e47589739da632f852237d6331dacf

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-07-05 11:27:46 +02:00
Adam Wojasinski a1c3e0fbaa nrf_ccm: Fix events and tasks for nRF51 SoCs
Definition of KSGEN and CRYPT tasks and corresponding events
enumerators are guarded by contional symbols that values are based
on MDK symbols. MDK for nRF51 SoCs is lacking of the symbols despite
having KSGEN/CRYPT events.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-05-05 17:16:40 +02:00
Nikodem Kastelik a1a8a83771 nrfx: Update to version 3.0.0
Update nrfx to the recently released version. See
https://github.com/NordicSemiconductor/nrfx/blob/v3.0.0/CHANGELOG.md
for a list of changes that this version introduces.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v3.0.0
commit: 1c721175f22dbb1bf125a570a427b53f810881bb
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2023-05-04 12:10:28 +02:00
Alberto Escolar Piedras 69b20d9658 drivers: nvmc: Use new hal functions
Use new HAL functions to read and write to flash
(these functions are inlined and just performs the same
access for real targets).
This change enables using the driver in the
nrf52_bsim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-04-28 13:46:33 +02:00
Alberto Escolar Piedras 5644a13252 nvmc: Provide new functions to read and write to flash
For reads both for bytes, halfwords, words and buffers,
for writes just for singular words.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-04-28 13:46:33 +02:00
Andrzej Głąbek 140140ea04 nrfx: mdk: Fix handling of APPROTECT on nRF91
Apply corrections that make it possible to disable APPROTECT mechanism
(which is enabled by default in hardware) on the nRF91 Series SiPs.

These are temporary changes in files imported from the nrfx repository
and they are supposed to be overwritten by the next update of nrfx.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-04-17 16:44:29 +02:00
Andrzej Głąbek c4044b04b8 nrfx_qspi: Increase default timeout to 500 ms
When a flash memory is busy with some operation, waiting for the READY
event may take significant amount of time even when only the ACTIVATE
task is triggered. The maximum wait time of 500 ms should cover most
cases, including erasing of sectors in most flash chips.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-04-17 11:43:29 +02:00
Andrzej Głąbek 045192fc96 nrfx_qspi: Add workarounds for anomalies 215/nRF52840 and 43/nRF5340
Add workarounds for anomaly 215 on nRF52840 and anomaly 43 on nRF5340
(Reading QSPI registers after XIP might halt CPU).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-04-17 11:43:29 +02:00
Nikodem Kastelik 79b4577543 nrfx: Update to version 2.11.0
Update nrfx to the recently released version. See
https://github.com/NordicSemiconductor/nrfx/blob/v2.11.0/CHANGELOG.md
for a list of changes that this version introduces.

Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v2.11.0
commit: 2527e3c8449cfd38aee41598e8af8492f410ed15
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2023-04-11 11:51:23 +02:00
Jędrzej Ciupis 6c6b666ab3 drivers: nrf_802154: Update the IEEE 802.15.4 component
This commit updates the nRF 802.15.4 radio driver to feature the latest
changes.

sdk-nrf-802154 commit: ee322183173c1d9a50203562a8021d13bed5ee04

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-03-17 08:50:39 +01:00
Jędrzej Ciupis 609d4b41fe drivers: nrf_802154: Update the IEEE 802.15.4 component
This commit updates the nRF 802.15.4 radio driver to feature the latest
changes.

sdk-nrf-802154 commit: e9eca1e61abc07f34604fa8154ca2eaca6f3c922

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-03-08 09:11:15 +01:00
Jędrzej Ciupis 6c9f23498e drivers: nrf_802154: Update the IEEE 802.15.4 component
This commit updates the nRF 802.15.4 radio driver to feature the latest
changes.

sdk-nrf-802154 commit: 9470a97f6e07d2f3ae09db2e6cefa5edf0b2b9ae

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-02-22 11:10:31 +01:00
Tomasz Moń 3f7ae2320b nrfx_usbd: Do not abort endpoints on suspend
Aborting endpoints on suspend contradicts Universal Serial Bus
Specification Revision 2.0, 9.1.1.6 Suspended:
  * When suspended, the USB device maintains any internal status,
    including its address and configuration.

The internal status definitely includes any pending USB transfers.
Even if the developer wants the transfers to be aborted when bus is
suspended (as far as I know, no standard class expects such behavior),
USBD driver is the wrong layer to do so.

Remove offending call to usbd_ep_abort_all() in order to allow Zephyr to
properly support suspend and get rid of workarounds to multiple suspend
related problems that accumulated over the years.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-01-11 12:00:40 +01:00