As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Combine register address and data in one buffer and use i2c_write_dt()
instead of i2c_burst_write_dt() so the transfer is a single I2C
transaction. Some I2C controllers (e.g. Infineon) split burst write
into two transactions with a STOP in between, which causes failure.
Signed-off-by: Oleksandr Skopets <skopets.sasha@gmail.com>
Doing this increases the QSPI peripheral clock from 40 MHz to 80 MHz.
This improves flash access throughput and overall performance
on siwx91x devices, as QSPI is used for external flash operations.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
The Siwx91x GSPI controller requires the FIFO reset bits to be
held high for a minimum of one GSPI bus clock cycle.
Currently, the driver asserts and deasserts the reset back-to-back,
which may result in an insufficient reset pulse width at higher
frequencies.
Add a small, frequency-based delay after asserting the FIFO reset
bits to guarantee the minimum reset duration, ensuring reliable
FIFO reset behavior.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
Update the GSPI DMA configuration to conditionally register the DMA
callback based on transfer direction and RX buffer presence. The
callback is enabled for TX-only transfers when the RX buffer is NULL
and for RX transfers when a valid RX buffer is provided.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
On Cortex-M with NVIC, if a peripheral sets its interrupt
flag again while the current handler is executing, the NVIC
pending bit is set. Even after the current handler clears
the flags, the pending bit still remain set. The current
implementation manually clears the pending bit to avoid
unneccesary extra handler calls when no additional
processing is required.
On other Arm GIC-based platforms like Cortex-R52, the GIC
automatically clears the pending bit when the peripheral
flag is cleared since these interrupts are level-sensitive.
Therefore, manually clearing the pending bit is unneccesary.
Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
The current stm32 drivers will only enable soft NSS support if
the device is using a Zephyr managed GPIO for CS, or if the
CONFIG_SPI_STM32_USE_HW_SS flag is set. Neither of these are
actually appropriate for a peripheral, which doesn't control CS.
With this change, it is possible for the SPI interface to be
configured as a peripheral but still use soft NSS -- otherwise,
short of creating a "fake" GPIO configuration, the peripheral
will always use hard NSS, and for some boards/configurations,
that is unworkable. In the case of a board where the CS
is not hooked up, we can use soft NSS to allow the peripheral
to assume CS and be driven by the SPI clock signal alone.
Our board has only three signals (clock, COPI, POCI) enabled
on one of the SPI interfaces (it is communicating with another
MCU on the same board), and works with this change. Without
the change, we must enable a "fake" GPIO driver configuration
(which is never used for anything, and really makes little
sense for a peripheral, but it just happens to force the
driver to go down that code path). We cannot disable the
CONFIG_SPI_STM32_USE_HW_SS mechanism, as that impacts ALL
interfaces, and we have a second interface in controller
mode that speaks to flash and requires the NSS_HARD codepath.
Signed-off-by: Rob Newberry <rob@zenomoto.com>
The gpio_pca_series driver may stop responding if the gpio_int is
asserted between reading the interrupt status and clearing it.
If the interrupt gpio_int is not deasserted by the time the handler
finishes, the interrupt work should be rescheduled.
Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
This change makes the driver rely on DT_INST_FOREACH_STATUS_OKAY(...)
rather than copy-paste the same code several time.
This also has the advantage of allowing more that 5 instances of this
uart driver.
Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
Drop `counter_stm32_reset_timer`, introduced in PR #94189 (01a00d5),
as it duplicates the existing `counter_stm32_reset` functionality.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Calling net_if_set_link_addr() is needed to update the link address
information of the interface.
Signed-off-by: Jeremy Truttmann <jetstreeam.code@outlook.com>
Add explicit clock configuration and enable calls during driver
initialization.
Note: -ENOSYS is temporarily ignored as not all clock control
drivers currently implement the configure API. This handling
should be removed once all clock drivers support configure.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Add explicit clock configuration and enable calls during driver
initialization.
Note: -ENOSYS is temporarily ignored as not all clock control
drivers currently implement the configure API. This handling
should be removed once all clock drivers support configure.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Fix incorrect diff calculation for relative alarms that caused alarm
callbacks to never fire. The original code calculated diff as
(alarm_cfg->ticks - now), which caused unsigned underflow when
now > alarm_cfg->ticks, resulting in a huge diff value that
incorrectly triggered the late alarm path and set callback to NULL.
For relative alarms, the diff should simply be the ticks value since
it already represents the delay from the current time.
Also add channel validation to return -ENOTSUP for chan_id > 0 since
ESP32 timer hardware only supports one alarm comparator per timer.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Remove the negative value check on bss_max_idle_period, which is
defined as an unsigned type and can never be less than zero.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Refactor scan_done_handler to retrieve Access Point (AP) records one
by one rather than pre-allocating a large buffer for the entire list.
Previously, the driver attempted to k_malloc space for all detected APs
simultaneously. In environments with high AP density or under system
memory pressure, this allocation would often fail, resulting in no
scan results being reported.
Improvements:
- Switched to stack-allocated wifi_ap_record_t to process entries.
- Replaced esp_wifi_scan_get_ap_records with a while-loop using
esp_wifi_scan_get_ap_record to reduce peak heap usage.
- Added esp_wifi_clear_ap_list() to ensure hardware resources are
freed after the loop completes.
- Added warning log on unexpected scan fetch failures.
This makes Wi-Fi scanning significantly more robust in memory-constrained
scenarios.
Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
Fix the logic in `uart_xec_irq_tx_complete` when evaluating the UART line
status register against the TX-empty mask. The previous condition could
report "TX complete" even when the TX path was not fully empty, which can
cause flush users to loop or make incorrect progress decisions.
This change corrects the comparison against the TX-empty mask so that the
function only reports completion when the hardware indicates the expected
empty state.
Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
initialized and used with proper essential type (true/false).
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
initialized and used with proper essential type (true/false).
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
initialized and used with proper essential type (true/false).
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
initialized with true/false, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
initialized with true/false, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Adds these properties which are missing, and fixes instances of
wrongly using relative addresses when they are already absolute
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Add shutdown script for nRF91 Serial Modem.
Also, set unused timeout values to zero.
Only the reset_ms is used when the switch from
CMUX back to AT mode UART happens.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When 4-byte addressing is enabled, update the page program LUT entry
to use the appropriate 4-byte page program command (SPI_NOR_CMD_PP_4B).
For octal mode (1S-8S-8S), select the correct page program command
based on address width:
- Use SPI_NOR_CMD_PP_1_8_8_4B for 32-bit addressing
- Use SPI_NOR_CMD_PP_1_8_8 for 24-bit addressing
This ensures the flash controller uses the correct command sequence
for page programming operations in both standard and octal modes with
extended addressing.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
- 1-1-8 and 1-8-8 page program commands for 3-byte addressing
- 1-1-8 and 1-8-8 page program commands for 4-byte addressing
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Zephyr was crashing in hpet when the base address
wasn't set yet when using MMU and when
`cyc_per_tick` was not defined yet.
Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>