Some MAX32 targets may fail to raise TX half/almost empty interrupts,
so add an optional workaround for those scenarios to ensure no missed
TX completion when using the interrupt API.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
Add CONFIG_FLASH_MSPI_NOR_DMA_DATA_XFER and
CONFIG_FLASH_MSPI_NOR_DMA_CONTROL_XFER as Kconfig options for MSPI
NOR Flash driver. These options are used to select whether data and
control transfers should be performed using DMA or PIO modes.
Update flash_mspi_nor to store choices and apply them accordingly:
use data-xfer-mode for read/write data transfers, and control-xfer-mode
for command/register/configuration traffic. This selection is due to DMA
transfer's having a larger setup overhead so is less beneficial for
short control transfers.
Signed-off-by: David Jewsbury <david.jewsbury@nordicsemi.no>
Modifies 1-wire serial driver to accept configurable baud rates for
Overdrive mode.
In testing with DS2488, which are Overdrive-only, it was found that
both the baud rate and zero bit pattern needed to be adjusted for
stability. This commit allows the user to define their own baud
rates for OD mode, and modifies the zero bit in OD mode.
It is assumed that most testing has been done with standard-speed
devices, so the timings and bit patterns have not been changed or
made user-modifiable.
Signed-off-by: Glenn Andrews <andrewsglenn@meta.com>
The current implementation of video_shell_set_ctrl() incorrectly
passes &arg_value as the endptr to strtoll(), while attempting
to validate the result using an uninitialized end_value pointer.
This causes the check (*end_value != '\0') to always trigger
shell_error.
Update the code to pass the address of end_value to strtoll()
correctly, ensuring it points to the first invalid character
within the input string for proper validation.
Signed-off-by: Chin-Yao Hung <cy.hung@guc-asic.com>
Change CMakeLists.txt to register Zephyr library only if respective
source code is compiled.
Fixes CMake Warning:
No SOURCES given to Zephyr library: drivers__usb__common__buf
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
In e6daacf3c9 the mayority of the
ethernet drivers code was changed to use the Zephyr native net_
prefixed symbols, but some were forgotten.
Without this fix/change the code still builds as we are by now setting
CONFIG_NET_NAMESPACE_COMPAT_MODE. But when this is not set, things
fail to build.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In 55c49cdb8f wifi
drivers were changed to use the Zephyr native net_ prefixed
types, but some were forgotten.
Without this fix/change the code still builds as we are by now setting
CONFIG_NET_NAMESPACE_COMPAT_MODE. But when this is not set, things
fail to build.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add missing includes and missing source macro definition to expose the
C library prototypes used by this code.
Background:
In general code which uses extensions to the C library (in this case
POSIX extensions) should set the appropriate macro so the C library
headers expose those. Instead of relaying on the C library always
exposing them or those macros being set from the cmake side.
Withtout these, one gets the following warnings when building with glibc:
`implicit declaration of function ‘strnlen’`
`implicit declaration of function ‘strtok_r’`
```
implicit declaration of function ‘snprintf’
note: include ‘<stdio.h>’ or provide a declaration of ‘snprintf’
implicit declaration of function ‘sscanf’
include ‘<stdio.h>’ or provide a declaration of ‘sscanf’
```
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the Zephyr prefixed naming when refering to the networking
functions, macros or types.
This ensures this code builds when
CONFIG_NET_NAMESPACE_COMPAT_MODE=n
This is a plain rename without function impact, that otherwise
is done thru macros given by net_compat.h
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the Zephyr prefixed naming when refering to the networking
functions, macros or types.
This ensures this code builds when
CONFIG_NET_NAMESPACE_COMPAT_MODE=n
This is a plain rename without function impact, that otherwise
is that thru macros given by net_compat.h
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Arm documentation (ddi0601) for GICD_CTRL_DS is as follows:
```
If the Distributor only supports a single Security state, this bit is
RAO/WI.
```
Since CONFIG_GIC_SINGLE_SECURITY_STATE suggest GIC has single security
state, the DS bit should not be touched and the assert should be enough
to make sure that GICD_CTRL_NS (DS bit) is set to 1.
Fixes https://github.com/zephyrproject-rtos/zephyr/issues/102239
Signed-off-by: Sudan Landge <sudan.landge@arm.com>
This commit implemented nxp (Semaphores2) sema42 peripheral
based on zephyr hwspinlock device driver API.
The hardware information can be find in MCXN947 RM chapter 27.
https://www.nxp.com/webapp/sps/download/preDownload.jsp?render=true
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
The I2C driver relies on the SCB oversampling clock (clk_scb) being
within specific frequency ranges for each I2C data rate. On PSOC4, the
peripheral clock dividers default to a division of 1, passing the full
HFCLK (48 MHz) directly to the SCB — far outside the valid range for
any I2C speed. This causes all I2C transfers to fail with -EIO.
Add _i2c_set_peri_divider_psoc4() which calculates the appropriate
divider from HFCLK and configures the peripheral clock using the
Zephyr utility wrappers (matching the UART driver convention).
SCB oversampling clock frequencies (from device reference manuals,
analog filter config AF_in=1, AF_out=0, DF_in=0):
Controller mode:
Standard (100 kHz): 2 MHz
Fast (400 kHz): 8 MHz
Fast Plus (1 MHz): 24 MHz
Target mode:
Standard (100 kHz): 8 MHz
Fast (400 kHz): 12 MHz
Fast Plus (1 MHz): 24 MHz
Tested on CY8CKIT-041S-MAX and CY8CPROTO-041TP in both target and
controller roles.
Signed-off-by: Braeden Lane <Braeden.Lane@infineon.com>
In cc13xx_cc26xx, the TX interrupt seems to be generated once initially on
enable and subsequently, when buffer goes from full to empty (since we are
operating in 1-byte buffer mode).
Due to this, if the TX interrupt is cleared in the configure function, a
new TX interrupt will not be generated untill we transition from a full to
empty buffer, even though the buffer itself is empty.
When using Zephyr Interrupt-driven UART API, one first needs to enable TX
interrupts `uart_irq_tx_enable()`, and then write data from the interrupt
callback, after checking `uart_irq_tx_ready()`. In case of cc13xx_cc26xx,
calling `uart_irq_tx_enable()` unmasks the TX interrupt, however, it will
not generate a new TX interrupt. Thus the callback will not be called
unless we first write something to the uart (using polling-API), causing a
transition in buffer state.
According to TI docs, writing 1 byte to the buffer will also clear the
TX interrupt, so it does not make sense to try clearing the interrupt
manulally in `configure` function.
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
This PR routes the DAC output to the mixer amplifier (not headphone output)
so that volume control via registers 0x24/0x25 on page 1 has any effect
Signed-off-by: Stefan Schmidt <kontakt@stefanschmidt-embedded.de>
When the received data is less than expected, DMA timeout error may occur.
This happens because the DMA transfer is not completed and the TC
(Transfer Complete) flag is never set.
This change adds support for handling cases where the received data length
is smaller than the requested length, preventing false timeout errors.
The CL covers the following scenarios:
1. received < expected (e.g. requested 10 bytes, got 9 bytes)
2. received = expected (e.g. requested 10 bytes, got 10 bytes)
3. received > expected
(e.g. requested 10 bytes, got 10 bytes, but more data is coming, T-bit = 1)
Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
Modifying DMA configuration to be more specific about when to use
software triggeres and the single elmeent input trigger type.
Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
Currently, the Xilinx SDHC driver does not support data
transmission with SDIO devices, requiring the addition
of CMD52 and CMD53 related functionalities.
Signed-off-by: Jack Lee <lhjhit@126.com>
The nrf54l soc init configures power and clock properties like
applying trims, capacitance and setting up regulators. This must
precede the grtc driver initializing the sys clock, as it depends
on these clocks being initialized on the nrf54l series socs.
Update the nrf54l soc init to be EARLY 0, and set grtc sys clock
driver init to EARLY 1. Additionally add comments explaining why
these specific init levels where chosen.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Update driver to follow this, stated in the documentation of the
spi_context_release: "appropriate time to call this would be at the
end of a transfer that was initiated by a transceive API call, except
in the case that the SPI_LOCK_ON bit was set"
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The SPI loopback test suite passes up transfers nop and null buffers
to the device drivers, expecting them to return early with -EINVAL
or -ENOTSUP, before setting the CS pins. Currently the NRFX based
nRF SPIM device driver sets CS unconditionally, without checking
the buffers, resulting in no transfer while toggling CS.
Add a check of the provided buffers in the transceive() function and
return early if buffers are invalid (result in 0 lenght transfer).
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Add counter driver for timer on Silicon Labs series 2.
Tested by building and running the sample on realboard
slwrb4180b and xg24_rb4187c.
Signed-off-by: Phuc Hoang <donp172748@gmail.com>
Add SDHC zero copy support for wifi.
This depends on SDHC host requirement
1. CONFIG_SDHC_SUPPORTS_SCATTER_GATHER_TRANSFER=y.
2. CONFIG_NET_BUF_DATA_SIZE to be 256 multiples.
3. CONFIG_NET_BUF_ALIGNMENT=32 (host cache line size).
4. CONFIG_NET_L2_ETHERNET_RESERVE_HEADER=y (to 4 bytes align net buffer).
Signed-off-by: Fengming Ye <frank.ye@nxp.com>
use linear_range_get_win_index instead of
linear_range_group_get_win_index because it is only
one range.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
make r_is unsigned and use 0 as the invalid
value, as in the code we divide by r_is and we don't
want to divide by 0.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add support for the PM API to the flash simulator. This enables testing
the PM behaviour of higher level libraries that use PM in CI to ensure
there are no missing/excessive calls to `pm_device_runtime_put` by the
library. For example:
```
ZTEST(library_pm, test_pm_calls)
{
const struct device *flash = DEVICE_DT_GET_ONE();
zassert_equal(0, pm_device_runtime_usage(flash));
some_complex_flash_user();
zassert_equal(0, pm_device_runtime_usage(flash));
}
```
Signed-off-by: Jordan Yates <jordan@embeint.com>
To allow cellular modems to be declared outside of modem_cellular.c
file, move all structure definitions and macros into internal header
zephyr/drivers/cellular_internal.h
This allows out-of-tree modem to be defined with
MODEM_CELLULAR_DEFINE_INSTANCE() macro.
Remove Devicetree dependency from CONFIG_MODEM_CELLULAR
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
On CY_IP_S8SRSSLT devices (PSOC 4), the WDT match register is 16-bit.
When Cy_SysClk_IloCompensate returns a compensated count that exceeds
UINT16_MAX (e.g. for a ~2000ms timeout at ~32768 Hz), passing it to
Cy_WDT_SetMatch triggers a HAL assertion that causes a HardFault on
Cortex-M0+.
Clamp ilo_compensated_counts to UINT16_MAX in the setup path, matching
the existing clamp in the feed path (ifx_wdt_timeout_to_match).
Signed-off-by: Braeden Lane <Braeden.Lane@infineon.com>
Fixes list_voltages for the tps55297
regulator driver. We can't use
`linear_range_get_value()`here, as it
subtracts `min_idx` from `idx` and we don't want that.
It lead to for some idx in the middle and the beginning
that no value is written to `volt_uv`.
It first occours for the idx between 0 and 0xf0.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
If we don't use the gpio to reset the chip, we don't
really know the current state, so we are going to
fetch it via i2c. For the en gpio case we already know,
that it won't be enabled.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Issue was corrected where transfers waiting on a busy
endpoint were not being serviced. This was causing some transfers
to never complete.
Signed-off-by: Brandon Hurst <brandon.hurst@analog.com>
Move xfer_in_done and xfer_out_done to after xfer_in
and xfer_out. This is because they will need to call
these functions in the next commit to handle deferred
traffic.
Signed-off-by: Brandon Hurst <brandon.hurst@analog.com>
UDC driver was submitting spurious resume events
when receiving DPACT events while the device was not
suspended.
- Change udc_max32_event callback to only respond to
DPACT events when suspended
Signed-off-by: Brandon Hurst <brandon.hurst@analog.com>
MAX32 USB had some functions in ISR context allocating memory &
acquiring mutexes. This commit fixes this by separating the
transfer completion events into ISR-safe / non ISR-safe steps.
Additionally, some apparent swapping of devicetree configuration
for in/out endpoints is resolved.
- Rename UDC_MAX32_EVT_XFER to UDC_MAX32_EVT_START_XFER
- Add MAX32 UDC events for XFER_IN_DONE and XFER_OUT_DONE
- Refactor xfer_in/out callbacks to only submit messages to a
message queue
- Provide xfer_in_Done and xfer_out_done to handle transfer
completions from UDC thread context.
- Add XFER_IN_DONE and XFER_OUT_DONE events to thread handler
- Fix swapping in devicetree macros of num_of_in_eps /
num_of_out_eps and ep_cfg_in / ep_cfg_out
Signed-off-by: Brandon Hurst <brandon.hurst@analog.com>
Promiscuous mode is enabled during initialization and cannot be
disabled at runtime.
Return -EINVAL when a request attempts to disable promiscuous mode.
Signed-off-by: Mori Fumita <mfumita@electromag.com.au>
ETHERNET_PROMISC_MODE is not advertised in
eth_nxp_enet_get_capabilities() even though promiscuous
mode is enabled during initialization when
CONFIG_NET_PROMISCUOUS_MODE=y.
Advertise ETHERNET_PROMISC_MODE in
eth_nxp_enet_get_capabilities() and accept
ETHERNET_CONFIG_TYPE_PROMISC_MODE in
eth_nxp_enet_set_config().
Signed-off-by: Mori Fumita <mfumita@electromag.com.au>