Skip to content

Commit 46167e3

Browse files
JordanYatesnashif
authored andcommitted
samples: tfm: add build_config sample
Add a sample that can test various TF-M build options. For now we only test `CONFIG_TFM_BL2=n` and `CONFIG_TFM_MCUBOOT_IMAGE_NUMBER=1`. Signed-off-by: Jordan Yates <[email protected]>
1 parent 1bbfbef commit 46167e3

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.20.0)
4+
5+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
6+
project(tfm_build_config)
7+
8+
target_sources(app PRIVATE src/main.c)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# nothing here
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
sample:
2+
description: Test TF-M builds in various configurations
3+
name: TF-M build configuration
4+
common:
5+
tags:
6+
- trusted-firmware-m
7+
platform_allow:
8+
- mps2/an521/cpu0/ns
9+
- v2m_musca_s1/musca_s1/ns
10+
- nrf5340dk/nrf5340/cpuapp/ns
11+
- nrf9160dk/nrf9160/ns
12+
- bl5340_dvk/nrf5340/cpuapp/ns
13+
harness: console
14+
harness_config:
15+
type: one_line
16+
regex:
17+
- "Hello World! (.*)"
18+
tests:
19+
sample.config_build.no_bl2:
20+
extra_configs:
21+
- CONFIG_TFM_BL2=n
22+
sample.config_build.single_image:
23+
tags:
24+
- mcuboot
25+
platform_allow:
26+
# Platform fails no_bl2
27+
- stm32l562e_dk/stm32l562xx/ns
28+
extra_configs:
29+
- CONFIG_TFM_MCUBOOT_IMAGE_NUMBER=1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2024 Embeint Inc
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <stdio.h>
8+
9+
int main(void)
10+
{
11+
printf("Hello World! %s\n", CONFIG_BOARD_TARGET);
12+
13+
return 0;
14+
}

0 commit comments

Comments
 (0)