From 265b6ff59e0917dfd759ad7697c8d510f2e91ce4 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 24 Oct 2019 15:30:37 -0700 Subject: [PATCH] boards: mec15xxevb_assy6853: enable flashing with build command This utilizes the newly introduced dediprog west flash runner to flash the image onto the onboard SPI chip. Signed-off-by: Daniel Leung --- boards/arm/mec15xxevb_assy6853/CMakeLists.txt | 2 +- boards/arm/mec15xxevb_assy6853/board.cmake | 11 +++++++++++ boards/arm/mec15xxevb_assy6853/doc/index.rst | 13 +++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 boards/arm/mec15xxevb_assy6853/board.cmake diff --git a/boards/arm/mec15xxevb_assy6853/CMakeLists.txt b/boards/arm/mec15xxevb_assy6853/CMakeLists.txt index 6ee6d4f7aad..7b0c4c7898b 100644 --- a/boards/arm/mec15xxevb_assy6853/CMakeLists.txt +++ b/boards/arm/mec15xxevb_assy6853/CMakeLists.txt @@ -45,7 +45,7 @@ if(DEFINED EVERGLADES_SPI_GEN) set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND ${EVERGLADES_SPI_GEN} -i ${EVERGLADES_SPI_CFG} - -o ${PROJECT_BINARY_DIR}/spi_image.bin + -o ${PROJECT_BINARY_DIR}/${SPI_IMAGE_NAME} ) unset(EVERGLADES_SPI_GEN) diff --git a/boards/arm/mec15xxevb_assy6853/board.cmake b/boards/arm/mec15xxevb_assy6853/board.cmake new file mode 100644 index 00000000000..03788525314 --- /dev/null +++ b/boards/arm/mec15xxevb_assy6853/board.cmake @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: Apache-2.0 + +set(SPI_IMAGE_NAME spi_image.bin) + +board_set_flasher_ifnset(dediprog) + +# --vcc=0 - use 3.5V to flash +board_finalize_runner_args(dediprog + "--spi-image=${PROJECT_BINARY_DIR}/${SPI_IMAGE_NAME}" + "--vcc=0" +) diff --git a/boards/arm/mec15xxevb_assy6853/doc/index.rst b/boards/arm/mec15xxevb_assy6853/doc/index.rst index c8104ac8318..784a8f9300d 100644 --- a/boards/arm/mec15xxevb_assy6853/doc/index.rst +++ b/boards/arm/mec15xxevb_assy6853/doc/index.rst @@ -274,6 +274,17 @@ Flashing .. note:: Remember that SPI MISO/MOSI are swapped on dediprog headers! + - Flash your board using west: + + .. code-block:: console + + $ west flash + + Make sure that the program ``dpcmd`` (on Linux) or + ``dpcmd.exe`` (on Windows) can be found in your ``PATH``. + The Windows version is installed with your DediProg software. + The source code of the Linux version can be found at `SF100 Linux GitHub`_. + #. Run your favorite terminal program to listen for output. Under Linux the terminal should be :code:`/dev/ttyACM0`. For example: @@ -324,3 +335,5 @@ References https://github.com/MicrochipTech/CPGZephyrDocs/blob/master/MEC1501/SPI%20Dongles%20and%20Aardvark%20Interposer%20Assy%206791%20Rev%20A1p1%20-%20SCH.pdf .. _SPI Image Gen: https://github.com/MicrochipTech/CPGZephyrDocs/tree/master/MEC1501/SPI_image_gen +.. _SF100 Linux GitHub: + https://github.com/DediProgSW/SF100Linux