Skip to content

Commit 9837c7a

Browse files
committed
samples: boards: infineon: board specific samples
- Sample required to enable CM7 cores on XMC7200 Signed-off-by: Sreeram Tatapudi <[email protected]>
1 parent 53c79c6 commit 9837c7a

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

samples/boards/infineon/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. zephyr:code-sample-category:: Infineon
2+
:name: Infineon
3+
:show-listing:
4+
:glob: **/*
5+
6+
These samples showcase the use of Infineon boards in Zephyr.
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(xmc7200_m0plus_start)
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+
CONFIG_LOG=y
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
sample:
2+
description: Enables the M7_0 and M7_1 cores
3+
name: XMC7200 M0+ Start
4+
5+
common:
6+
platform_allow:
7+
- kit_xmc72_evk/xmc7200d_e272k8384/m0p
8+
tags: introduction
9+
harness: console
10+
harness_config:
11+
type: one_line
12+
regex:
13+
- "CM0 - kit_xmc72_evk/xmc7200d_e272k8384/m0p"
14+
15+
tests:
16+
sample.boards.m0plus_start:
17+
extra_args: EXTRA_CFLAGS=-DENABLE_CM7_0=1
18+
19+
sample.boards.m7_0_start:
20+
extra_args: EXTRA_CFLAGS=-DENABLE_CM7_1=0
21+
22+
sample.boards.m7_1_start:
23+
extra_args: EXTRA_CFLAGS=-DENABLE_CM7_0=0
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright (c) 2025 Cypress Semiconductor Corporation (an Infineon company) or
3+
* an affiliate of Cypress Semiconductor Corporation
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <zephyr/kernel.h>
9+
#include <stdio.h>
10+
#include "cy_pdl.h"
11+
12+
#undef CY_CORTEX_M7_0_APPL_ADDR
13+
#undef CY_CORTEX_M7_1_APPL_ADDR
14+
#define CY_CORTEX_M7_0_APPL_ADDR 0x10080000
15+
#define CY_CORTEX_M7_1_APPL_ADDR 0x10280000
16+
17+
#define ENABLE_HEART_BEAT 0
18+
19+
int main(void)
20+
{
21+
/* \x1b[2J\x1b[;H - ANSI ESC sequence for clear screen */
22+
printf("\x1b[2J\x1b[;H");
23+
24+
k_msleep(1000);
25+
printf("=== CM0 - %s\n", CONFIG_BOARD_TARGET);
26+
27+
#if !defined(ENABLE_CM7_0) || ENABLE_CM7_0
28+
printf("=== CM0: Enable CM7_0\n");
29+
k_msleep(1000);
30+
Cy_SysEnableCM7(CORE_CM7_0, CY_CORTEX_M7_0_APPL_ADDR);
31+
#endif
32+
33+
#if !defined(ENABLE_CM7_1) || ENABLE_CM7_1
34+
k_msleep(1000);
35+
printf("=== CM0: Enable CM7_1\n");
36+
k_msleep(1000);
37+
Cy_SysEnableCM7(CORE_CM7_1, CY_CORTEX_M7_1_APPL_ADDR);
38+
#endif
39+
40+
for (;;) {
41+
#if ENABLE_HEART_BEAT
42+
k_msleep(1000);
43+
printf(".");
44+
#endif
45+
}
46+
}

0 commit comments

Comments
 (0)