Add note about PSM/eDRX modes to make it clear that off-load driver
still important when using in baterry powered devices.
Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>
The snprintk function returns the number of characters that *would have
been* written if the buffer was large enough. This means if the return
value `ret` is greater than or equal to the buffer size `strsize`, the
output was truncated.
The existing check `(strsize < ret)` was incorrect as it did not
handle the case where `ret == strsize` (output fits exactly, but no
room for null terminator) and did not check for negative return values
which indicate an encoding error.
This commit corrects the check to `(ret < 0 || ret >= strsize)` to
properly detect truncation and errors, returning -ENOMEM in these
cases. This fix is applied to `gnss_dump_nav_data`, `gnss_dump_time`,
and `gnss_dump_satellite` functions.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Fix typos in the driver instantiation macro, which leads to page_size
and timeout_erase defaulting to 0 regardless of whether the
devicetree instance has the read-only property or not.
DT_INST_NODE_PROP_OR() -> DT_INST_PROP_OR()
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
Added check for continuous or gated bit clock. Now clock does
not stop if I2S_OPT_BIT_CLK_CONT is selected.
Signed-off-by: Imran Sajjad <imransajjad89@gmail.com>
Fix several issues related to the incremental CRC API usage:
1. Ensure the lock is not prematurely released in crc_set_config,
preventing semaphore double-release (over-giving).
2. Reset the flag_crc_updated state on all error paths to prevent
incorrect seeding in subsequent attempts.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
Avoid calling the HAL_XSPIM_Config function if the app is running
from flash in order to avoid locking since HAL_XSPIM_Config is once
turning off each XSPI instance when performing the configuration.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
The PSRAM could well be plugged to the XSPI2 instead of XSPI1
hence allow configuration of the IOPort and avoid forcing the
ChipSelect in order to allow working on both XSPI1 or XSPI2.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Avoid copying the whole XSPI_HandleTypeDef structure into the
init function and use a pointer since the structure is already part
of the _data structure.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Correct the RGB565 format generated by the GC2145 in case of CSI based
RGB565 by setting the Page 0 BYPASS_MODE register switch bit in order
to generate RGB565_LE instead of RGB565_BE.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
On parallel interface, the DCMIPP is expecting data in what
corresponds to the RGB565_BE formats, aka
D7 D6 D5 D4 D3 D2 D1 D0
-----------------------
cycle 1: R4 R3 R2 R1 R0 G5 G4 G3
cycle 2: G2 G1 G0 B4 B3 B2 B1 B0
The Zephyr RGB565 video format corresponds to the RGB565_LE
hence perform a SWAPCYCLE when RGB565 is used as input format
on parallel interface.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
This fixes a compilation error in sdmmc_stm32.c. Depending on the
definition of CONFIG_SDMMC_STM32_EMMC now either
HAL_MMC_ConfigWideBusOperation() or HAL_SD_ConfigWideBusOperation()
gets called.
Signed-off-by: Andreas Schweigstill <andreas@schweigstill.de>
During a teardown sequence performed by the USB DC stack's "usb_disable()",
the controller is first disabled by calling "usb_dc_detach()", which turns
off the USB controller clock in the STM32 implementation. "usb_disable()"
then disables endpoints by calling "usb_dc_ep_disable()" on each of them,
which is merely forwarded to HAL_PCD_EP_Close() by the STM32 driver. This
order of operations means that the latter operation is actually operating
on the no-longer-clocks USB controller! Up until recently, memory accesses
to MMIO of unclocked peripherals in STM32 SoCs would not cause issues, even
if the resulting access was a no-op (read returns zero, write is ignored),
so everything worked fine even if the access was *technically* illegal...
However, on newer series with a different bus fabric, accesses to unclocked
peripherals will instead deadlock the SoC!
Prevent illegal accesses inside "usb_dc_stm32_ep_disable()" by checking if
the USB controller clock is enabled before calling HAL_PCD_EP_Close(), and
skipping the call if it isn't. This allows "usb_disable()" to complete on
series such as STM32N6.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
In target mode, issue the stop callback from the I2C DW driver after the
read/write callbacks. This mirrors the behavior of other I2C target mode
drivers, and allows target handler code to correctly service any pending
read or write requests before it handles the stop condition.
Fixes#98675
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Replace series-specific macros with generic macros shared across
multiple STM32 series to improve readability and maintainability.
Signed-off-by: Mario Paja <mariopaja@hotmail.com>
Add vendor-specific RF power mode configuration during HCI setup
for SiLabs SiWx91x devices. This configures the BLE TX power
index in the controller's RF subsystem.
The implementation sends a vendor command (OCF 0x0006) with
protocol mode (2) and power index (RSI_BLE_PWR_INX) during the
setup phase. This ensures proper RF power configuration before
normal Bluetooth operations begin.
Technical details:
- Uses bt_hci_cmd_alloc() with manual HCI header construction
- Command opcode: 0xFC06 (OGF=0x3F, OCF=0x0006)
- Parameters: protocol_mode=2, power_index from RSI_BLE_PWR_INX
- Executed during bt_hci_setup callback
Signed-off-by: Arun Kumar Nagelly <arnagell@silabs.com>
When the renesas-rv-lvd driver is built with SDK 1.0 using GCC 14, the
compiler emits a spurious uninitialized variable warning because it can't
follow the control flow to figure out that the variable wasn't ever used
without being initialized. Work around this by simply initializing it
to one of the valid values.
Signed-off-by: Keith Packard <keithp@keithp.com>
In the function bq274xx_gauge_configure it was being used an hardocded
value of 3.7V instead of using the design voltage parameter defined in
the device tree.
Signed-off-by: Marcelo Cunha <mcunha@petsafe.net>
This patch adds a check for the EOT (End Of Transfer) flag
inside the polling loop in spi_stm32_half_duplex_switch_to_receive().
If EOT is set, the transfer is already complete and the loop
is exited, preventing the lockup.
Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
Signed-off-by: Julien Racki <julien.racki-ext@st.com>
When using I2C clock frequency >= 250 kHz, it's been observed that the
nPM1300 would unexpectedly wake up before requested time has expired. Add
a delay between applying a new timer value and triggering hibernate to
mitigate this.
Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
Without this header the logic in adc_esp32.c will never have either
ADC_CALI_SCHEME_CURVE_FITTING_SUPPORTED or
ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED defined. This means
that we always see the warnings aout uncalibrated samples.
Signed-off-by: Yuval Peress <yuval.peress@gmail.com>
For some reason, a regression happened where the phy monitor was never
happening. Fix by starting the monitor at the end of init function. The
monitor will then reschedule itself from then on.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Remove useless assignments to `val` parameter in sbs_gauge_set_prop()
and bq27z746_set_prop(). Since `val` is passed by value, modifying it
has no effect. Also remove unused `tmp_val` variable.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit introduces a compatibility layer for older EUSART hardware
that lacks the RXTO interrupt. It fix the test uart_async_api when using
xg22 soc.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
When running uart_elementary on the xg22 SoC, some tests are failing due
to the lack of checks inside the configuration function. This patch adds
a check for the parity parameter.
I've also noticed an error in the ISR function where we check all the
ISR flags and not only the enabled ones. It has no impact but needs to be
changed in order to be accurate.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
The current implementation checking for the validity of the spi slave
number is wrong. First of all, there is an off by one error where it
allows SPI_CHIP_SELECT_COUNT value as a valid slave, when really it
should be that value minus one. Secondly, it doesn't take into account
the fact that having software controlled GPIO CS can technically have
any number of slaves on the bus. So fix by finding the max of these two
values and fixing the off by one mistake. Also, for RW612, only one HW
native CS is available due to SOC pinmux limitations.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The I2C state machine may fail to generate a valid STOP condition.
This may happen when the firmware sets the STOP bit in SMBCTL1 register
approximately half an SMB clock cycle following the last ACK bit in the
transaction.
Note:
1. This issue is not expected to occur when the core clock runs at
the default frequency (15 MHz). However, since more applications
reuquires higher core clock frequency, this commit introduce the
bypass to prevent the potential risk.
2. Only NPCXn variant chips require this workaround.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
There are multiple issues in this driver:
1. gpio_pca_series_part_cfg_pca6416 is not using correct macros
2. gpio_pca_series_interrupt_handler_standard not updating input when
no interrupt configured
Fixing these issues.
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
When setting endpoint capabilities, the driver uses the MPS stored in each
instance's configuration for OUT endpoints, but used a hardcoded 1023 for
IN endpoints.
Use the instance MPS when preparing IN endpoints' capabilities too.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
When cyclic mode is enabled, do not disable RX.
This mode ensures continuous availability of RX buffers.
Signed-off-by: Wojciech Slenska <wsl@trackunit.com>
Fix the STM32 DMA driver did not check if the optional dma_callback was
set in dma_stm32_configure(). This could lead to a hard fault when an
interrupt occurs and the callback is NULL, even though the API allows
the callback to be omitted.
Fixes#97454
Signed-off-by: Wenxi Xu <xuwenxi0517@gmail.com>
Instead of snooping SETUP packets for SET_ADDRESS request to call the HAL
SetAddress() function manually, mark device with the addr_before_status
capability such that the UDC stack will call udc_stm32_set_address()
before submitting status by itself.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Fix the issue regarding passing the TRNG peripheral instance to the driver.
Increase the SYSTEM_WORKQUEUE_STACK_SIZE when CONFIG_BT is set.
According to the log of thread analyzer for beacon sample, 1048 bytes
are needed. So, it's been increased to a safer value.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Exclude the WB0x series from discarding data 12 times from the RNG data
register.
Add a comment to the recover_seed_error function explaining the reason
for reading and discarding data from the RNG data register 12 times.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Fix the TRNG driver issue regarding non-stop ISR firing for STM32WB09 by
clearing RNG_IRQ_SR_ERROR_IRQ flag.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
MCXW2XX ROMAPI provide the function FLASH_CacheClear to clear the cache.
The SMSCM is not supported on MCXW2XX platform.
Signed-off-by: Allen Zhang <chunfeng.zhang@nxp.com>
Add a name to the "Wi-Fi MAC address type" choice symbol so that the
default can be updated on a per-board basis.
Signed-off-by: Jordan Yates <jordan@embeint.com>
When alloc the evt buffer,such as the adv report, only compare the
remaining data len, should aslo consider the hdr_len, because the
hdr also copy to alloced buffer.if not consider the hdr, then
hdr + remaining data may larger than alloced buffer, because the
alloced buffer is not enough,then will assert when receive the
remaining data.
Signed-off-by: Guotao Zhang <guotao.zhang@nxp.com>
This fix addresses the issue encountered when power management (pm)
is enabled, as the PWM test suites utilize the GPIO driver, which
now incorporates the latest power domain enhancements and requires
CONFIG_POWER_DOMAIN to be enabled. Power domain functionality
manages device power actions such as turning on and off.
Accordingly, the pm device support for the pwm_silabs_siwx91x
driver has been updated to align with the recent power domain
improvements.
Signed-off-by: S Mohamed Fiaz <Fiaz.Mohamed@silabs.com>
Remove Device Runtime PM "hack" used for modem cellular driver
initialization and use pm_device_driver_init() instead.
Signed-off-by: Tomas Gudelevičius <tomas.gudelevicius@draeger.com>