-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snippets: add new snippet for uart based modem trace
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 kept for backwards compatibility. Signed-off-by: Andreas Moltumyr <[email protected]>
- Loading branch information
Showing
6 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
snippets/nrf9x-modem-trace-uart/modem-trace-uart-common.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Copyright (c) 2025 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
CONFIG_NRF_MODEM_LIB_TRACE=y | ||
|
||
# Modem trace uart backend | ||
CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART=y | ||
|
||
# UART configuration (common) | ||
CONFIG_SERIAL=y | ||
CONFIG_UART_ASYNC_API=y |
12 changes: 12 additions & 0 deletions
12
snippets/nrf9x-modem-trace-uart/modem-trace-uart-nrf91.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
17 changes: 17 additions & 0 deletions
17
snippets/nrf9x-modem-trace-uart/modem-trace-uart-nrf91.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/* Enable uart1 for tracing. */ | ||
&uart1 { | ||
status = "okay"; | ||
current-speed = < 1000000 >; | ||
}; | ||
|
||
/ { | ||
chosen { | ||
nordic,modem-trace-uart = &uart1; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
41
snippets/nrf9x-modem-trace-uart/modem-trace-uart-nrf92.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |