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>
When dealing with full frame write, ensure that the buffer content
is well flushed into memory so that the LTDC is able to access to the
correct data.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Rework the way stm32_ltdc_write function is written, splitting
into several functions in order to gain in readibility.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Add I2C driver support for Renesas RZ/A2M
Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
1. enable watchdog support
2. verified tests/drivers/watchdog/wdt_basic_api
Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
This patch enhances the UART shell by:
- Adding a config command to display the UART configuration;
- Displaying the current configuration when the command misses the last
parameter (usefull for command line editing).
Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
Some time ago a receiver mode for newer SoCs was introduced. It is
using TIMER to count RX bytes via PPI. Due to changes in the system
behavior it is not the same implementation as the one used on
legacy targets (nRF52x, nRF53x and nRF91x). New implementation is
using the Device Tree to assign a TIMER instance and old feature was
using Kconfig which is now obsolete and error prone since it is
easy to get resource usage conflict is some instances are managed
in Device Tree and some in Kconfig.
As a result to reliably receive data without HWFC user had to use
different configuration depending on the target.
Legacy implementation was using nrfx_timer and new one used HAL.
Patch attempts to align better those two similar but different
implementations by:
- deprecating Kconfig symbols for selecting TIMER instance in favor
of the Device Tree
- extracting common part like PPI initialization and some control
block fields
- Using TIMER HAL in both implementations.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Interrupt handler was handling events in a following order:
ENDRX, RXSTARTED, RXTO. This could lead to error if RX buffer
is short then with high baudrate RXSTARTED for the current
buffer could be handled together with ENDRX and in that case
uart_rx_buf_rsp called from RXSTARTED would return error as
reception is already finished due to handled ENDRX.
Reworking the driver to change that order to RXSTARTED, ENDRX,
RXTO.
Additionally, driver is optimize to only check HW events for
enabled interrupts. To achieve that, RX path interrupts are
all disabled then RX is disabled.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
With writing to `master_rxtx_addr` the transfer starts
and with that the interrupt for rx can also come at any time after it.
If that interrupt happens during
spi_context_update_tx, it can lead to some undefined behavior.
In my case I got a `Load access fault` due to some later code,
then wanting to read a write only area. Probably
`tx_count` in `struct spi_context` being decremented one to many,
so it would be the max value of size_t.
Also we don't want to do `spi_context_update_tx`
before `spi_context_wait_for_completion()`. As
it contains `spi_context_total_tx_len()` and that
needs the not incremented `current_tx`.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
In case of a warm boot, e.g., a boot in Asymmetric MultiProcessing
(AMP), the responsability of the priority initialisation should be
on the host only, as the priority are not set per context.
Signed-off-by: Román Cárdenas Rodríguez <rcardenas.rod@gmail.com>
Signed-off-by: Pierre-Henry Moussay <pierre-henry.moussay@microchip.com>
Add riscv_plic_irq_complete and make it available for kernel.
This is useful for Asymmetric MultiProcessing (AMP) configuration,
where the platform can be rebooted from the host side and the request
is processed in a interruption context.
Signed-off-by: Román Cárdenas Rodríguez <rcardenas.rod@gmail.com>
Signed-off-by: Pierre-Henry Moussay <pierre-henry.moussay@microchip.com>
Replace hardcoded numeric timeout values with named HL78XX_CMD_TIMEOUT_*
and HL78XX_SCRIPT_TIMEOUT_* constants. These values follow the HL78xx
AT Command Reference Guide recommended timing ranges.
Update all chat script definitions to use the new timeout groups:
- FAST, SHORT, MEDIUM, LONG, VERY_LONG, EXTENDED command timeouts
- INIT, POST_RESTART, PERIODIC, NETWORK, POWEROFF, GNSS script timeouts
This improves maintainability, avoids duplicated magic numbers, and
aligns timing behavior across the driver and chat scripts.
No functional changes intended aside from consistent timeout handling.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Introduce optional Assisted GNSS (A-GNSS) support for HL78xx GNSS using
AT+GNSSAD commands (MODEM_HL78XX_12 only).
Add Kconfig to enable the feature, extend the GNSS driver state to keep
A-GNSS validity/expiry, and add chat parsing for +GNSSAD responses.
New public APIs allow applications to:
- query assistance status (AT+GNSSAD?)
- request assistance download for supported day values
(AT+GNSSAD=1,<days>)
- delete stored assistance data (AT+GNSSAD=0)
The feature is guarded by CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE and
adds no behavior changes when disabled.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Add comprehensive GNSS functionality to the HL78xx modem driver,
enabling GPS/GLONASS positioning for Sierra Wireless HL78xx modules.
Key features:
- GNSS data acquisition via NMEA0183 and proprietary GNSSLOC
- Automatic RF path management (GNSS requires airplane mode)
- State machine integration for LTE ↔ GNSS mode switching
- Configurable NMEA sentence output and satellite tracking
- Search timeout and configuration safety checks
- Event-based position updates and satellite info
Architecture:
The implementation uses explicit mode switching APIs
(hl78xx_enter_gnss_mode/hl78xx_exit_gnss_mode) to manage the
shared RF path between LTE and GNSS. The HL78xx hardware shares
RF components between the LTE and GNSS radios, preventing
simultaneous operation.
Currently, GNSS mode requires entering airplane mode (CFUN=4) to
disable the LTE radio. This approach is necessary because the
driver does not yet implement PSM (Power Saving Mode) or
Idle-eDRX, which would allow GNSS operation during LTE idle
periods. Future enhancements can leverage these power-saving modes
to enable GNSS searches without fully disabling LTE connectivity.
A pending request mechanism handles early GNSS mode requests that
arrive before modem initialization completes, ensuring reliable
startup behavior in both fully-functional and airplane boot modes.
The driver integrates with Zephyr's GNSS subsystem and provides
HL78xx-specific extensions through a dedicated API header.
New files:
- drivers/modem/hl78xx/hl78xx_gnss.c/h: Core GNSS driver
- drivers/modem/hl78xx/hl78xx_gnss_parsers.c/h: NMEA/GNSSLOC parsing
- include/zephyr/drivers/modem/hl78xx_apis.h: Extended public APIs
Tested on HL7802/HL7812 modules with various GNSS scenarios.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Make DNS reconfigure path report errors and allow retries instead of
silently continuing after failures.
- Change dns_work_cb() to return int and propagate error conditions
- Reschedule DNS work on -EAGAIN in carrier-on timeout handler
- Log DNS update failures from +CGCONTRDP parsing
Improve socket receive robustness and concurrency.
- Move RX ring buffer from global to per-device instance storage
- Replace parser state booleans with atomic bit flags
- Reset parser flags at init and after completed transfers
- Add clearer error logs and propagate specific receive failures
- Use compact initializer style for crafted net_msghdr
- Raise parent mismatch log from warning to error
No functional behavior change expected on success paths, but failures
now surface and recovery can be retried.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Remove CONFIG_PM_DEVICE guards around the HL78xx PM handler so it is
always compiled. Register the driver PM action with
pm_device_driver_init() during init and return its result. Drop the
manual resume path and pm_device_init_suspended() branch.
This aligns the driver with the Zephyr PM framework and lets the PM core
manage suspend/resume consistently.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Introduce CONFIG_MODEM_HL78XX_COMMAND_BUFFER_SIZE to control the AT
command buffer size. Add cmd_buffer and cmd_len to modem_buffers and
dynamic_script/dynamic_chat to hl78xx_data to support dynamic scripts.
Add modem_dynamic_cmd_send_async() to send commands asynchronously with
response matching and a user callback. This complements the existing
synchronous path and improves flexibility for non-blocking operations.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
The MODEM_CHAT_SCRIPT_DEFINE timeout parameter was mistakenly treated as
milliseconds, but the API expects the value in seconds. Update the
timeout from CONFIG_MODEM_AT_SHELL_RESPONSE_TIMEOUT_MS to a fixed value
of 5 to reflect the correct unit.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Add the `DEVICE_API` wrapper to the remaining `spi_driver_api` instances,
ensuring that each driver API is placed in its respective linker section.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
The MSPM0 clock control code sets clk0 as the MCLK source without
checking if clk0 is enabled. This seems to cause the CPU to not run.
The changes in this commit will set clk0 as the MCLK source only if the
clk0 is enabled. The clk0 is considered enabled if a user defines the
the clk0-div property for the syspll node in the devicetree.
The mspm0g.dtsi defines the clk2x-div property for the syspll node in
the devicetree. The clock control code as is only allows either the
clk2x-div or the clk0-div property to be set but not both. This
essentially means the syspllclk2x was enabled, but clk0 was set as the
MCLK source.
The fix would also allow users to continue using the syspll node as it
is defined in the mspm0g.dtsi without having to override the node for each
board.
Signed-off-by: Lay Desai <lay.desai@he360.com>
Initialize p_reg with the register base address from devicetree.
Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Initialize p_reg with the register base address from devicetree.
Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Initialize p_reg with the register base address from devicetree.
Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>