Skip to content

Conversation

@jaz1-nordic
Copy link
Contributor

Add custom nordic-specific ADC API to enable to read negative values from a single-ended ADC channels.

Based on #3095, only the last commit is in scope of this PR.
Upstream PR: zephyrproject-rtos/zephyr#91704

bjarki-andreasen and others added 30 commits July 11, 2025 09:08
This noup does the following:
- Adds the  modem_backend_uart_slm modem backend which is optimized
  for UART communication to SLM.

The noup is intended to live until upstream zephyr has proper
consistent RTS/CTS flow control support across multiple drivers,
and DTR, RTS and CTS support has been added to the upstream modem
UART backends, and lastly, SLM has been updated to use DTR, so
everything is in sync.

Ask Bjarki Arge Andreasen, Markus Lassila or Seppo Takalo when this
noup is to be altered as part of an upmerge for example.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Signed-off-by: Markus Lassila <[email protected]>
…egacy scan+adv

In 25c993e a new case was introduced
where own_addr_type is not set by bt_id_set_scan_own_addr properly.

This led to issues for users where increasing their zephyr version
led to failures to start scanning after advertising in the case where
CONFIG_BT_SCAN_WITH_IDENTITY=n and legacy advertising commands are used.

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit 43223a1)
…bled

It represents whether scanning was disabled as part of this flow.

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit 11782db)
…with identity

Attempting this would fail (assuming the controller is implemented
correctly) because when using legacy commands it is not allowed to
change the device address while scanning.

It also did not make sense. If we have configured the scanner to use
the identity address as own_addr, because the advertiser and scanner
addresses are shared when using legacy commands, setting the adv NRPA
here would overwrite the identity address used by the scanner, which
I assume is not the intention.

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit ef7ede6)
…pdating own_addr

It wasn't taken into account that bt_le_scan_set_enable()
has a return value. It's not likely that the controller
rejects the command when BT_DEV_SCANNING is set, however.

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit aa4e6ac)
Add property which indicates that PWM instance supports IDLEOUT
feature. Add property to all instances that supports it.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 28cfb3f)
…y cycle

IDLEOUT presence in PWM means that there are 3 sources from which
PWM pin can be driven:
- GPIO setting when PWM peripheral is disabled.
- IDLEOUT setting when PWM is enabled.
- PWM Sequence when it is in use.

IDLEOUT setting cannot be changed after enabling PWM so it is
configured to the initial state of the pin. It means that if duty
cycle is 100%, GPIO output is set to 1 but initial pin state was 0
(IDLEOUT setting) there will be a glitch between disabling a PWM
sequence and disabling a PWM peripheral.

By default, PWM driver tries to disable PWM peripheral if all channels
are 0% or 100% duty cycle to safe power. When IDLEOUT feature is
present there will be a short glitch on channels with 100% duty cycle.

In order to avoid that CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100 option is
added (enabled by default). When option is enabled 100% duty cycle
is achieved by PWM sequence and not by driving a GPIO pin. It will
consume more power in cases where all channels are 0% or 100% with
at least one channel set to 100% duty cycle.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 0261d7d)
adds kconfig that was probably skipped during migration.

Signed-off-by: Mateusz Michalek <[email protected]>
It's unused.

Signed-off-by: Tomi Fontanilles <[email protected]>
(cherry picked from commit e4e8870)
Do not call cache management functions in sample because it does not
work properly if driver uses bounce buffers.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit 810118d)
Change I2S mem slabs to adhere to UDC padding and alignment requirements.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit 45f1222)
Add configuration and feedback implementation necessary to run UAC2
samples on nRF54H20. Limit nRF54H20 to Full-Speed only operation because
the samples currently don't have necessary logic to support High-Speed.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit e0c2372)
Constify vendor quirks structure to not keep it in RAM. Use constified
vendor quirks structure directly if there is only one snps,dwc2 instance
to allow compiler inlining quirk implementation.

Signed-off-by: Tomasz Moń <[email protected]>
Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 46b11f1)
New control transfer is started prematurely from device perspective when
host timeout occurs. Any data transfer from previous control transfer
have to be cancelled prior to handling SETUP data. Unconditionally
disable control IN endpoint to prevent race for enqueued buffer between
udc_buf_get_all() called in dwc2_handle_evt_setup() and udc_buf_peek()
called in dwc2_handle_in_xfercompl().

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit 89a81e3)
Add helper to handle SOF interrupts/events and new Kconfig option to
disable SOF interrupt.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 2d79957)
Signed-off-by: Tomasz Moń <[email protected]>
If the new Kconfig option is disabled, no SOF events are passed to the
higher layer.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 7b287ec)
Signed-off-by: Tomasz Moń <[email protected]>
…save some RAM

In the USBD_DESC_STRING_DEFINE macro defenition the const qualifier is
missing. Also, do not reserve room for the UTF16LE conversion, as this
is done on the fly in the stack.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 0e127e6)
Signed-off-by: Tomasz Moń <[email protected]>
…UNT if not used

If deferred mode is not being used, hide the USBD_MSG_SLAB_COUNT option.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 452a53b)
Signed-off-by: Tomasz Moń <[email protected]>
…erial number

Add Kconfig option to limit the length requested from HWINFO to a
meaningful number of digits. Also, check the length returned by the
HWINFO driver and rename the variables to a more suitable name.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 76579d2)
Signed-off-by: Tomasz Moń <[email protected]>
…iption

Update USBD_DESC_SERIAL_NUMBER_DEFINE macro description.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit c7b364e)
Signed-off-by: Tomasz Moń <[email protected]>
Allow optimization if high speed is not supported. Unify strings for
error logging. Allow the application to enable/disable the USB device.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 0975237)
Signed-off-by: Tomasz Moń <[email protected]>
Replace irq_lock() with spin lock which is proper synchronization
primitive that should be used. Because non-SMP implementations are
allowed to optimize spin lock to just locking interrupts the resulting
code is the same on all currently supported DWC2 targets.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit 70cd0ab)
At High-Speed there is at most 25 us handling window for incomplete iso
IN/OUT and therefore determining which endpoints are isochronous is too
wasteful. Add lookup variable holding which isochronous endpoints are
enabled and limit the search to only enabled endpoints. For applications
with just one OUT and one IN isochronous endpoint this is optimal.

The lookup variable is updated only when mutex is held. Interrupt
handler accesses the variable read-only and in general there is no
problem is incomplete iso handling interrupt hits when the lookup
variable is updated, because:
  * when endpoint is just activated, it cannot be source of incomplete
    iso interrupt because the endpoint is not armed yet
  * when endpoint is just deactivated, it was first disabled

If there is more than one isochronous endpoint same direction then just
relying on endpoint enabled is not necessarily optimal. However, in
order to be able to limit the search to only armed endpoints, the lookup
variable would have to be updated on every transfer preparation and
completion which would require more time-expensive synchronization.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit 9aff5da)
Do not synchronously wait for endpoint interrupt bits when disarming
endpoints. Introduce ep_disabled k_event that makes it possible for
application to wait for the action to take effect which is necessary
when handling SetFeature(ENDPOINT_HALT) or SetInterface() requests.

This change improves incomplete iso IN and OUT handling performance,
especially when there are multiple isochronous endpoints that need
servicing.

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit d29719e)
…dpoint

UDC drivers use udc_buf_get_all() when dequeueing endpoint. On drivers
that require double buffering for isochronous IN endpoint, the dequeue
on interface disable will result in class request API called on net_buf
with frags set. Call release callback on the buffer pointed in frags
because it was passed in using usbd_uac2_send().

Signed-off-by: Tomasz Moń <[email protected]>
(cherry picked from commit b3e80c5)
…gs can be reused

When the endpoint is re-enabled, check if the current FIFO settings can
be reused. Further work is needed to improve FIFO memory handling for
more advanced interface configurations.

Signed-off-by: Johann Fischer <[email protected]>
(cherry picked from commit 56b359b)
Signed-off-by: Tomasz Moń <[email protected]>
…specific sections

This change adds two macros that allow the user to specify the section
the memslab buffer should be allocated from. This is useful for systems
where memory must reside in DMA-able memory like USB.

Signed-off-by: Victor Brzeski <[email protected]>
(cherry picked from commit 3c47f91)
Signed-off-by: Tomasz Moń <[email protected]>
Per section 5.6.4 of the USB 2.0 standard, Isochronous Endpoints
are derived by the (2^(bInterval-1) * F) formula. The current
implementation uses the formula intended for Interrupt Endpoints.

Signed-off-by: Victor Brzeski <[email protected]>
(cherry picked from commit d9c7b19)
Signed-off-by: Tomasz Moń <[email protected]>
This commit adds a device-tree prop for the audio streaming
terminals to specify the bInterval values for the Isochronous
endpoints.

Signed-off-by: Victor Brzeski <[email protected]>
(cherry picked from commit e8638be)
Signed-off-by: Tomasz Moń <[email protected]>
This commit adds the following:
    * Sensor related usage IDs in the Sensors' page of the HID standard.
    * A HID usage macro that works with IDs of 2 bytes.
    * A macro to define the exponent in a report descriptor.

The values and naming came from the following document: https://www.usb.org/sites/default/files/hutrr39b_0.pdf

Signed-off-by: Zak Essadaoui <[email protected]>
(cherry picked from commit 41a83bd)
Signed-off-by: Tomasz Moń <[email protected]>
krish2718 and others added 21 commits July 28, 2025 07:01
Add missing binding to fix the device tree warning.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 1495e2e)
the nRF connect device tree extension shows below warning:
'Property not mentioned in "nordic,nrf-pinctrl:child"'.

Fix this by applying the property to both groups separately.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 613ec82)
… groups

Add a newline between child nodes.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit 86690f2)
When Kconfig option CONFIG_NET_L2_PPP_OPTION_DNS_USE is enabled,
Zephyr should request two DNS addresses in IPCP negotiation by sending
IPCP ConfReq for DNS otions using 0.0.0.0 as an address.

Remote peer may offer DNS by sending IPCP ConfNak with proper address.
This is explained in RFC 1332 and RFC 1877 (DNS extension).

When no DNS is required, we should only send IPCP ConfReq for IP
address, without having DNS fields in the same request.

However, when PPP is configured to serve a DNS using Kconfig option
CONFIG_NET_L2_PPP_OPTION_SERVE_DNS it should serve the DNS address in the
IPCP ConfNak message and from the ipcp.peer_options structure, not from
the ipcp.my_options.

This might break backward compatibility outside this repository
as DNS addresses used to be served from ipcp.my_options.

Signed-off-by: Seppo Takalo <[email protected]>
(cherry picked from commit 5a31f3d)
There are cases, for example when peer is requesting two DNS
addresses, but we can only give one, we should reject the secondary
DNS request first, before sending NAK to acceptable options.

Option parser can reject a parameter by returning -ENOTSUP and when
it wants to NAK the parameter, it returns -EINVAL.

On RFC 1661:
Configure-Reject
  If some Configuration Options received in a Configure-Request are
  not recognizable or are not acceptable for negotiation (as
  configured by a network administrator), then the implementation
  MUST transmit a Configure-Reject.

Configure-Nak
  If every instance of the received Configuration Options is
  recognizable, but some values are not acceptable, then the
  implementation MUST transmit a Configure-Nak.

So as stated by RFC, we should start the negotiation by rejecting all
parameters that we cannot configure. I added an example of rejecting
DNS requests, if we don't have those.

Signed-off-by: Seppo Takalo <[email protected]>
(cherry picked from commit d5f4ca3)
…mple

[nrf-squash!] [nrf noup] samples: mgmt: mcumgr: smp_svr: Add nrf5340dk-optimised sample

Fixes a too low value in the MCUboot configuration for this
specific configuration

Signed-off-by: Jamie McCrae <[email protected]>
…_DIR on Sysbuild

Add support for custom NRFX_DIR for Sysbuild builds by checking if
NRFX_DIR has been defined in Sysbuild.

Upstream PR #: 93583

Signed-off-by: Michał Bainczyk <[email protected]>
This reverts commit 662e647.

Signed-off-by: Krzysztof Chruściński <[email protected]>
Bump required version of nrf-regtool to 9.2.0.

Upstream PR #: 91041

Signed-off-by: Krzysztof Chruściński <[email protected]>
Same as commit 6ec9d10 but with the REQUIRED keyword on its own
line to attempt to avoid a merge conflict when reverting/reapplying
this patch.

Signed-off-by: Jonathan Nilsen <[email protected]>
(cherry picked from commit 8c2d815)
Add GPIOTE0 instance in radio peripherals.

Upstream PR #: 91041

Signed-off-by: Krzysztof Chruściński <[email protected]>
Add new feature flags to gpiote node.
Include pinctrl. Pins used by GPIOTE0 on nrf54h20/cpurad require CTRLSEL
configuration. Pins are listed using pinctrl and parsed by nrf-regtool
to prepare UICR configuration.

Upstream PR #: 91041

Signed-off-by: Krzysztof Chruściński <[email protected]>
Add NRFX_GPIOTE_VAR_FEATURE_SUPPORT feature flag to nrfx configuration.
It enables support for special GPIOTE0 instance in nrfx_gpiote driver.

Upstream PR #: 91041

Signed-off-by: Krzysztof Chruściński <[email protected]>
Add support for special GPIOTE0 instance on nrf54h20/cpurad.
This instance requires special handling because:
- there is no support for PORT event (level interrupts)
- TE channels are fixed to the pin

Upstream PR #: 91041

Signed-off-by: Krzysztof Chruściński <[email protected]>
Add return code checking for gpio_pin_interrupt_configure functions.
Add disabling pin interrupt at the end of the test to restore pin
state.

Upstream PR #: 91041

Signed-off-by: Krzysztof Chruściński <[email protected]>
…PIOTE0 config

Add configuration for testing GPIOTE0 instance on nrf54h20/cpurad.

Upstream PR #: 91041

Signed-off-by: Krzysztof Chruściński <[email protected]>
…perty

Add build asserts for "memory-regions" property in nrf drivers which is
required on targets with DMM for saadc, pdm, pwm, twim, twim_rtio, twis,
tdm, uarte, spim and spis. On targets where the property is not required
the assertion macro expands to nothing.

Signed-off-by: Michał Bainczyk <[email protected]>
(cherry picked from commit 2e06c4e)
…s prop to uart sample

Add missing "memory-regions" property which is required for UART
on NRF54H20 to clock_control sample overlay file.

Signed-off-by: Michał Bainczyk <[email protected]>
(cherry picked from commit ba3662a)
Add support for DMM which manages cache and dedicated memory spaces.

Upstream PR #: 90751

Signed-off-by: Jakub Zymelka <[email protected]>
…al sampling timer

The SAMPLERATE register can be used as a local timer instead
of triggering individual SAMPLE tasks. When SAMPLERATE.MODE is set
to Timers, it is sufficient to trigger SAMPLE task only once in order
to start the SAADC and triggering the STOP task will stop sampling.
The SAMPLERATE.CC field controls the sample rate.

The SAMPLERATE timer should not be combined with SCAN mode and
only one channel should be enabled when using the internal timer.

Upstream PR #: 91368

Signed-off-by: Jakub Zymelka <[email protected]>
…ended ADC readings

Add custom nordic-specific ADC API to enable to read negative values
from a single-ended ADC channels.

Upstream PR #: 91704

Signed-off-by: Jakub Zymelka <[email protected]>
@jaz1-nordic
Copy link
Contributor Author

Handled here: #3147

@jaz1-nordic jaz1-nordic closed this Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.