On the stm32U3 with 512K of flash in a single bank,
reset the BKER bit of the FLASH_CR register.
See RefMan Table Flash module organization"
Note "2. When DUALBANK is set to 0 in the option bytes,
for 512-Kbyte single-bank STM32U375/385 devices,
the flash is addressed as a single bank,
and the page numbers are continuous from 0 to 127.
Set BKER = 0 to select bank 1."
Signed-off-by: Francois Ramu <francois.ramu@st.com>
On the stm32U3 series, erase/program operation requires
the voltage range is set to range 1.
This is done before loop on erase/write and the initial voltage
range is restored afterwards.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
On the stm32U3, like it is on the stm32U5 series,
gives the exact nb of pages of 4KB depending on the flash size.
For the page layout, the nb of pages does not depends on the
DUALBANK option byte.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Add serial driver support for Renesas RZ/G3E
Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
The clock initialization for RX devices is not appropriate when it is
placed under the root clock node. Without an external fixed clock on the
board, the clock is never initialized. Therefore, the clock
setup must be handled inside soc_early_init_hook.
Signed-off-by: Y Huynh <y.huynh.xw@renesas.com>
Reconfigure the bandcfg when disabling AP so that the band
configurations are match between hostapd and wifi driver.
Signed-off-by: Hui Bai <hui.bai@nxp.com>
rename gpio_step_dir.c to gpio_step_dir_stepper_ctrl.c
rename h_bridge_stepper.c to h_bridge_stepper_ctrl.c
remover zephyr prefix from gpio_step_dir_stepper_ctrl.c structs
add ctrl suffix to h_bridge_stepper_ctrl.c structs and function
rename in kconfig to match
adds a prefix STEPPER_ in cmake to comply the changes in the kconfig
Signed-off-by: Mustafa Taher <mustafataherramp@gmail.com>
- Enables GPIO input+output mode to enable gpio_api_1pin test
- Retains current pin state when no output init flag specified.
- Adds pull up register validation, sets pull up register in
both pull-up and pull-up+pull-down cases.
Signed-off-by: John Batch <john.batch@infineon.com>
Refactors the drive mode selection logic for input and output pins into
dedicated helper functions.
Signed-off-by: John Batch <john.batch@infineon.com>
Add CCOUNT compensation for time spent in LPM mode (CPU stalled).
Add sys_clock_idle_exit() for dticks announcement when leaving LPM.
Add hooks for SoC specific implementation of LP timer timestamp call.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Modify driver to process interrupts from upper half ISR then signal a
bottom half ISR thread which performs callback invokation. This ensures
callbacks run in thread context which is necessary for proper operation of
various classes.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
In the bt_hci_stm32wba_send() function, in case of the function
bt_buf_get_evt() fails, call k_sem_give() before return.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
Restore the channel in the stm32wba_802154_start()
function because channel is reset by the link layer
when the stm32wba_802154_ral_sleep() is called
in the stm32wba_802154_stop() function.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
Disable continuous reception when ieee802154 stop
is called.
Configure continuous reception when ieee802154 start
is called.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
Add FM_Init() function call in the Flash driver initialization
to initialize the Flash Module.
This function is introduced by the STM32Cube_FW_WBA_V1.8.0
release.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
When tickless is enabled, it is necessary to ensure
that lptmr can be set for a period of time instead of generating
an interrupt at one tick.
LPTMR hardware does not synchronize writes to the
compare register (CMR)
If CMR is changed exactly when the counter increments,
the hardware may compare part of the counter against
the old CMR value and part against the new one, leading to TCF
being set incorrectly on some SoCs.
Reorder the update sequence to:
- disable the LPTMR interrupt,
- clear TCF,
- write the new CMR,
- re-enable the interrupt.
This provides a safe workaround for tickless mode case.
Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
Add support for prescaler bypass configuration via devicetree
property. This aligns the timer driver with the counter driver
implementation.
Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
Logic for error handling for CE polarity was inverted, causing
configuration to incorrectly return early without completing
the configuration when a valid CE polarity was provided.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
On MAX32 SoCs, some timer instances can use an external clock input.
This commit ensures that when the external clock is selected as the
source, its frequency is read and used correctly.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
MAX32 timers can optionally use external input/output pins.
Enable pinctrl support in the counter driver so these pins
can be properly configured via device tree.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Properly handle the scenario where the reset GPIO is not connected, and
simply rely on software reset during init.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
Now that requesting ACLK made it into PDM driver,
allow it on target with CLKSELECT as long as
clock control is enabled.
Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
Refer to this comment for more information:
https://github.com/zephyrproject-rtos/zephyr/pull/92923#discussion_r2637725041
This patch enables Non-Secure mode support for the RP2350 MBOX
driver. It replaces the hardcoded SIO base address with the address
derived from the devicetree parent node. This allows the driver to
use the correct hardware alias in both Secure and Non-Secure contexts.
Signed-off-by: Raul Hernandez <raul.hernandez@spaceface.dev>
Fix incorrect array index on line 101. Should use cfg_idx (which accounts
for non-contiguous pin layouts) instead of pin when accessing pin_muxes
array elements. This prevents potential out-of-bounds access and ensures
correct pull configuration on i.MX RT118x SOCs.
Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
Remove inclusions that date back to the original addition of this driver
and that are no more required when PSA API is used.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
i3c_ccc_do_setvendor() uses I3C_CCC_VENDOR(false, id) indicating a
direct CCC, but never sets up the target payload with the target's
address. The memset zeros out targets.num_targets and targets.payloads,
so the CCC is sent with no target address.
Add a ccc_tgt_payload with the target's dynamic address and the
write data, matching how i3c_ccc_do_getvendor() is structured.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
i3c_ccc_do_rstdaa() sets rnw = 1 (read) for the directed RSTDAA CCC,
but per the I3C spec RSTDAA is a Direct Write CCC with zero data
bytes. This causes the wrong R/W bit to be driven on the bus header.
Change rnw to 0 to correctly indicate a write operation.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
i3c_device_desc_alloc() and i3c_i2c_device_desc_alloc() leave the
local desc pointer uninitialized when k_mem_slab_alloc() fails. The
uninitialized garbage is returned to callers that check for NULL,
causing them to dereference a random pointer instead of handling
the allocation failure.
Initialize desc to NULL so callers correctly detect the failure.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
i3c_sec_bus_reset() iterates over the attached I3C and I2C device lists
using SYS_SLIST_FOR_EACH_CONTAINER while removing each node via
i3c_detach_i3c_device()/i3c_detach_i2c_device(). The non-safe iterator
reads the current node's next pointer to advance, but detaching
invalidates that pointer. This causes the loop to either stop early
(skipping devices) or access stale memory.
Add I3C_BUS_FOR_EACH_I3CDEV_SAFE and I3C_BUS_FOR_EACH_I2CDEV_SAFE
macros that wrap SYS_SLIST_FOR_EACH_CONTAINER_SAFE, which saves the
next pointer before executing the loop body. Use these in
i3c_sec_bus_reset() so nodes can be safely detached during iteration.
Also add the new macros to .clang-format ForEachMacros list.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
i3c_sec_get_basic_info() attaches a stack-allocated temp_desc to the
persistent device linked list via i3c_attach_i3c_device(). If
i3c_ccc_do_getpid() fails or i3c_device_desc_alloc() returns NULL, the
function returns without detaching temp_desc. Once the stack frame is
reclaimed, the linked list contains a dangling pointer, corrupting
memory on any subsequent list traversal.
Add i3c_detach_i3c_device(&temp_desc) before each early return to
ensure the stack-allocated descriptor is removed from the list.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
i3c_bus_setmrl() accepts an ibi_len parameter and uses it to update the
cached descriptor value, but never sets mrl_cmd.ibi_len before sending
the SETMRL CCC on the wire. This means the IBI payload size byte sent
to the target is uninitialized stack data when BCR[2]=1.
Set mrl_cmd.ibi_len = ibi_len so the CCC payload matches the spec
(MIPI I3C v1.2 Section 5.1.9.3.15).
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Add driver for the AC057TC1 5.7-inch 7-color electrophoretic (e-ink)
display. The driver supports MIPI DBI 4-wire SPI mode and includes:
- GPIO interrupt-driven busy signal handling with semaphore-based waiting
- Deep sleep and PM device support for power management
- 4-bit per pixel (2 pixels per byte) color format with 7 color palette
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
The issues fixed for i2c transfer using polling and interrupt
modes which was observed while testing with the pic32cm_jh_01
boards.
Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
When pinctrl_apply_state() returns 0 (success), the previous condition
(ret != -ENOENT) caused an early return, so i2c_bitbang_init() and
i2c_bitbang_configure() were never run. Only -ENOENT (no pinctrl
entry) should be ignored; real errors should still abort init.
Fix by returning only when ret < 0 && ret != -ENOENT.
Signed-off-by: Leevi Xu <leevi.xu@evenrealities.com>
Initial SAU UART driver support for Renesas RA0 series
Signed-off-by: Khoa Tran <khoa.tran.yj@bp.renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
- Update Renesas RA GPIO driver to support Renesas RA0 series
- Add macro to disable port external interrupt the the compatible
nodes `renesas,ra-external-interrupt` are not enabled.
Signed-off-by: Khoa Tran <khoa.tran.yj@bp.renesas.com>
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
Reduce the complexity of the set-alarm and set-top functions.
Improve the error handling.
Replace IRQ macros with static inline functions to centralize GIC/NVIC
conditional handling.
Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Move the non-RGB mapping code into an update function.
This creates simpler functions and makes implementation of LED strip API's
update_channels function simpler.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>