Skip to content

Commit

Permalink
snippets: add new snippet for uart based modem trace
Browse files Browse the repository at this point in the history
Add new snippet 'nrf9x-modem-trace-uart'. The new snippet can be
used to enable modem tracing over uart for either nrf91 or nrf92
application. It works similar to snippet 'nrf91-modem-trace-uart'.

The 'nrf91-modem-trace-uart' snippet is deprecated, but kept for
backwards compatibility.

Signed-off-by: Andreas Moltumyr <[email protected]>
  • Loading branch information
anhmolt committed Feb 5, 2025
1 parent c814734 commit 8058a38
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 9 deletions.
11 changes: 9 additions & 2 deletions snippets/nrf91-modem-trace-uart/snippet.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
name: nrf91-modem-trace-uart
append:
EXTRA_DTC_OVERLAY_FILE: modem-trace-uart.overlay
EXTRA_CONF_FILE: overlay-modem-trace-uart.conf
EXTRA_CONF_FILE: ../nrf9x-modem-trace-uart/modem-trace-uart-common.conf

Check warning on line 3 in snippets/nrf91-modem-trace-uart/snippet.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (colons)

snippets/nrf91-modem-trace-uart/snippet.yml:3 too many spaces after colon

boards:
/.*/nrf91[0-9][0-9]/.*/:
append:
EXTRA_DTC_OVERLAY_FILE: ../nrf9x-modem-trace-uart/modem-trace-uart-nrf91.overlay
EXTRA_CONF_FILE: ../nrf9x-modem-trace-uart/modem-trace-uart-nrf91.conf

Check warning on line 10 in snippets/nrf91-modem-trace-uart/snippet.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (trailing-spaces)

snippets/nrf91-modem-trace-uart/snippet.yml:10 trailing spaces

Check failure on line 10 in snippets/nrf91-modem-trace-uart/snippet.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

snippets/nrf91-modem-trace-uart/snippet.yml:10 trailing whitespace
#Deprecated. Kept for backwards compatibility. Use snippet nrf9x-modem-trace-uart.

Check warning on line 11 in snippets/nrf91-modem-trace-uart/snippet.yml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (comments)

snippets/nrf91-modem-trace-uart/snippet.yml:11 missing starting space in comment
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Nordic Semiconductor
# Copyright (c) 2025 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
Expand All @@ -9,11 +9,6 @@ CONFIG_NRF_MODEM_LIB_TRACE=y
# Modem trace uart backend
CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART=y

# UART configuration
# UART configuration (common)
CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n

# Power management
CONFIG_PM_DEVICE=y
12 changes: 12 additions & 0 deletions snippets/nrf9x-modem-trace-uart/modem-trace-uart-nrf91.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2023 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# UART configuration (nRF91 specific)
CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n

# Power management
CONFIG_PM_DEVICE=y
9 changes: 9 additions & 0 deletions snippets/nrf9x-modem-trace-uart/modem-trace-uart-nrf92.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2025 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# UART configuration (nRF92 specific)
CONFIG_UART_135_ASYNC=y
CONFIG_UART_135_INTERRUPT_DRIVEN=n
41 changes: 41 additions & 0 deletions snippets/nrf9x-modem-trace-uart/modem-trace-uart-nrf92.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/* Enable uart135 for tracing. */
&uart135 {
status = "okay";
current-speed = < 1000000 >;
memory-regions = < &modem_trace_dma_region >;
};

/ {
chosen {
nordic,modem-trace-uart = &uart135;
};

reserved-memory {
/* Add memory region for tracing UART. */
modem_trace_dma_region: memory@2fc06800 {
compatible = "nordic,owned-memory", "zephyr,memory-region";
reg = <0x2fc06800 DT_SIZE_K(2)>;
status = "okay";
#memory-region-cells = <0>;
nordic,access = <NRF_OWNER_ID_APPLICATION NRF_PERM_RW>;
zephyr,memory-region = "DMA_RAM3x_MODEM_TRACE";
zephyr,memory-attr = <( DT_MEM_DMA )>;
};
};
};

/* Reduce size to make room for modem trace dma region. */
&cpuapp_dma_region {
reg = <0x2fc06000 DT_SIZE_K(2)>;
};

/* Enable the trace signal on the application bellboard. */
&cpuapp_bellboard {
nordic,interrupt-mapping = <0xE3042041 0>;
};
13 changes: 13 additions & 0 deletions snippets/nrf9x-modem-trace-uart/snippet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: nrf9x-modem-trace-uart
append:
EXTRA_CONF_FILE: modem-trace-uart-common.conf

boards:
/.*/nrf91[0-9][0-9]/ns/:
append:
EXTRA_DTC_OVERLAY_FILE: modem-trace-uart-nrf91.overlay
EXTRA_CONF_FILE: modem-trace-uart-nrf91.conf
/.*/nrf92[0-9][0-9]/cpuapp/:
append:
EXTRA_DTC_OVERLAY_FILE: modem-trace-uart-nrf92.overlay
EXTRA_CONF_FILE: modem-trace-uart-nrf92.conf

0 comments on commit 8058a38

Please sign in to comment.