Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

board/arm/stm32h747i_disco: add support of flash with openocd #24682

Merged
merged 2 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions boards/arm/stm32h747i_disco/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

if(CONFIG_BOARD_STM32H747I_DISCO_M7)
board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd_stm32h747i_disco_m7.cfg")
elseif(CONFIG_BOARD_STM32H747I_DISCO_M4)
board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd_stm32h747i_disco_m4.cfg")
endif()

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
23 changes: 22 additions & 1 deletion boards/arm/stm32h747i_disco/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ Applications for the ``stm32h747i_disco`` board should be built per core target,
using either ``stm32h747i_disco_m7`` or ```stm32h747i_disco_m4`` as the target.
See :ref:`build_an_application` for more information about application builds.

.. note::

If using OpenOCD you will need a recent development version as the last
official release does not support H7 dualcore yet.
Also, with OpenOCD, sometimes, flashing is not working. It is necessary to
erase the flash (with STM32CubeProgrammer for example) to make it work again.
Debugging with OpenOCD is currently working for this board only with Cortex M7,
not Cortex M4.


Flashing
========

Expand Down Expand Up @@ -170,6 +180,17 @@ Use the following commands to flash either m7 or m4 target:
$ ./STM32_Programmer_CLI -c port=SWD mode=UR -w <path_to_m7_binary> 0x8000000
$ ./STM32_Programmer_CLI -c port=SWD mode=UR -w <path_to_m4_binary> 0x8100000

Alternatively it is possible to flash with OpenOcd but with some restrictions:
Sometimes, flashing is not working. It is necessary to erase the flash
(with STM32CubeProgrammer for example) to make it work again.
Debugging with OpenOCD is currently working for this board only with Cortex M7,
not Cortex M4.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: stm32h747i_disco_m7
:goals: build flash

Run a serial host program to connect with your board:

.. code-block:: console
Expand All @@ -180,7 +201,7 @@ You should see the following message on the console:

.. code-block:: console

Hello World! arm
Hello World! stm32h747i_disco_m7

Debugging
=========
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

source [find interface/stlink.cfg]

transport select hla_swd

set DUAL_BANK 1

set DUAL_CORE 1

source [find target/stm32h7x.cfg]

reset_config srst_only
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

source [find interface/stlink.cfg]

transport select hla_swd

source [find target/stm32h7x.cfg]

reset_config srst_only