The pointer to the clock device can be const, as it does never change at
runtime. This moves the const struct device *clock from data to config
struct and initializes it inside the init macro. The __uart_stm32_get_clock
function is no longer needed and removed.
Signed-off-by: Thomas Decker <decker@jb-lighting.de>
RSR handling is already implemented in pl011_err_check(), which is the
appropriate place to detect, and report receive error conditions.
This also aligns poll_in() behavior with pl011_fifo_read(), which reads
and delivers characters without returning RSR status to the caller.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
Until now transmission FIFO was not used.
With this chamge the FIFO will be filled up, until it is full.
Signed-off-by: Daniel Fladerer <d.fladerer@gmx.de>
NO_POSIX_CHEATS was a macro used to avoid including the content of a
header (`posix_cheats.h`) which allowed building applications in the
POSIX architecture without the native simulator, avoiding collisions
between some embedded symbols and those from the host C library.
Support for this way of building, and this header and macro were
removed in e150ffb92c, but these users
were forgotten. This was harmless, but let's just clean it up now.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The current driver implementation only support pooling and
synchronous operations. By adding DMA support the driver will
be able to operate in asynchronous mode which helps to improve
CPU usage and save power.
Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
The z_vrfy_uart_configure function was incorrectly checking for the
existence of the 'config_get' handler instead of 'configure'.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add the clock emablement in the LPUART driver to avoid
depending on the default enablement settings.
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Add devicetree properties to control UHCI SLIP encoding/decoding
when using UART with DMA (async API). Both properties default to
disabled to prevent unintended data corruption.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Drop cat1 from the binding files to enable reuse by other
category devices as well.
Fixes#99174
Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.
Duplicates inside different #ifdef branches are preserved
as they may be intentional.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
In async UART mode with DMA, the RX completion callback was incorrectly
relying on rx_counter which is never updated in DMA mode since data
bypasses the UART FIFO via UHCI+GDMA.
Fix by reading the actual transferred byte count from the DMA
descriptor's length field using gdma_ll_rx_get_success_eof_desc_addr().
Direct LL calls are used because this runs in ISR context where
dma_get_status() is not IRAM-safe.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Most of Espressif drivers ISRs are already running in IRAM area, except
those in this PR. Move ISRs accordingly so we avoid any
interrupt miss when cache is disabled.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Removed usart_intenset attribute from conditional compilation
in mcux_flexcomm_data structure since this parameter needs to
be saved/restored independently if the interrupts are enabled
or not based on the PR feedback
Signed-off-by: Missael Maciel <davidmissael.maciel@nxp.com>
The PM action saves the interrupts enabled using a
global variable called usart_intenset. The problem is
when you have multiple uart instances that have different
configurations, when entering/exiting from a power level,
only one configuration is saved and will be applied to all
uart instances when exiting from a power level. We need to
keep this setting individual for each instance. To do this,
usart_intenset was added as a new element to mcux_flexcomm_data
structure. In this way, each uart instance will keep/restore
each own setting.
Signed-off-by: Missael Maciel <davidmissael.maciel@nxp.com>
Extend UART_MAX32_TX_AE_WORKAROUND to also apply when building for
MAX32657.
Without this option, logging output may become fragmented or delayed
because TX interrupts fail to trigger reliably for small chunks of data.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
api_irq_update was clearing TX interrupt flags before the TX interrupt
could be served, breaking synchronization in time-sensitive applications.
Changes:
1. Remove unnecessary MXC_UART_ClearFlags() calls in api_fifo_read() and
api_irq_update to avoid premature flag clearing; ISR handler already
clears them after returning from the callback.
2. Replace raw flag checks in irq_is_pending() with more complete
api_irq_rx_ready() and api_irq_tx_ready().
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Add initial implementation of the Infineon PSOC4 UART driver based on the
Peripheral Driver Library (PDL) for PSOC4 (PSoC 4100TP) devices.
Features:
- UART transmit and receive using PDL SCB UART APIs
- Configurable baud rate, parity, stop bits, and data bits from devicetree
- Pinctrl integration for TX/RX pins
- Support for Zephyr console and shell subsystems
- Build-time validation for UART configuration parameters
Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
Signed-off-by: Deepika aerlync <deepika@aerlync.com>
When uart_ns16550_irq_tx_enable() is called and the TX FIFO is already
empty, no new interrupt is generated, causing data transmission to stall
in some cases. This patch introduces a workaround to simulate an ISR
callback if the FIFO is empty when enabling the TX IRQ.
Signed-off-by: Jacky Lee <jacky.lee@egistec.com>
The burst length unit is bytes, not number of transfers. This had not been
an issue since the DMA driver historically ignored the values, but has now
become one since they are used and (most importantly for us) validated.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
When not using the async API, the rx_woken flag can be set but cannot be
cleared, leading to an indefinitely locked pm state. This commit
prevents the flag from being set when not using the async API.
Signed-off-by: Adrien Lessard <adrien.lessard.42@gmail.com>
There can be a race conditon where another interrupt fires while it
is in the callback, but then the interrupt is cleared towards the
end of the interrupt. Clear the interrupts it intends to service
at the beginning of the ISR.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
New nrfx release contains major rework of nrfx drivers
instantiation making it easier to integrate with dts nodes.
Now, nrfx driver instances can no longer be `const`
because they contain driver runtime state.
Additionally, all nrfx drivers return `errno` error codes
instead of deprecated `nrfx_err_t`.
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
Add missing getting/putting of the device when the RX interrupt is
enabled/disabled. Also fix enabling and disabling of the TX interrupt
so that the device is got/put only if the interrupt wasn't already
enabled/disabled and device PM reference counting is done correctly.
This fixes `console_getchar()` that would hang when used with
`CONFIG_PM_DEVICE_RUNTIME=y`.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Simplify interrupt handler helper macros by removing
STM32_UART_IRQ_HANDLER_DECL(), using STM32_UART_IRQ_HANDLER() only
renamed STM32_UART_IRQ_HANDLER_DEFINE() and aggregating where the
macro and STM32_UART_IRQ_HANDLER_FUNC() macro are defined.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Clean indentation in local macros used to define UART instances.
Remove extra line escape ending CONFIG_UART_ASYNC_API() macro value.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
It is thus possible to enable CONFIG_UART_USE_RUNTIME_CONFIGURE for
this driver and re-configure a uart device at runtime.
Driver's init function was moved to the bottom of the file for two
reasons: to ease factorization and to follow the common device driver
source structure (usually: the init function is right before the
API structure and the instanciation macros).
Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
Fixes an issue with an unused function being defined if
CONFIG_DEVICE_DEINIT_SUPPORT was disabled
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Exclude SOC_CY8C6244LQI_S4D92 from UART async API support due to
hardware limitations, similar to SOC_FAMILY_INFINEON_CAT1C.
Signed-off-by: Yurii Lozynskyi <yurii.lozynskyi@infineon.com>
Fixes an issue with an unused function being defined if
CONFIG_DEVICE_DEINIT_SUPPORT was disabled
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The workaround for missing the almost-empty interrupt when TX of very small
payloads needs to also be applied for the UART on MAX32655, so default on
that workaround symbol on that target.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
Add mode to be used on UARTE with frame timeout which is using a bounce
buffers and TIMER to count bytes. This mode shall be used to reliably
receive data without HWFC as frame timeout approach is not 100% reliable
because it can loose or corrupt a byte when new byte arrives after
frame timeout is detected but before it is fully handled. This mode is
similar to the one enabled with CONFIG_UART_x_NRF_HW_ASYNC but
additional bounce buffers are used and UARTE is receiving data to
internal buffers and copies data to the user buffer. Legacy apporach
cannot be used because in new SoC DMA attempts to copy data in words
so when byte is received it stays in the DMA internal buffer until
4 bytes are received or end of transfer happens then internal DMA
buffer is flushed.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Rearrange code to prepare for upcoming extension that adds special
receive mode.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
In cb53e40ff9
the uart_native_posix driver was renamed to uart_native_pty while
deprecating the old kconfig options and bidning for the 4.2 release.
Let's remove them now.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
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>