Skip to content

Commit df8b43d

Browse files
erwangocfriedt
authored andcommitted
boards: st: stm32h7s78_dk: Document use of ext_flash_app variant
As stated, document use of ext_flash_app variant (build, flash and debug). Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
1 parent da571ac commit df8b43d

File tree

1 file changed

+98
-14
lines changed

1 file changed

+98
-14
lines changed

boards/st/stm32h7s78_dk/doc/index.rst

Lines changed: 98 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -207,24 +207,16 @@ Programming and Debugging
207207
208208
STM32H7S78-DK Discovery board includes an ST-LINK/V3E embedded debug tool interface.
209209

210-
Applications for the ``stm32h7s78_dk`` board configuration can be built and
211-
flashed in the usual way (see :ref:`build_an_application` and
212-
:ref:`application_run` for more details).
213-
214-
Flashing
215-
========
216-
217210
The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
218211
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
219212

220-
Flashing an application to STM32H7S78-DK Discovery
221-
--------------------------------------------------
213+
Application in SoC Flash
214+
========================
222215

223-
Connect the STM32H7S78-DK Discovery to your host computer using the USB port.
224-
Then build and flash an application. Here is an example for the
225-
:zephyr:code-sample:`hello_world` application.
216+
Here is an example for the :zephyr:code-sample:`hello_world` application.
226217

227-
Run a serial host program to connect with your Nucleo board:
218+
Connect the STM32H7S78-DK Discovery to your host computer using the USB port,
219+
then run a serial host program to connect with your Nucleo board:
228220

229221
.. code-block:: console
230222
@@ -243,8 +235,12 @@ You should see the following message on the console:
243235
244236
Hello World! stm32h7s78_dk
245237
238+
If the application size is too big to fit in SoC Flash,
239+
Zephyr :ref:`Code and Data Relocation <code_data_relocation>` can be used to relocate
240+
the non-critical and big parts of the application to external Flash.
241+
246242
Debugging
247-
=========
243+
---------
248244

249245
You can debug an application in the usual way. Here is an example for the
250246
:zephyr:code-sample:`hello_world` application.
@@ -255,6 +251,88 @@ You can debug an application in the usual way. Here is an example for the
255251
:maybe-skip-config:
256252
:goals: debug
257253

254+
Application in External Flash
255+
=============================
256+
257+
Because of the limited amount of SoC Flash (64KB), you may want to store the application
258+
in external QSPI Flash instead, and run it from there. In that case, the MCUboot bootloader
259+
is needed to chainload the application. A dedicated board variant, ``ext_flash_app``, was created
260+
for this usecase.
261+
262+
:ref:`sysbuild` makes it possible to build and flash all necessary images needed to run a user application
263+
from external Flash.
264+
265+
The following example shows how to build :zephyr:code-sample:`hello_world` with Sysbuild enabled:
266+
267+
.. zephyr-app-commands::
268+
:tool: west
269+
:zephyr-app: samples/hello_world
270+
:board: stm32h7s78_dk/stm32h7s7xx/ext_flash_app
271+
:goals: build
272+
:west-args: --sysbuild
273+
274+
By default, Sysbuild creates MCUboot and user application images.
275+
276+
For more information, refer to the :ref:`sysbuild` documentation.
277+
278+
Flashing
279+
--------
280+
281+
Both MCUboot and user application images can be flashed by running:
282+
283+
.. code-block:: console
284+
285+
west flash
286+
287+
You should see the following message in the serial host program:
288+
289+
.. code-block:: console
290+
291+
*** Booting MCUboot v2.2.0-192-g96576b341ee1 ***
292+
*** Using Zephyr OS build v4.3.0-rc2-37-g6cc7bdb58a92 ***
293+
I: Starting bootloader
294+
I: Bootloader chainload address offset: 0x0
295+
I: Image version: v0.0.0
296+
I: Jumping to the first image slot
297+
*** Booting Zephyr OS build v4.3.0-rc2-37-g6cc7bdb58a92 ***
298+
Hello World! stm32h7s78_dk/stm32h7s7xx/ext_flash_app
299+
300+
To only flash the user application in the subsequent builds, Use:
301+
302+
.. code-block:: console
303+
304+
west flash --domain hello_world
305+
306+
With the default configuration, the board uses MCUboot's Swap-using-offset mode.
307+
To get more information about the different MCUboot operating modes and how to
308+
perform application upgrade, refer to `MCUboot design`_.
309+
To learn more about how to secure the application images stored in external Flash,
310+
refer to `MCUboot Encryption`_.
311+
312+
Debugging
313+
---------
314+
315+
You can debug the application in external flash using ``west`` and ``GDB``.
316+
317+
After flashing MCUboot and the app, execute the following command:
318+
319+
.. code-block:: console
320+
321+
west debugserver
322+
323+
Then, open another terminal (don't forget to activate Zephyr's environment) and execute:
324+
325+
.. code-block:: console
326+
327+
west attach
328+
329+
By default, user application symbols are loaded. To debug MCUboot application,
330+
launch:
331+
332+
.. code-block:: console
333+
334+
west attach --domain mcuboot
335+
258336
.. _STM32H7S78-DK Discovery website:
259337
https://www.st.com/en/evaluation-tools/stm32h7s78-dk.html
260338

@@ -269,3 +347,9 @@ You can debug an application in the usual way. Here is an example for the
269347

270348
.. _STM32CubeProgrammer:
271349
https://www.st.com/en/development-tools/stm32cubeprog.html
350+
351+
.. _MCUboot design:
352+
https://docs.mcuboot.com/design.html
353+
354+
.. _MCUboot Encryption:
355+
https://docs.mcuboot.com/encrypted_images.html

0 commit comments

Comments
 (0)