Skip to content

Commit b65c2e3

Browse files
committed
samples: boards: stm32 hello_word application running in XiP mode
Samples to demonstrate the XiP mode when using an external NOR flash in MemoryMapped mode Signed-off-by: Francois Ramu <[email protected]>
1 parent f79df92 commit b65c2e3

File tree

5 files changed

+77
-0
lines changed

5 files changed

+77
-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(hello_world_xip)
7+
8+
target_sources(app PRIVATE src/main.c)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.. _hello_world_xip:
2+
3+
Hello World in XiP
4+
##################
5+
6+
Overview
7+
********
8+
9+
A simple sample that can be used with any :ref:`supported board <boards>`
10+
which has an external NOR octo- or quad- flash and
11+
prints "Hello World from external flash" to the console.
12+
13+
14+
Building and Running
15+
********************
16+
17+
This application can be built with
18+
west build -p always -b b_u585i_iot02a samples/boards/stm32/hello_world_xip/ --sysbuild -- -DSB_CONFIG_BOOTLOADER_MCUBOOT=y
19+
20+
and executed on b_u585i_iot02a as follows:
21+
22+
.. zephyr-app-commands::
23+
:zephyr-app: samples/boards/stm32/hello_world_xip
24+
:host-os: unix
25+
:board: b_u585i_iot02a
26+
:goals: run
27+
:compact:
28+
29+
To build for another board, change "b_u585i_iot02a" above to that board's name.
30+
31+
Sample Output
32+
=============
33+
34+
.. code-block:: console
35+
36+
Hello World! from external flash b_u585i_iot02a
37+
38+
39+
Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#CONFIG_XIP=y
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
sample:
2+
description: Hello World sample, the simplest Zephyr from external flash
3+
application
4+
name: hello world
5+
common:
6+
tags: introduction
7+
integration_platforms:
8+
- native_posix
9+
harness: console
10+
harness_config:
11+
type: one_line
12+
regex:
13+
- "Hello World! (.*)"
14+
tests:
15+
sample.basic.helloworld:
16+
tags: introduction
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2012-2014 Wind River Systems, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/kernel.h>
8+
9+
int main(void)
10+
{
11+
printk("Hello World! from external flash %s\n", CONFIG_BOARD);
12+
return 0;
13+
}

0 commit comments

Comments
 (0)