Configuring a pin with GPIO_DISCONNECTED currently
results in the pin being set as output due to a
fallthrough in the code. This is not supported by
the driver and should return -ENOTSUP instead.
This commit ensures that configuring GPIO_DISCONNECTED
is explicitly rejected and not applied to the hardware.
Signed-off-by: Fabian Kainka <f.kainka@gmx.de>
When the debug port is turned on, the reset IO should be set inactive.
Setting the pin active will hold the device in reset constantly and
causes issues with debug port access.
When the port is turned off, the keep_reset_deast option should set
the IO to inactive as the kconfig states.
Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
This reverts commit 311a841620.
+ related changes done in 841e4d4597
Proposed API change result in vendor specific details of the DMA leaking
into application code, which prevents usage with portable code.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
STM32H72x/73x ADC have a PCSEL_RES0 register instead of PCSEL for other
series.
Make a special case to prevent a compilation error.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
According to the note the driver is not able to provide large amount of
data and it can only be used as seed for a RNG. Therefore enable
ENTROPY_NEEDS_PRNG on it.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This Kconfig is used to signal that the entropy driver needs a PRNG crypto
algorithm on the provided data. The reason is that the driver is not
capable of providing large amount of data in a relatively short amount of
time.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
POWER_GetResetCause() returns an OR'd bitmask since multiple reset
causes can occur simultaneously. The switch statement only matched
a single value, falling through to default and returning 0 when
multiple bits were set. Replace with bitwise checks to accumulate
all active reset flags.
Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
NXP FlexSPI NOR flash nodes were missing the soc-nv-flash child
node expected by Zephyr's flash map API.
Without this child node, DT_MTD_FROM_FIXED_PARTITION resolved to
the FlexSPI memory controller instead of the flash device. Since
the controller has api = NULL, MCUboot could hit a NULL pointer
dereference during boot on Zephyr 4.4.
Fix this by updating the DTS structure to match the soc-nv-flash
convention used by the flash map infrastructure.
Changes:
- add a soc-nv-flash child under each nxp,imx-flexspi-nor node
- move erase-block-size, write-block-size, and partitions into it
- add ranges to flash controller nodes for address translation
- update zephyr,flash to point to the soc-nv-flash child
- add zephyr,flash-controller chosen for the flash driver node
- remove soc-nv-flash.yaml from nxp,imx-flexspi-nor.yaml
- use zephyr,flash-controller in flash CMake XIP decisions
- update FlexSPI XIP Kconfig logic to walk to the grandparent
This keeps the controller and flash device roles separate and
restores correct flash map resolution for MCUboot and XIP logic.
Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
shared_multi_heap_add expects the region parameter to be
a non-const parameter; if const is passed, it still discards
it, but generates warnings.
Signed-off-by: Krisztian Szilvasi <krisztian@atym.io>
The size argument was ignored in i2s_mcux_write. This caused unwanted
behaviour when writing data smaller than the configured size.
Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
The enum kLPI2C_TransferRepeatedStartFlag is not used in fsl_lpi2c.c,
so it shouldn't be used in mcux_lpi2c drivers.
Update nxp hal to get latest version of lpi2c drivers.
Signed-off-by: Michal Chromec <michal.chromec@nxp.com>
Replace DT_ENUM_IDX_OR with DT_NODELABEL usage with the more appropriate
DT_INST_ENUM_HAS_VALUE macro for checking the version property value.
This improves code readability and uses the proper devicetree API for
enum value checking.
Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
Remove the error check because it may misjudge some right cases.
For example, for HSUSBD, in the case Setup-DataIn-StatusOut and
immediately following Setup-DataOut-StatusIn, the DataOut in the
second Control transfer has arrived but user buffer for OUT may
be only ready for StatusOut in the first Control transfer.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
The scheduled transfer message can be just a hint and its attached
transfer buffer can be NULL. Skip this case.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
The crash results from Control transfer STALL interrupt flag
not cleared. To catch all uncleared interrupt flags, all Control
transfer interrupt flags are cleared altogether at one place
instead of separately, with their handling order not changed.
Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
The UARTE_GET_CUSTOM_BAUDRATE macro used an incorrect formula that
did not match the one specified in the nRF54x UARTE datasheet.
The correct formula is:
2^12 * floor(2^20 / round(f_PCLK / desired_baudrate))
Update the macro to match the datasheet formula, to reduce the
baudrate error for high-speed UART instances on nRF54x devices.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
net_if_carrier is to be used independently of the
administrative state (start and stop of the ethernet_api).
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Replace SOC_SERIES_CH32V00X with SOC_SERIES_QINGKE_V2C to maintain
consistent naming across SOC series.
Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/w1`
- `drivers/watchdog`
- `drivers/wifi`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/rtc`
- `drivers/sdhc`
- `drivers/sensor`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/interrupt_controller`
- `drivers/led_strip`
- `drivers/lora`
- `drivers/memc`
- `drivers/mfd`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/i2s`
- `drivers/i3c`
- `drivers/ieee802154`
- `drivers/input`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/clock_control`
- `drivers/counter`
- `drivers/crypto`
- `drivers/dai`
- `drivers/debug`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/adc`
- `drivers/audio`
- `drivers/bluetooth`
- `drivers/can`
- `drivers/charger`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
reset data->scan_cb on fail, otherwise we can't
try it again, because we check it at the begining
and return when it is already set.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
pd_mac_sap_handler gPdDataInd_c case shouldn't free msg
as it is already freed by the rx_thread. The msg is put
in rx_msgq queue through k_msgq_put which does a shallow
copy.
Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>
nRF USBD peripheral allows only one DMA to/from isochronous endpoint in
between two SOF packets. nRF UDC driver enforces this limitation using
m_ep_ready variable that has respective endpoint bit set to 1 inside SOF
handler. While this works most of the time, there is a corner case where
the DMA can start before SOF and finish after SOF.
Prevent issuing two DMA to/from isochronous endpoint within one frame by
not setting m_ep_ready bit if isochronous endpoint DMA was active during
SOF. This avoids failed assertion for iso IN endpoint being armed and
ready at the same time.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Endpoint dequeue is inherently racing against bus transactions. It is
possible that transfer finishes right before dequeue. When this happens
it was possible for the endpoint queue to be empty during xfer finished
handling. Resolve the software thread race by performing dequeue in the
same thread that handles finished transfers.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
The counter_api_get_pending_int typedef returns uint32_t, but the
public counter_get_pending_int API, its inline implementation, and
its syscall handler all return int. Several drivers return raw hardware
register bitmasks that can have upper bits set; the implicit cast to
int would make those values appear negative, which callers could
misinterpret as error codes.
Change the public API, inline impl, and syscall handler to return
uint32_t to match the driver API typedef.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Fixes:
zephyr/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c:414:23:
warning: unused function 'ep_to_hal' [-Wunused-function]
zephyr/drivers/usb/common/nrf_usbd_common/nrf_usbd_common.c:816:22:
warning: unused function 'usbd_ep_iso_capacity' [-Wunused-function]
When compiling with LLVM:
west build -p -b nrf52840dk/nrf52840 samples/subsys/usb/hid-keyboard --
-DTOOLCHAIN_VARIANT_COMPILER=llvm
Drop ep_to_hal since it's static and unused, usbd_ep_iso_capacity is
used in an assert just flag it as maybe unused.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
When the device is connected to the host, but the application shuts down
and initialize USB device again, there will be no UDC_EVT_VBUS_READ
event generated from USB VBUS regulator on nRF52840 and nRF5340
controller. We can track the state in the driver and resubmit the event
just at the beginning of the initialization. If the device gets
disconnected in between, there will be subsequent UDC_EVT_VBUS_REMOVED
event. Perhaps it could also be solved in more generic way, but other
controllers could behave differently. Also, it could be considered that
the application should track the state of the VBUS.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Fix a dangling pointer warning in adc_shell.c by placing the
help text in a static variable instead of returning a pointer
to a local variable.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Some systems can have board layout that can cause PHY
reset to be slower. So add more checkes to make sure
PHY is completely out of reset. We basically check
1) Power down bit from BMCR register
2) Reset bit from BMCR register
3) Factory Bit in OMSO register
Tested:
Verified that on a system with slow PHY
reset, the bit verification logic helps
ensure PHY is out of reset.
If the PHY takes longer thann 0.5s, then the
PHY bit checking logic helps surface the problem.
Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
The infineon dmic driver did not correctly track the address offset into
the current receive buffer and there were also issues with the transfer
size calculations. This change corrects these issues.
Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
set band info in scaned aps.
As the esp32-c5 supports 5 Ghz, the info can there otherwise
be wrong.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The driver never enabled the transfer error interrupt. If a transfer error
occurred, the ISR would not be called which could result in a deadlock.
Make sure the transfer error interrupt is enabled.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Add driver support for MCAN module on TI's MSPM0 G-Series MCUs.
The MCAN module supports both classic CAN and CAN FD protocols.
Signed-off-by: Santhosh Charles <santhosh@linumiz.com>
Signed-off-by: Jackson Farley <j-farley@ti.com>
Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
Add support for the CANCLK source for MSPM0. `mspm0_canclk_cfg`
config struct is used to get rate.
Signed-off-by: Santhosh Charles <santhosh@linumiz.com>
The Cadence SPI driver relied on a conditional guard around software RX
accounting (tx_remain_entry/fifo_diff) in spi_cdns_send(). During
opcode/address/dummy phases (e.g., SPI NOR reads), the RX segment may be
NULL (discard), causing the guard to evaluate false. This prevented the
driver from tracking RX entries generated by each TX entry and could
lead to RX FIFO overflow.
Fix this by always decrementing tx_remain_entry and incrementing
fifo_diff for every TX FIFO entry pushed. Since SPI is full‑duplex, each
TX entry clocks in one RX entry, regardless of whether the client
provides an RX buffer for that phase. The ISR drains RX while fifo_diff
> 0, so keeping fifo_diff accurate prevents overflow.
Also update spi_cdns_recv() RX context handling to be mode-aware:
- In slave mode, advance RX context only when an RX buffer is present.
- In master mode, advance RX context for each received frame.
This keeps slave receive accounting consistent while preserving correct
master behavior, and aligns with the software-tracking approach used to
avoid unreliable RX_NOT_EMPTY status (AR#65885).
As part of this change, refactor spi_cdns_recv() to reduce cognitive
complexity and improve readability, without changing functional behavior.
Signed-off-by: Srikanth Boyapally <srikanth.boyapally@amd.com>
Register a pm_action callback that disconnects RF GPIO pins
(antenna enable, TX/RX FE_CTRL) on suspend and reconfigures
them on resume.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>