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>
nRF targets no longer need to reconfigure
CONFIG_VAR_LENGTH_BUFFER_TEST_BUADRATE_LIMIT as test is passing with
the default settings.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Aligning configurations for Nordic targets after changes in the driver.
CONFIG_UART_x_NRF_HW_ASYNC_TIMER option is deprecated. Where valid
Device Tree configuration is added.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
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>
In sample that is using a cellular modem on nrf9160dk the UART driver
feature was enabled to use TIMER peripheral for byte counting. It used
to be required to reliably received data even with HWFC. Some time ago
default receiver has been changed and UART with HWFC is able to reliably
receive data without need of using TIMER and PPI for byte counting.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
RX pin must have pull-up like in other boards. It is needed because
2 UART instances are connected and order of initialization is unknown
so if receiver is initialized before the transmitter then RX pin may
float and it can result in the unexpected receiver error.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add pull-ups to all pins when in sleep state. Otherwise, those pins are
floating and can lead to test failures.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Extend test to run a scenario where receiver is continuously providing
1 byte buffers and tries to receive loselessly data to that short
buffers.
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>
To pass the test with chopped TX data a dedicated TIMER for byte
counting need to be used.
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>
Zephyr `<type>_ROOT`s, such as `BOARD_ROOT`, `DTS_ROOT`, `SCA_ROOT`,
are initialed by ROOT settings provided through CMake variable
`<type>_ROOT`, Zephyr base, and root settings specified in Zephyr
module's `zephyr/module.yml` file.
`SNIPPET_ROOT` didn't follow the same pattern as it also included
application source dir.
This commit aligns `SNIPPET_ROOT` to follow same principle for
constructing other Zephyr `<type>_ROOT` lists.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The BOARD_QUALIFIERS no longer contains a leading '/' so to
extract the base filename, we need to start one character
earlier so that NSIM_BASE_FILENAME contains the correct stem
which is used to find the props files.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Set the FCS option to BT_L2CAP_BR_FCS_16BIT for enhanced retransmission
mode in both L2CAP accept and connect paths to work around an
interoperability issue with iPhone devices.
The issue occurs when connecting to iPhone for PBAP or MAP profiles,
where the iPhone expects the 'No FCS' option to be applied but does
not include the 'No FCS' option in its L2CAP_CONFIGURATION_REQ packet.
Forcing 16-bit FCS ensures proper configuration negotiation.
Changes include:
- Set rx.fcs to BT_L2CAP_BR_FCS_16BIT in goep_l2cap_accept()
- Set rx.fcs to BT_L2CAP_BR_FCS_16BIT in
bt_goep_transport_l2cap_connect()
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.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>
When a fatal error occurs before the kernel is fully initialized
(e.g., during early boot), the ztest fatal error handler would call
k_current_get() which now contains an assertion that fails if called
pre-kernel (added in commit 5ce408b647 ("kernel: assert if
k_current_get is called pre-kernel")). This assertion failure
triggers another panic, creating an infinite recursion that floods
the console with nonsensical values.
Check k_is_pre_kernel() to decide which method to use: _current
directly when pre-kernel (to avoid the k_current_get assertion), or
k_current_get() otherwise for proper userspace and TLS support.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Corrects pinmux definitions for SCB1 UART on P6 to match the datasheet.
Corrects pinmux definition for P0.2 scb0_uart_cts.
Signed-off-by: John Batch <john.batch@infineon.com>
Enhance the HL78xx public API header with comprehensive Doxygen
documentation. Replace legacy comments with structured Doxygen blocks,
expand enum and macro descriptions, and document API function pointer
signatures and GNSS callback types.
Group constants using @defgroup, add missing parameter docs, annotate
event structures, GNSS types, and RAT/CFUN definitions, and improve
readability of modem info and network APIs.
No functional changes; documentation only.
Signed-off-by: Zafer SEN <zafersn93@gmail.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>
Add HL78xx GNSS support to the sample, including GNSS data/satellite
callbacks, optional auxiliary NMEA parsing, and a guided demo flow
that runs GNSS first when the modem boots in minimum functionality.
Key changes:
- Disable shell wildcard expansion to avoid unintended command matches
(CONFIG_SHELL_WILDCARD=n).
- Enable GNSS core and HL78xx GNSS integration.
- Configure satellites reporting and cap to 24 for concise logs.
- Start GNSS in AUTO mode and use GPS+GLONASS constellations.
- Boot modem in airplane (minimum functionality) to allow GNSS RF use.
- Support GNSSLOC (latest known fix) as an alternative to NMEA.
- Add optional NMEA output path and auxiliary NMEA sentence parsing.
- Add detailed logging for fixes, quality, HDOP, and satellites-in-view.
- Handle GNSS engine lifecycle and position events via evt monitor.
- Provide demo flow to:
1) Enter GNSS mode, 2) queue search, 3) wait for fix,
4) optionally query GNSSLOC, 5) exit GNSS and return to LTE.
- Rework sample boot path to run GNSS before LTE when not fully
functional, then reconnect to the network.
- After successful FOTA, re-run the app path to show updated modem info.
Behavior and impact:
- When GNSS is disabled, sample behavior remains unchanged.
- When GNSS is enabled, sample can collect a fix before LTE attach.
- LTE/GNSS RF sharing is respected; GNSS start is blocked if LTE is
active; airplane mode is used to permit GNSS operation.
- Enhanced logs improve visibility during field testing and demos.
Configuration highlights:
- CONFIG_SHELL_WILDCARD=n
- CONFIG_GNSS=y
- CONFIG_HL78XX_GNSS=y
- CONFIG_GNSS_SATELLITES=y
- CONFIG_HL78XX_GNSS_SATELLITES_COUNT=24
- CONFIG_HL78XX_GNSS_START_MODE_AUTO=y
- CONFIG_HL78XX_GNSS_CONSTELLATIONS_GPS_GLONASS=y
- CONFIG_MODEM_HL78XX_BOOT_IN_AIRPLANE_MODE=y
- CONFIG_HL78XX_GNSS_SOURCE_LOC=y
- Optional NMEA/AUX:
- CONFIG_HL78XX_GNSS_SOURCE_NMEA=y
- CONFIG_HL78XX_GNSS_AUX_DATA_PARSER=y
- CONFIG_HL78XX_GNSS_ADVANCED_NMEA_CONFIG=y
- CONFIG_HL78XX_GNSS_NMEA_{VTG,GNS,GLL,ZDA}=y
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Adjust the SWIR HL78xx EVK overlay to improve stability and TLS
compatibility when connecting to AWS IoT.
- Increase main stack and heap sizes for MQTT/TLS workloads
- Select an RSA-based TLS cipher suite supported by AWS IoT
- Disable the ECDSA-only cipher suite not used with RSA certificates
No functional logic changes; configuration-only update for the sample.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Convert modem info enum comments from placeholder syntax to proper
Doxygen `/** ... */` style and replace angle‑bracket markers with
escaped forms inside inline documentation.
Also fix comment formatting in RSSI/RSRP parsing helpers so that
embedded AT command response formats render correctly in generated
docs.
No functional changes; documentation-only cleanup.
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>
Move state retrieval before error handling to ensure it's always
available for subsequent checks. Add a check to prevent executing
the callback when the AG connection is in a disconnected state.
This prevents potential use-after-free or invalid state access when
the callback is invoked after the AG has been disconnected, improving
the robustness of the notification work handler.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When using LLEXT, instruction TLB multi-hit becomes a reality
as the same memory space can be occupied by different modules
with different permissions. The ITLB cache may still contain
entries of the unloaded module. So we need to manually
invalidate any cached ITLB corresponding to the exception
address so the TLB associated with the newly loaded module
can be used.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
There is no need to invalidate the whole auto-refilled data TLB
cache when DTLB multi-hit exception is raised. Now it only
invalidates the TLB entries corresponding to the one causing
the DTLB multi-hit. This allows other non-related TLB entries
to remain in the cache so they don't need to be reloaded.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
For both data TLB multi-hit and load/store ring error, we should
return to the interrupted thread immediately so that it can get
past the exception generated code. It is because both of these
exceptions are the result of having cached TLB entries not
aligning to the correct access pattern. So once we have handled
the exception, go back to the interrupted thread to continue
to minimize the chance of having another incompatible TLB being
cached.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
There is no need for an extra switch block to manipulate
the value of is_fatal_error, which defaults to false, and is set
according to the actual exception above. So remove that.
Signed-off-by: Daniel Leung <daniel.leung@intel.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>
Document ARM Pointer Authentication (PAC) and Branch Target
Identification (BTI) in the control flow integrity guide, parallel
to the existing Intel CET documentation.
Also reorganized the limitations section to be specific to Intel CET
rather than appearing as a general CFI limitation.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>