Commit 46167e32 authored by Jordan Yates's avatar Jordan Yates Committed by Anas Nashif
Browse files

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: default avatarJordan Yates <jordan@embeint.com>
parent 1bbfbef8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(tfm_build_config)

target_sources(app PRIVATE src/main.c)
+1 −0
Original line number Diff line number Diff line
# nothing here
+29 −0
Original line number Diff line number Diff line
sample:
  description: Test TF-M builds in various configurations
  name: TF-M build configuration
common:
  tags:
    - trusted-firmware-m
  platform_allow:
    - mps2/an521/cpu0/ns
    - v2m_musca_s1/musca_s1/ns
    - nrf5340dk/nrf5340/cpuapp/ns
    - nrf9160dk/nrf9160/ns
    - bl5340_dvk/nrf5340/cpuapp/ns
  harness: console
  harness_config:
    type: one_line
    regex:
      - "Hello World! (.*)"
tests:
  sample.config_build.no_bl2:
    extra_configs:
      - CONFIG_TFM_BL2=n
  sample.config_build.single_image:
    tags:
      - mcuboot
    platform_allow:
      # Platform fails no_bl2
      - stm32l562e_dk/stm32l562xx/ns
    extra_configs:
      - CONFIG_TFM_MCUBOOT_IMAGE_NUMBER=1
+14 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2024 Embeint Inc
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <stdio.h>

int main(void)
{
	printf("Hello World! %s\n", CONFIG_BOARD_TARGET);

	return 0;
}