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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>