Skip to content

Commit ce408aa

Browse files
nordic-krchnordic-segl
authored andcommitted
[nrf fromtree] samples: boards: nordic: coresight_stm: Add flpr and ppr support
Add flpr and ppr core to the sample. Since there are only 2 UARTs available on DK, local UART configuration is using only cpuapp and cpurad. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit d11997d)
1 parent 0684fbd commit ce408aa

File tree

6 files changed

+57
-15
lines changed

6 files changed

+57
-15
lines changed

samples/boards/nrf/coresight_stm/Kconfig.sysbuild

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
source "share/sysbuild/Kconfig"
66

7-
config RAD_CORE_BOARD
8-
string
9-
default "nrf54h20dk/nrf54h20/cpurad" if $(BOARD) = "nrf54h20dk"
7+
config APP_CPUPPR_RUN
8+
bool "Use PPR"
9+
10+
config APP_CPUFLPR_RUN
11+
bool "Use FLPR"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
&cpuppr_vpr {
7+
status = "okay";
8+
};
9+
10+
&cpuppr_ram3x_region {
11+
status = "okay";
12+
};
13+
14+
&cpuflpr_vpr {
15+
status = "okay";
16+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
CONFIG_LOG=y
2+
CONFIG_CONSOLE=n
3+
CONFIG_UART_CONSOLE=n
4+
CONFIG_SERIAL=n
5+
CONFIG_BOOT_BANNER=n
6+
CONFIG_PRINTK=n

samples/boards/nrf/coresight_stm/sample.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ tests:
1111
build_only: true
1212
required_snippets:
1313
- nordic-log-stm-dict
14+
extra_args:
15+
- SB_CONFIG_APP_CPUPPR_RUN=y
16+
- SB_CONFIG_APP_CPUFLPR_RUN=y
1417
sample.boards.nrf.coresight_stm:
1518
platform_allow:
1619
- nrf54h20dk/nrf54h20/cpuapp
@@ -26,6 +29,9 @@ tests:
2629
- "Timing for log message with 2 arguments:"
2730
- "Timing for log message with 3 arguments:"
2831
- "Timing for log_message with string:"
32+
extra_args:
33+
- SB_CONFIG_APP_CPUPPR_RUN=y
34+
- SB_CONFIG_APP_CPUFLPR_RUN=y
2935
required_snippets:
3036
- nordic-log-stm
3137
sample.boards.nrf.coresight_stm.local_uart:

samples/boards/nrf/coresight_stm/src/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
#include <zephyr/kernel.h>
8-
#include <zephyr/sys/printk.h>
98
#include <zephyr/logging/log.h>
109

1110
#ifdef CONFIG_LOG_FRONTEND_STMESP
@@ -37,6 +36,8 @@ static void get_core_name(void)
3736
core_name = "rad";
3837
} else if (strstr(CONFIG_BOARD_TARGET, "cpuppr")) {
3938
core_name = "ppr";
39+
} else if (strstr(CONFIG_BOARD_TARGET, "cpuflpr")) {
40+
core_name = "flpr";
4041
}
4142
}
4243

@@ -49,7 +50,7 @@ static void timing_report(uint32_t t, uint32_t rpt, const char *str)
4950
{
5051
uint32_t ns = t_to_ns(t, rpt, CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC);
5152

52-
printk("%s: Timing for %s: %d.%dus\n", core_name, str, ns / 1000, (ns % 1000) / 10);
53+
LOG_RAW("%s: Timing for %s: %d.%dus\n", core_name, str, ns / 1000, (ns % 1000) / 10);
5354
}
5455

5556
int main(void)
Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
# Copyright (c) 2024 Nordic Semiconductor ASA
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if("${SB_CONFIG_RAD_CORE_BOARD}" STREQUAL "")
5-
message(FATAL_ERROR
6-
"Target ${BOARD} not supported for this sample. "
7-
"There is no remote board selected in Kconfig.sysbuild")
8-
endif()
9-
10-
set(RAD_APP remote)
4+
set(REMOTE_APP remote)
115

126
ExternalZephyrProject_Add(
13-
APPLICATION ${RAD_APP}
14-
SOURCE_DIR ${APP_DIR}/${RAD_APP}
15-
BOARD ${SB_CONFIG_RAD_CORE_BOARD}
7+
APPLICATION ${REMOTE_APP}_rad
8+
SOURCE_DIR ${APP_DIR}/${REMOTE_APP}
9+
BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpurad
1610
)
11+
12+
# There are sample configurations which do not use PPR.
13+
if(SB_CONFIG_APP_CPUPPR_RUN)
14+
ExternalZephyrProject_Add(
15+
APPLICATION ${REMOTE_APP}_ppr
16+
SOURCE_DIR ${APP_DIR}/${REMOTE_APP}
17+
BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpuppr
18+
)
19+
endif()
20+
21+
# There are sample configurations which do not use FLPR.
22+
if(SB_CONFIG_APP_CPUFLPR_RUN)
23+
ExternalZephyrProject_Add(
24+
APPLICATION ${REMOTE_APP}_flpr
25+
SOURCE_DIR ${APP_DIR}/${REMOTE_APP}
26+
BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpuflpr
27+
)
28+
endif()

0 commit comments

Comments
 (0)