From 346bea79745a991f257d31a830d59762b236d33a Mon Sep 17 00:00:00 2001 From: gitlab-runner Date: Wed, 7 Jun 2023 16:15:54 -0500 Subject: [PATCH] Upload recipe-make-cat3 2.1.1.4648 [1380] --- README.md | 2 +- RELEASE.md | 9 +- make/recipe/core_selection.mk | 2 +- make/recipe/defines.mk | 66 +------ make/recipe/defines_common.mk | 109 +---------- make/recipe/interface_version_1/recipe_ide.mk | 89 +++++++++ .../interface_version_1/recipe_ide_common.mk | 128 +++++++++++++ make/recipe/interface_version_2/recipe_ide.mk | 116 ++++++++++++ .../interface_version_2/recipe_ide_common.mk | 172 ++++++++++++++++++ make/recipe/program.mk | 72 +++++++- make/recipe/recipe.mk | 2 +- make/recipe/recipe_common.mk | 70 +++++-- make/recipe/recipe_setup.mk | 20 +- make/recipe/recipe_toolchain_file_types.mk | 2 +- make/scripts/erase.jlink | 2 + make/scripts/gdbinit | 17 ++ .../eclipse/Attach (JLink).xml | 0 .../eclipse/Debug (JLink).xml | 0 .../eclipse/Erase (JLink).xml | 0 .../eclipse/Program (JLink).xml | 0 .../vscode/launch.json | 0 .../vscode/openocd.tcl | 0 ...B_RECIPE__PRJ_NAME&& Attach (JLink).launch | 79 ++++++++ ...TB_RECIPE__PRJ_NAME&& Debug (JLink).launch | 81 +++++++++ ...TB_RECIPE__PRJ_NAME&& Erase (JLink).launch | 79 ++++++++ ..._RECIPE__PRJ_NAME&& Program (JLink).launch | 81 +++++++++ .../vscode/JLink/launch.json | 120 ++++++++++++ make/scripts/program.jlink | 5 + make/toolchains/ARM.mk | 9 +- make/toolchains/GCC_ARM.mk | 7 +- make/toolchains/IAR.mk | 10 +- version.xml | 2 +- 32 files changed, 1129 insertions(+), 222 deletions(-) create mode 100644 make/recipe/interface_version_1/recipe_ide.mk create mode 100644 make/recipe/interface_version_1/recipe_ide_common.mk create mode 100644 make/recipe/interface_version_2/recipe_ide.mk create mode 100644 make/recipe/interface_version_2/recipe_ide_common.mk create mode 100644 make/scripts/erase.jlink create mode 100644 make/scripts/gdbinit rename make/scripts/{ => interface_version_1}/eclipse/Attach (JLink).xml (100%) rename make/scripts/{ => interface_version_1}/eclipse/Debug (JLink).xml (100%) rename make/scripts/{ => interface_version_1}/eclipse/Erase (JLink).xml (100%) rename make/scripts/{ => interface_version_1}/eclipse/Program (JLink).xml (100%) rename make/scripts/{ => interface_version_1}/vscode/launch.json (100%) rename make/scripts/{ => interface_version_1}/vscode/openocd.tcl (100%) create mode 100644 make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Attach (JLink).launch create mode 100644 make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Debug (JLink).launch create mode 100644 make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Erase (JLink).launch create mode 100644 make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Program (JLink).launch create mode 100644 make/scripts/interface_version_2/vscode/JLink/launch.json create mode 100644 make/scripts/program.jlink diff --git a/README.md b/README.md index 4d68a73..ff7056e 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,4 @@ To list the build options, run the "help" target by typing "make help" in CLI. F * [ModusToolbox](https://www.infineon.com/cms/en/design-support/tools/sdk/modustoolbox-software) --- -© Cypress Semiconductor Corporation, 2019-2022. +© Cypress Semiconductor Corporation, 2019-2023. diff --git a/RELEASE.md b/RELEASE.md index 50ad0d4..4d72baa 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -13,6 +13,9 @@ This release of the XMC GNU make build recipe includes support for building XMC * ARM Compiler 6 ### What Changed? +#### v2.1.1. +* Minor updates to IDE export. + #### v2.0.0 * Major version update. Significant changes to support ModusToolbox 3.0 * Dropped compatibility with core-make version 1.X and ModusToolbox tools version 2.X @@ -40,8 +43,8 @@ This version of the XMC build system was validated for compatibility with the fo | Software and Tools | Version | | :--- | :----: | -| ModusToolbox Software Environment | 3.0 | -| GCC Compiler | 10.3 | +| ModusToolbox Software Environment | 3.1 | +| GCC Compiler | 11.3 | | IAR Compiler | 9.3 | | ARM Compiler | 6.16 | @@ -52,5 +55,5 @@ Minimum required ModusToolbox Software Environment: v3.0 * [ModusToolbox](https://www.infineon.com/cms/en/design-support/tools/sdk/modustoolbox-software) --- -© Cypress Semiconductor Corporation, 2019-2022. +© Cypress Semiconductor Corporation, 2019-2023. diff --git a/make/recipe/core_selection.mk b/make/recipe/core_selection.mk index 3f077bf..81a700b 100644 --- a/make/recipe/core_selection.mk +++ b/make/recipe/core_selection.mk @@ -6,7 +6,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/make/recipe/defines.mk b/make/recipe/defines.mk index 78c0a76..0449c82 100644 --- a/make/recipe/defines.mk +++ b/make/recipe/defines.mk @@ -6,7 +6,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,10 +32,12 @@ include $(MTB_TOOLS__RECIPE_DIR)/make/recipe/defines_common.mk ################################################################################ # General ################################################################################ +_MTB_RECIPE__DEFAULT_PROGRAM_INTERFACE:=JLink +_MTB_RECIPE__PROGRAM_INTERFACE_SUPPORTED:=JLink # # Compactibility interface for this recipe make # -MTB_RECIPE__INTERFACE_VERSION=1 +MTB_RECIPE__INTERFACE_VERSION:=2 # # List the supported toolchains @@ -121,66 +123,6 @@ endif # to enable auto-discovery of CMSIS startup templates MTB_RECIPE__COMPONENT+=$(_MTB_RECIPE__DEVICE_DIE) -################################################################################ -# IDE specifics -################################################################################ - -MTB_RECIPE__IDE_SUPPORTED:=eclipse vscode uvision5 ewarm8 - -ifeq ($(filter vscode,$(MAKECMDGOALS)),vscode) -$(MTB_RECIPE__IDE_RECIPE_DATA_FILE)_vscode: - $(MTB__NOISE)echo "s|&&DEVICE&&|$(DEVICE)|g;" > $(MTB_RECIPE__IDE_RECIPE_DATA_FILE);\ - echo "s|&&_MTB_RECIPE__OPENOCD_CHIP&&|$(_MTB_RECIPE__OPENOCD_CHIP_NAME)|g;" >> $(MTB_RECIPE__IDE_RECIPE_DATA_FILE); -ifeq ($(MTB_RECIPE__CORE),CM0) - $(MTB__NOISE)echo "s|&&_MTB_RECIPE__APP_ENTRY_POINT&&|main|g;" >> $(MTB_RECIPE__IDE_RECIPE_DATA_FILE); -else - $(MTB__NOISE)echo "s|&&_MTB_RECIPE__APP_ENTRY_POINT&&||g;" >> $(MTB_RECIPE__IDE_RECIPE_DATA_FILE); -endif -endif - -ifeq ($(filter eclipse,$(MAKECMDGOALS)),eclipse) -eclipse_textdata_file: - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__JLINK_CFG_PROGRAM&&=$(DEVICE)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__JLINK_CFG_DEBUG&&=$(DEVICE)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__JLINK_CFG_ATTACH&&=$(_MTB_RECIPE__JLINK_DEVICE_CFG_ATTACH)) - -_MTB_ECLIPSE_TEMPLATE_RECIPE_SEARCH:=$(MTB_TOOLS__RECIPE_DIR)/make/scripts/eclipse -_MTB_ECLIPSE_TEMPLATE_RECIPE_APP_SEARCH:=$(MTB_TOOLS__RECIPE_DIR)/make/scripts/eclipse/Application - -eclipse_recipe_metadata_file: - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_METADATA_FILE),RECIPE_TEMPLATE=$(_MTB_ECLIPSE_TEMPLATE_RECIPE_SEARCH)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_METADATA_FILE),RECIPE_APP_TEMPLATE=$(_MTB_ECLIPSE_TEMPLATE_RECIPE_APP_SEARCH)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_METADATA_FILE),PROJECT_UUID=&&PROJECT_UUID&&) - -endif - -ewarm8_recipe_data_file: - $(call mtb__file_write,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(DEVICE)) - -ewarm8: ewarm8_recipe_data_file - -ifeq ($(_MTB_RECIPE__XMC_ARCH),XMC1) -_MTB_RECIPE__CMSIS_ARCH_NAME:=XMC1000_DFP -else ifeq ($(_MTB_RECIPE__XMC_ARCH),XMC4) -_MTB_RECIPE__CMSIS_ARCH_NAME:=XMC4000_DFP -endif -_MTB_RECIPE__CMSIS_VENDOR_NAME:=Infineon -_MTB_RECIPE__CMSIS_VENDOR_ID:=7 -# pName is optional in the DFP and cprj. But they must match. -# pName is not specified in the XMC dfp, so we have to also not specify in the generated cprj file. -# If we specified the pName, the generated cprj file will not work. -_MTB_RECIPE__CMSIS_PNAME:= - -_MTB_RECIPE__CMSIS_LDFLAGS:= - -uvision5_recipe_data_file: - $(call mtb__file_write,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_ARCH_NAME)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_VENDOR_NAME)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_VENDOR_ID)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_PNAME)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_LDFLAGS)) - -uvision5: uvision5_recipe_data_file ################################################################################ # Tools specifics diff --git a/make/recipe/defines_common.mk b/make/recipe/defines_common.mk index b27f6bc..e75b9ef 100644 --- a/make/recipe/defines_common.mk +++ b/make/recipe/defines_common.mk @@ -6,7 +6,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -59,110 +59,3 @@ ifneq ($(MTB_APPLICATION_SUBPROJECTS),) _MTB_RECIPE__APP_HEX_FILE:=$(call mtb__path_normalize,$(_MTB_RECIPE__APP_HEX_DIR)/app_combined.$(MTB_RECIPE__SUFFIX_PROGRAM)) endif endif - -# Set the output file paths -_MTB_RECIPE__BUILD_PATH_RELATIVE:=$(notdir $(MTB_TOOLS__OUTPUT_BASE_DIR))/$(TARGET)/$(CONFIG) -_MTB_RECIPE__BUILD_APPLICATION_PATH_RELATIVE:=$(notdir $(MTB_TOOLS__PRJ_DIR))/$(_MTB_RECIPE__BUILD_PATH_RELATIVE) -_MTB_RECIPE__COMBINED_HEX_RELATIVE:=$(patsubst $(call mtb__path_normalize,$(MTB_TOOLS__PRJ_DIR)/../)/%,%,$(_MTB_RECIPE__APP_HEX_FILE)) - -ifneq ($(CY_BUILD_LOCATION),) -_MTB_RECIPE__ECLIPSE_SYM_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) -_MTB_RECIPE__ECLIPSE_PROG_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) -ifeq ($(MTB_TYPE),PROJECT) -_MTB_RECIPE__ECLIPSE_PROG_FILE:=$(_MTB_RECIPE__APP_HEX_FILE) -endif -else -_MTB_RECIPE__ECLIPSE_SYM_FILE:=$${cy_prj_path}/$(_MTB_RECIPE__BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) -_MTB_RECIPE__ECLIPSE_PROG_FILE:=$${cy_prj_path}/$(_MTB_RECIPE__BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) -ifeq ($(MTB_TYPE),PROJECT) -_MTB_RECIPE__ECLIPSE_PROG_FILE:=$${cy_prj_path}/../$(_MTB_RECIPE__COMBINED_HEX_RELATIVE) -endif -endif - -################################################################################ -# IDE specifics -################################################################################ -MTB_RECIPE__IDE_RECIPE_DATA_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/ide_recipe_data.temp -MTB_RECIPE__IDE_RECIPE_METADATA_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/ide_recipe_metadata.temp -_MTB_ECLIPSE_OPENOCD_SVD_PATH:=$${cy_prj_path}/$(DEVICE_$(DEVICE)_SVD) -# Eclipse -ifeq ($(filter eclipse,$(MAKECMDGOALS)),eclipse) -eclipse_textdata_file_common: - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__OPENOCD_CFG&&=$(_MTB_RECIPE__OPENOCD_DEVICE_CFG)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__OPENOCD_CHIP&&=$(_MTB_RECIPE__OPENOCD_CHIP_NAME)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__APPNAME&&=$(CY_IDE_PRJNAME)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__CONFIG&&=$(CONFIG)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__SVD_PATH&&=$(_MTB_ECLIPSE_OPENOCD_SVD_PATH)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__SYM_FILE&&=$(_MTB_RECIPE__ECLIPSE_SYM_FILE)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__PROG_FILE&&=$(_MTB_RECIPE__ECLIPSE_PROG_FILE)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__ECLIPSE_GDB&&=$(CY_ECLIPSE_GDB)) - $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&MTB_APPLICATION_NAME&&=$(_MTB_ECLIPSE_APPLICATION_NAME)) - -eclipse_textdata_file : eclipse_textdata_file_common -endif - -# VSCode -ifeq ($(filter vscode,$(MAKECMDGOALS)),vscode) -_MTB_RECIPE__GCC_BASE_DIR:=$(subst $(MTB_TOOLS__TOOLS_DIR)/,,$(MTB_TOOLCHAIN_GCC_ARM__BASE_DIR)) -_MTB_RECIPE__GCC_VERSION:=$(shell $(MTB_TOOLCHAIN_GCC_ARM__CC) -dumpversion) -_MTB_RECIPE__OPENOCD_EXE_DIR_RELATIVE:=$(CY_TOOL_openocd_EXE) -_MTB_RECIPE__OPENOCD_SCRIPTS_DIR_RELATIVE:=$(CY_TOOL_openocd_scripts_SCRIPT) - -ifneq ($(CY_BUILD_LOCATION),) -_MTB_RECIPE__ELF_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) -_MTB_RECIPE__ELF_FILE_APPLICATION:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) -_MTB_RECIPE__HEX_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) -ifeq ($(MTB_TYPE),PROJECT) -_MTB_RECIPE__HEX_FILE:=$(_MTB_RECIPE__APP_HEX_FILE) -endif -else -_MTB_RECIPE__ELF_FILE:=./$(_MTB_RECIPE__BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) -_MTB_RECIPE__ELF_FILE_APPLICATION:=./$(_MTB_RECIPE__BUILD_APPLICATION_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) -_MTB_RECIPE__HEX_FILE:=./$(_MTB_RECIPE__BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) -_MTB_RECIPE__HEX_FILE_APPLICATION:=./$(_MTB_RECIPE__COMBINED_HEX_RELATIVE) -ifeq ($(MTB_TYPE),PROJECT) -_MTB_RECIPE__HEX_FILE:=../$(_MTB_RECIPE__COMBINED_HEX_RELATIVE) -endif -endif - -# This must set with = instead of := -_MTB_RECIPE__C_FLAGS=$(subst $(MTB__SPACE),\"$(MTB__COMMA)$(MTB__NEWLINE_MARKER)\",$(strip $(MTB_RECIPE__CFLAGS))) - -ifeq ($(CY_ATTACH_SERVER_TYPE),) -CY_ATTACH_SERVER_TYPE=openocd -endif - -_MTB_VSCODE_MODUS_SHELL_RELATIVE:=$(CY_TOOL_modus-shell_BASE) - -_MTB_VSCODE_SVD_PATH:=$(DEVICE_$(DEVICE)_SVD) -_MTB_VSCODE_APPLICATION_SVD_PATH=$(patsubst ../%,%,$(_MTB_VSCODE_SVD_PATH)) - -$(MTB_RECIPE__IDE_RECIPE_DATA_FILE): - $(MTB__NOISE)echo "s|&&_MTB_RECIPE__ELF_FILE&&|$(_MTB_RECIPE__ELF_FILE)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__HEX_FILE&&|$(_MTB_RECIPE__HEX_FILE)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__ELF_FILE_APPLICATION&&|$(_MTB_RECIPE__ELF_FILE_APPLICATION)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__HEX_FILE_APPLICATION&&|$(_MTB_RECIPE__HEX_FILE_APPLICATION)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__OPEN_OCD_FILE&&|$(_MTB_RECIPE__OPENOCD_DEVICE_CFG)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__SVD_FILE_NAME&&|$(_MTB_VSCODE_SVD_PATH)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__APPLICATION_SVD_FILE_NAME&&|$(_MTB_VSCODE_APPLICATION_SVD_PATH)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__MTB_PATH&&|$(CY_TOOLS_DIR)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__TOOL_CHAIN_DIRECTORY&&|$(subst ",,$(CY_CROSSPATH))|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__C_FLAGS&&|$(_MTB_RECIPE__C_FLAGS)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__GCC_VERSION&&|$(_MTB_RECIPE__GCC_VERSION)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__OPENOCD_EXE_DIR_RELATIVE&&|$(_MTB_RECIPE__OPENOCD_EXE_DIR_RELATIVE)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__OPENOCD_SCRIPTS_DIR_RELATIVE&&|$(_MTB_RECIPE__OPENOCD_SCRIPTS_DIR_RELATIVE)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__CONFIG&&|$(CONFIG)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__DEVICE_ATTACH&&|$(_MTB_RECIPE__JLINK_DEVICE_CFG_ATTACH)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__MODUS_SHELL_BASE&&|$(_MTB_VSCODE_MODUS_SHELL_RELATIVE)|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__ATTACH_SERVER_TYPE&&|$(CY_ATTACH_SERVER_TYPE)|g;" >> $@; -ifeq ($(CY_USE_CUSTOM_GCC),true) - $(MTB__NOISE)echo "s|&&_MTB_RECIPE__GCC_BIN_DIR&&|$(MTB_TOOLCHAIN_GCC_ARM__BASE_DIR)/bin|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__GCC_DIRECTORY&&|$(MTB_TOOLCHAIN_GCC_ARM__BASE_DIR)|g;" >> $@; -else - $(MTB__NOISE)echo "s|&&_MTB_RECIPE__GCC_BIN_DIR&&|$$\{config:modustoolbox.toolsPath\}/$(_MTB_RECIPE__GCC_BASE_DIR)/bin|g;" >> $@;\ - echo "s|&&_MTB_RECIPE__GCC_DIRECTORY&&|$$\{config:modustoolbox.toolsPath\}/$(_MTB_RECIPE__GCC_BASE_DIR)|g;" >> $@; -endif - -$(MTB_RECIPE__IDE_RECIPE_DATA_FILE) : $(MTB_RECIPE__IDE_RECIPE_DATA_FILE)_vscode -.PHONY: $(MTB_RECIPE__IDE_RECIPE_DATA_FILE)_vscode -endif diff --git a/make/recipe/interface_version_1/recipe_ide.mk b/make/recipe/interface_version_1/recipe_ide.mk new file mode 100644 index 0000000..305a6f0 --- /dev/null +++ b/make/recipe/interface_version_1/recipe_ide.mk @@ -0,0 +1,89 @@ +################################################################################ +# \file recipe_ide.mk +# +# \brief +# This make file defines the IDE export variables and target. +# +################################################################################ +# \copyright +# Copyright 2022-2023 Cypress Semiconductor Corporation +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +ifeq ($(WHICHFILE),true) +$(info Processing $(lastword $(MAKEFILE_LIST))) +endif +include $(MTB_TOOLS__RECIPE_DIR)/make/recipe/interface_version_1/recipe_ide_common.mk + +################################################################################ +# IDE specifics +################################################################################ + +MTB_RECIPE__IDE_SUPPORTED:=eclipse vscode uvision5 ewarm8 + +ifeq ($(filter vscode,$(MAKECMDGOALS)),vscode) +$(MTB_RECIPE__IDE_RECIPE_DATA_FILE)_vscode: + $(MTB__NOISE)echo "s|&&DEVICE&&|$(DEVICE)|g;" > $(MTB_RECIPE__IDE_RECIPE_DATA_FILE);\ + echo "s|&&_MTB_RECIPE__OPENOCD_CHIP&&|$(_MTB_RECIPE__OPENOCD_CHIP_NAME)|g;" >> $(MTB_RECIPE__IDE_RECIPE_DATA_FILE); +ifeq ($(MTB_RECIPE__CORE),CM0) + $(MTB__NOISE)echo "s|&&_MTB_RECIPE__APP_ENTRY_POINT&&|main|g;" >> $(MTB_RECIPE__IDE_RECIPE_DATA_FILE); +else + $(MTB__NOISE)echo "s|&&_MTB_RECIPE__APP_ENTRY_POINT&&||g;" >> $(MTB_RECIPE__IDE_RECIPE_DATA_FILE); +endif +endif + +ifeq ($(filter eclipse,$(MAKECMDGOALS)),eclipse) +eclipse_textdata_file: + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__JLINK_CFG_PROGRAM&&=$(DEVICE)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__JLINK_CFG_DEBUG&&=$(DEVICE)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__JLINK_CFG_ATTACH&&=$(_MTB_RECIPE__JLINK_DEVICE_CFG_ATTACH)) + +_MTB_ECLIPSE_TEMPLATE_RECIPE_SEARCH:=$(MTB_TOOLS__RECIPE_DIR)/make/scripts/interface_version_1/eclipse +_MTB_ECLIPSE_TEMPLATE_RECIPE_APP_SEARCH:=$(MTB_TOOLS__RECIPE_DIR)/make/scripts/interface_version_1/eclipse/Application + +eclipse_recipe_metadata_file: + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_METADATA_FILE),RECIPE_TEMPLATE=$(_MTB_ECLIPSE_TEMPLATE_RECIPE_SEARCH)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_METADATA_FILE),RECIPE_APP_TEMPLATE=$(_MTB_ECLIPSE_TEMPLATE_RECIPE_APP_SEARCH)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_METADATA_FILE),PROJECT_UUID=&&PROJECT_UUID&&) + +endif + +ewarm8_recipe_data_file: + $(call mtb__file_write,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(DEVICE)) + +ewarm8: ewarm8_recipe_data_file + +ifeq ($(_MTB_RECIPE__XMC_ARCH),XMC1) +_MTB_RECIPE__CMSIS_ARCH_NAME:=XMC1000_DFP +else ifeq ($(_MTB_RECIPE__XMC_ARCH),XMC4) +_MTB_RECIPE__CMSIS_ARCH_NAME:=XMC4000_DFP +endif +_MTB_RECIPE__CMSIS_VENDOR_NAME:=Infineon +_MTB_RECIPE__CMSIS_VENDOR_ID:=7 +# pName is optional in the DFP and cprj. But they must match. +# pName is not specified in the XMC dfp, so we have to also not specify in the generated cprj file. +# If we specified the pName, the generated cprj file will not work. +_MTB_RECIPE__CMSIS_PNAME:= + +_MTB_RECIPE__CMSIS_LDFLAGS:= + +uvision5_recipe_data_file: + $(call mtb__file_write,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_ARCH_NAME)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_VENDOR_NAME)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_VENDOR_ID)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_PNAME)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),$(_MTB_RECIPE__CMSIS_LDFLAGS)) + +uvision5: uvision5_recipe_data_file \ No newline at end of file diff --git a/make/recipe/interface_version_1/recipe_ide_common.mk b/make/recipe/interface_version_1/recipe_ide_common.mk new file mode 100644 index 0000000..dfe02c9 --- /dev/null +++ b/make/recipe/interface_version_1/recipe_ide_common.mk @@ -0,0 +1,128 @@ +################################################################################ +# \file recipe_ide_common.mk +# +# \brief +# This make file defines the IDE export variables and target. +# +################################################################################ +# \copyright +# Copyright 2018-2023 Cypress Semiconductor Corporation +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +ifeq ($(WHICHFILE),true) +$(info Processing $(lastword $(MAKEFILE_LIST))) +endif + + +# Set the output file paths +_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE:=$(notdir $(MTB_TOOLS__OUTPUT_BASE_DIR))/$(TARGET)/$(CONFIG) +_MTB_RECIPE__IDE_BUILD_APPLICATION_PATH_RELATIVE:=$(notdir $(MTB_TOOLS__PRJ_DIR))/$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE) +_MTB_RECIPE__IDE_COMBINED_HEX_RELATIVE:=$(patsubst $(call mtb__path_normalize,$(MTB_TOOLS__PRJ_DIR)/../)/%,%,$(_MTB_RECIPE__APP_HEX_FILE)) + + +MTB_RECIPE__IDE_RECIPE_DATA_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/ide_recipe_data.temp +MTB_RECIPE__IDE_RECIPE_METADATA_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/ide_recipe_metadata.temp +_MTB_RECIPE__ECLIPSE_OPENOCD_SVD_PATH:=$${cy_prj_path}/$(DEVICE_$(DEVICE)_SVD) +# Eclipse +ifeq ($(filter eclipse,$(MAKECMDGOALS)),eclipse) + +ifneq ($(CY_BUILD_LOCATION),) +_MTB_RECIPE__ECLIPSE_SYM_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +_MTB_RECIPE__ECLIPSE_PROG_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +else +_MTB_RECIPE__ECLIPSE_SYM_FILE:=$${cy_prj_path}/$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +_MTB_RECIPE__ECLIPSE_PROG_FILE:=$${cy_prj_path}/$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +endif + +ifeq ($(MTB_TYPE),PROJECT) +_MTB_RECIPE__ECLIPSE_PROG_FILE:=$${cy_prj_path}/../$(_MTB_RECIPE__IDE_COMBINED_HEX_RELATIVE) +endif + +eclipse_textdata_file_common: + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__OPENOCD_CFG&&=$(_MTB_RECIPE__OPENOCD_DEVICE_CFG)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__OPENOCD_CHIP&&=$(_MTB_RECIPE__OPENOCD_CHIP_NAME)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__APPNAME&&=$(CY_IDE_PRJNAME)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__SVD_PATH&&=$(_MTB_RECIPE__ECLIPSE_OPENOCD_SVD_PATH)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__SYM_FILE&&=$(_MTB_RECIPE__ECLIPSE_SYM_FILE)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__PROG_FILE&&=$(_MTB_RECIPE__ECLIPSE_PROG_FILE)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&_MTB_RECIPE__ECLIPSE_GDB&&=$(CY_ECLIPSE_GDB)) + $(call mtb__file_append,$(MTB_RECIPE__IDE_RECIPE_DATA_FILE),&&MTB_APPLICATION_NAME&&=$(_MTB_ECLIPSE_APPLICATION_NAME)) + +eclipse_textdata_file : eclipse_textdata_file_common +endif + +# VSCode +ifeq ($(filter vscode,$(MAKECMDGOALS)),vscode) +_MTB_RECIPE__GCC_BASE_DIR:=$(subst $(MTB_TOOLS__TOOLS_DIR)/,,$(MTB_TOOLCHAIN_GCC_ARM__BASE_DIR)) +_MTB_RECIPE__GCC_VERSION:=$(shell $(MTB_TOOLCHAIN_GCC_ARM__CC) -dumpversion) +_MTB_RECIPE__OPENOCD_EXE_DIR_RELATIVE:=$(CY_TOOL_openocd_EXE) +_MTB_RECIPE__OPENOCD_SCRIPTS_DIR_RELATIVE:=$(CY_TOOL_openocd_scripts_SCRIPT) + +ifneq ($(CY_BUILD_LOCATION),) +_MTB_RECIPE__ELF_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +_MTB_RECIPE__ELF_FILE_APPLICATION:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +_MTB_RECIPE__HEX_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +else +_MTB_RECIPE__ELF_FILE:=./$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +_MTB_RECIPE__ELF_FILE_APPLICATION:=./$(_MTB_RECIPE__IDE_BUILD_APPLICATION_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +_MTB_RECIPE__HEX_FILE:=./$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +endif + +_MTB_RECIPE__HEX_FILE_APPLICATION:=./$(_MTB_RECIPE__IDE_COMBINED_HEX_RELATIVE) +ifeq ($(MTB_TYPE),PROJECT) +_MTB_RECIPE__HEX_FILE:=../$(_MTB_RECIPE__IDE_COMBINED_HEX_RELATIVE) +endif + +# This must set with = instead of := +_MTB_RECIPE__C_FLAGS=$(subst $(MTB__SPACE),\"$(MTB__COMMA)$(MTB__NEWLINE_MARKER)\",$(strip $(MTB_RECIPE__CFLAGS))) + +ifeq ($(MTB_RECIPE__ATTACH_SERVER_TYPE),) +MTB_RECIPE__ATTACH_SERVER_TYPE=openocd +endif + +_MTB_VSCODE_MODUS_SHELL_RELATIVE:=$(CY_TOOL_modus-shell_BASE) + +_MTB_VSCODE_SVD_PATH:=$(DEVICE_$(DEVICE)_SVD) +_MTB_VSCODE_APPLICATION_SVD_PATH=$(patsubst ../%,%,$(_MTB_VSCODE_SVD_PATH)) + +$(MTB_RECIPE__IDE_RECIPE_DATA_FILE): + $(MTB__NOISE)echo "s|&&_MTB_RECIPE__ELF_FILE&&|$(_MTB_RECIPE__ELF_FILE)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__HEX_FILE&&|$(_MTB_RECIPE__HEX_FILE)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__ELF_FILE_APPLICATION&&|$(_MTB_RECIPE__ELF_FILE_APPLICATION)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__HEX_FILE_APPLICATION&&|$(_MTB_RECIPE__HEX_FILE_APPLICATION)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__OPEN_OCD_FILE&&|$(_MTB_RECIPE__OPENOCD_DEVICE_CFG)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__SVD_FILE_NAME&&|$(_MTB_VSCODE_SVD_PATH)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__APPLICATION_SVD_FILE_NAME&&|$(_MTB_VSCODE_APPLICATION_SVD_PATH)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__MTB_PATH&&|$(CY_TOOLS_DIR)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__TOOL_CHAIN_DIRECTORY&&|$(subst ",,$(CY_CROSSPATH))|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__C_FLAGS&&|$(_MTB_RECIPE__C_FLAGS)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__GCC_VERSION&&|$(_MTB_RECIPE__GCC_VERSION)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__OPENOCD_EXE_DIR_RELATIVE&&|$(_MTB_RECIPE__OPENOCD_EXE_DIR_RELATIVE)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__OPENOCD_SCRIPTS_DIR_RELATIVE&&|$(_MTB_RECIPE__OPENOCD_SCRIPTS_DIR_RELATIVE)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__DEVICE_ATTACH&&|$(_MTB_RECIPE__JLINK_DEVICE_CFG_ATTACH)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__MODUS_SHELL_BASE&&|$(_MTB_VSCODE_MODUS_SHELL_RELATIVE)|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__ATTACH_SERVER_TYPE&&|$(MTB_RECIPE__ATTACH_SERVER_TYPE)|g;" >> $@; +ifeq ($(CY_USE_CUSTOM_GCC),true) + $(MTB__NOISE)echo "s|&&_MTB_RECIPE__GCC_BIN_DIR&&|$(MTB_TOOLCHAIN_GCC_ARM__BASE_DIR)/bin|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__GCC_DIRECTORY&&|$(MTB_TOOLCHAIN_GCC_ARM__BASE_DIR)|g;" >> $@; +else + $(MTB__NOISE)echo "s|&&_MTB_RECIPE__GCC_BIN_DIR&&|$$\{config:modustoolbox.toolsPath\}/$(_MTB_RECIPE__GCC_BASE_DIR)/bin|g;" >> $@;\ + echo "s|&&_MTB_RECIPE__GCC_DIRECTORY&&|$$\{config:modustoolbox.toolsPath\}/$(_MTB_RECIPE__GCC_BASE_DIR)|g;" >> $@; +endif + +$(MTB_RECIPE__IDE_RECIPE_DATA_FILE) : $(MTB_RECIPE__IDE_RECIPE_DATA_FILE)_vscode +.PHONY: $(MTB_RECIPE__IDE_RECIPE_DATA_FILE)_vscode +endif diff --git a/make/recipe/interface_version_2/recipe_ide.mk b/make/recipe/interface_version_2/recipe_ide.mk new file mode 100644 index 0000000..783ba9a --- /dev/null +++ b/make/recipe/interface_version_2/recipe_ide.mk @@ -0,0 +1,116 @@ +################################################################################ +# \file recipe_ide.mk +# +# \brief +# This make file defines the IDE export variables and target. +# +################################################################################ +# \copyright +# Copyright 2022-2023 Cypress Semiconductor Corporation +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +ifeq ($(WHICHFILE),true) +$(info Processing $(lastword $(MAKEFILE_LIST))) +endif + +############################################## +# General +############################################## +MTB_RECIPE__IDE_SUPPORTED:=eclipse vscode uvision5 ewarm8 +include $(MTB_TOOLS__RECIPE_DIR)/make/recipe/interface_version_2/recipe_ide_common.mk + +############################################## +# Eclipse VSCode +############################################## +_MTB_RECIPE__IDE_TEXT_DATA_FILE=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/recipe_ide_text_data.txt +_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/recipe_ide_template_meta_data.txt +eclipse_generate vscode_generate: MTB_CORE__EXPORT_CMDLINE += -textdata $(_MTB_RECIPE__IDE_TEXT_DATA_FILE) -metadata $(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE) + +############################################## +# Eclipse +############################################## +eclipse_generate:recipe_eclipse_text_replacement_data_file recipe_eclipse_meta_replacement_data_file + +recipe_eclipse_text_replacement_data_file: + $(call mtb__file_write,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__JLINK_CFG_PROGRAM&&=$(DEVICE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__JLINK_CFG_DEBUG&&=$(DEVICE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__JLINK_CFG_ATTACH&&=$(_MTB_RECIPE__JLINK_DEVICE_CFG_ATTACH)) + +recipe_eclipse_meta_replacement_data_file: + $(call mtb__file_write,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),UUID=&&PROJECT_UUID&&) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),TEMPLATE_REPLACE=$(_MTB_RECIPE__IDE_TEMPLATE_DIR)/eclipse/$(_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR)=.mtbLaunchConfigs) + +.PHONY: recipe_eclipse_text_replacement_data_file recipe_eclipse_meta_replacement_data_file + +############################################## +# VSCode +############################################## +vscode_generate: recipe_vscode_text_replacement_data_file recipe_vscode_meta_replacement_data_file + +recipe_vscode_text_replacement_data_file: + $(call mtb__file_write,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&DEVICE&&=$(DEVICE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__OPENOCD_CHIP&&=$(_MTB_RECIPE__OPENOCD_CHIP_NAME)) +ifeq ($(MTB_RECIPE__CORE),CM0) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__APP_ENTRY_POINT&&=main) +else + $(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__APP_ENTRY_POINT&&=) +endif + +recipe_vscode_meta_replacement_data_file: + $(call mtb__file_write,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),TEMPLATE_REPLACE=$(_MTB_RECIPE__IDE_TEMPLATE_DIR)/vscode/$(_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR)/launch.json=.vscode/launch.json) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),TEMPLATE_REPLACE=$(MTB_TOOLS__CORE_DIR)/make/scripts/interface_version_2/vscode/tasks.json=.vscode/tasks.json) + +.PHONY:recipe_vscode_text_replacement_data_file recipe_vscode_meta_replacement_data_file + +############################################## +# UV +############################################## +ifeq ($(_MTB_RECIPE__XMC_ARCH),XMC1) +_MTB_RECIPE__CMSIS_ARCH_NAME:=XMC1000_DFP +else ifeq ($(_MTB_RECIPE__XMC_ARCH),XMC4) +_MTB_RECIPE__CMSIS_ARCH_NAME:=XMC4000_DFP +endif +_MTB_RECIPE__CMSIS_VENDOR_NAME:=Infineon +_MTB_RECIPE__CMSIS_VENDOR_ID:=7 +# pName is optional in the DFP and cprj. But they must match. +# pName is not specified in the XMC dfp, so we have to also not specify in the generated cprj file. +# If we specified the pName, the generated cprj file will not work. +_MTB_RECIPE__CMSIS_PNAME:= + +_MTB_RECIPE__IDE_DFP_DATA_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/recipe_ide_dfp_data.txt +_MTB_RECIPE__IDE_BUILD_DATA_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/recipe_ide_build_data.txt + +uvision5: MTB_CORE__EXPORT_CMDLINE += -dfp_data $(_MTB_RECIPE__IDE_DFP_DATA_FILE) -build_data $(_MTB_RECIPE__IDE_BUILD_DATA_FILE) +uvision5:recipe_uvision5_dfp_data_file recipe_uvision5_build_data_file + +recipe_uvision5_dfp_data_file: + $(call mtb__file_write,$(_MTB_RECIPE__IDE_DFP_DATA_FILE),DEVICE=$(DEVICE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_DFP_DATA_FILE),DFP_NAME=$(_MTB_RECIPE__CMSIS_ARCH_NAME)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_DFP_DATA_FILE),VENDOR_NAME=$(_MTB_RECIPE__CMSIS_VENDOR_NAME)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_DFP_DATA_FILE),VENDOR_ID=$(_MTB_RECIPE__CMSIS_VENDOR_ID)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_DFP_DATA_FILE),PNAME=$(_MTB_RECIPE__CMSIS_PNAME)) + +recipe_uvision5_build_data_file: + $(call mtb__file_write,$(_MTB_RECIPE__IDE_BUILD_DATA_FILE),LINKER_SCRIPT=$(MTB_RECIPE__LINKER_SCRIPT)) + +.PHONY:recipe_uvision5_dfp_data_file recipe_uvision5_build_data_file + +############################################## +# EW +############################################## +# We intentionally don't generate linker script for EW export. +#For XMC, the IAR linker scripts are shipped with EW. +# We will just use the EW IAR defaut linker scripts. diff --git a/make/recipe/interface_version_2/recipe_ide_common.mk b/make/recipe/interface_version_2/recipe_ide_common.mk new file mode 100644 index 0000000..2bcadc9 --- /dev/null +++ b/make/recipe/interface_version_2/recipe_ide_common.mk @@ -0,0 +1,172 @@ +################################################################################ +# \file recipe_ide_common.mk +# +# \brief +# This make file defines the IDE export variables and target. +# +################################################################################ +# \copyright +# Copyright 2018-2023 Cypress Semiconductor Corporation +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +ifeq ($(WHICHFILE),true) +$(info Processing $(lastword $(MAKEFILE_LIST))) +endif + +############################################## +# VSCode Eclipse +############################################## +_MTB_RECIPE__IDE_TEMPLATE_DIR:=$(MTB_TOOLS__RECIPE_DIR)/make/scripts/interface_version_2 +_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE:=$(notdir $(MTB_TOOLS__OUTPUT_BASE_DIR))/$(TARGET)/$(CONFIG) +_MTB_RECIPE__IDE_BUILD_APPLICATION_PATH_RELATIVE:=$(notdir $(MTB_TOOLS__PRJ_DIR))/$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE) +_MTB_RECIPE__IDE_COMBINED_HEX_RELATIVE:=$(patsubst $(call mtb__path_normalize,$(MTB_TOOLS__PRJ_DIR)/../)/%,%,$(_MTB_RECIPE__APP_HEX_FILE)) +_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/recipe_ide_commom_text_data.txt + +############################################## +# VSCode +############################################## +_MTB_RECIPE__VSCODE_GCC_BASE_DIR:=$(subst $(MTB_TOOLS__TOOLS_DIR)/,$${config:modustoolbox.toolsPath}/,$(MTB_TOOLCHAIN_GCC_ARM__BASE_DIR)) +_MTB_RECIPE__VSCODE_HEX_FILE_APPLICATION:=$(_MTB_RECIPE__IDE_COMBINED_HEX_RELATIVE) +ifneq ($(CY_BUILD_LOCATION),) +_MTB_RECIPE__VSCODE_ELF_FILE_APPLICATION:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +_MTB_RECIPE__VSCODE_ELF_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +ifeq ($(MTB_TYPE),PROJECT) +_MTB_RECIPE__VSCODE_HEX_FILE:=$(_MTB_RECIPE__APP_HEX_FILE) +else +_MTB_RECIPE__VSCODE_HEX_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +endif +else #($(CY_BUILD_LOCATION),) +_MTB_RECIPE__VSCODE_ELF_FILE_APPLICATION:=$(_MTB_RECIPE__IDE_BUILD_APPLICATION_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +_MTB_RECIPE__VSCODE_ELF_FILE:=./$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +ifeq ($(MTB_TYPE),PROJECT) +_MTB_RECIPE__VSCODE_HEX_FILE:=../$(_MTB_RECIPE__IDE_COMBINED_HEX_RELATIVE) +else +_MTB_RECIPE__VSCODE_HEX_FILE:=./$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +endif +endif #($(CY_BUILD_LOCATION),) +ifeq ($(MTB_RECIPE__ATTACH_SERVER_TYPE),) +MTB_RECIPE__ATTACH_SERVER_TYPE=openocd +endif +_MTB_RECIPE__VSCODE_SVD_PATH:=$(DEVICE_$(DEVICE)_SVD) +_MTB_RECIPE__VSCODE_APPLICATION_SVD_PATH=$(patsubst ../%,%,$(_MTB_RECIPE__VSCODE_SVD_PATH)) + +vscode_generate: recipe_vscode_common_text_replacement_data_file +vscode_generate: MTB_CORE__EXPORT_CMDLINE += -textdata $(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE) + +recipe_vscode_common_text_replacement_data_file: + $(call mtb__file_write,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__ELF_FILE&&=$(_MTB_RECIPE__VSCODE_ELF_FILE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__HEX_FILE&&=$(_MTB_RECIPE__VSCODE_HEX_FILE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__ELF_FILE_APPLICATION&&=$(_MTB_RECIPE__VSCODE_ELF_FILE_APPLICATION)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__HEX_FILE_APPLICATION&&=$(_MTB_RECIPE__VSCODE_HEX_FILE_APPLICATION)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__OPEN_OCD_FILE&&=$(_MTB_RECIPE__OPENOCD_DEVICE_CFG)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__OPENOCD_CHIP&&=$(_MTB_RECIPE__OPENOCD_CHIP_NAME)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__SVD_FILE_NAME&&=$(_MTB_RECIPE__VSCODE_SVD_PATH)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__APPLICATION_SVD_FILE_NAME&&=$(_MTB_RECIPE__VSCODE_APPLICATION_SVD_PATH)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__MTB_PATH&&=$(CY_TOOLS_DIR)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__OPENOCD_EXE_DIR_RELATIVE&&=$(CY_TOOL_openocd_EXE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__OPENOCD_SCRIPTS_DIR_RELATIVE&&=$(CY_TOOL_openocd_scripts_SCRIPT)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__DEVICE_ATTACH&&=$(_MTB_RECIPE__JLINK_DEVICE_CFG_ATTACH)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__MODUS_SHELL_BASE&&=$(CY_TOOL_modus-shell_BASE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__ATTACH_SERVER_TYPE&&=$(MTB_RECIPE__ATTACH_SERVER_TYPE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__GCC_BIN_DIR&&=$(_MTB_RECIPE__VSCODE_GCC_BASE_DIR)/bin) + +.PHONY: recipe_vscode_common_text_replacement_data_file + +############################################## +# Eclipse +############################################## +_MTB_RECIPE__ECLIPSE_OPENOCD_SVD_PATH:=$${cy_prj_path}/$(DEVICE_$(DEVICE)_SVD) +ifneq ($(CY_BUILD_LOCATION),) +_MTB_RECIPE__ECLIPSE_SYM_FILE:=$(_MTB_RECIPE__TARG_FILE) +_MTB_RECIPE__ECLIPSE_PROG_FILE:=$(_MTB_RECIPE__PROG_FILE) +ifeq ($(MTB_TYPE),PROJECT) +_MTB_RECIPE__ECLIPSE_PROG_FILE:=$(_MTB_RECIPE__APP_HEX_FILE) +endif +else +_MTB_RECIPE__ECLIPSE_SYM_FILE:=$${cy_prj_path}/$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +_MTB_RECIPE__ECLIPSE_PROG_FILE:=$${cy_prj_path}/$(_MTB_RECIPE__IDE_BUILD_PATH_RELATIVE)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +ifeq ($(MTB_TYPE),PROJECT) +_MTB_RECIPE__ECLIPSE_PROG_FILE:=$${cy_prj_path}/../$(_MTB_RECIPE__IDE_COMBINED_HEX_RELATIVE) +endif +endif + +# JLink path +ifneq (,$(MTB_JLINK_DIR)) +ifneq (,$(MTB_CORE__JLINK_GDB_EXE)) +_MTB_RECIPE__ECLIPSE_JLINK_EXE:=$(MTB_CORE__JLINK_GDB_EXE) +else +_MTB_RECIPE__ECLIPSE_JLINK_EXE:=$${jlink_path}/$${jlink_gdbserver} +endif +else +_MTB_RECIPE__ECLIPSE_JLINK_EXE:=$${jlink_path}/$${jlink_gdbserver} +endif + +# GDB path +_MTB_RECIPE__ECLIPSE_GDB=$${cy_tools_path:CY_TOOL_arm-none-eabi-gdb_EXE} + +# If a custom name needs to be provided for the IDE environment it can be specified by +# CY_IDE_PRJNAME. If CY_IDE_PRJNAME was not set on the command line, use APPNAME as the +# default. CY_IDE_PRJNAME can be important in some environments like eclipse where the +# name used within the project is not necessarily what the user created. This can happen +# in Eclipse if there is already a project with the desired name. In this case Eclipse +# will create its own name. That name must still be used for launch configurations instead +# of the name the user actually gave. It can also be necessary when there are multiple +# applications that get created for a single design. In either case we allow a custom name +# to be provided. If one is not provided, we will fallback to the default APPNAME. +ifeq ($(CY_IDE_PRJNAME),) +CY_IDE_PRJNAME=$(APPNAME) +_MTB_RECIPE__ECLIPSE_APPLICATION_NAME:=$(patsubst "%",%,$(MTB_APPLICATION_NAME)) +else +# in a multi-core application, CY_IDE_PRJNAME is name selected in the project-creator and should only apply to the project +_MTB_RECIPE__ECLIPSE_APPLICATION_NAME:=$(CY_IDE_PRJNAME) +endif + +ifeq ($(MTB_TYPE),PROJECT) +ifneq ($(MTB_APPLICATION_SUBPROJECTS),) +_MTB_RECIPE__ECLIPSE_PROJECT_NAME=$(_MTB_RECIPE__ECLIPSE_APPLICATION_NAME).$(APPNAME) +endif +else #($(MTB_TYPE),PROJECT) +_MTB_RECIPE__ECLIPSE_PROJECT_NAME=$(CY_IDE_PRJNAME) +endif #($(MTB_TYPE),PROJECT) + +eclipse_generate: recipe_eclipse_common_text_replacement_data_file +eclipse_generate: MTB_CORE__EXPORT_CMDLINE += -textdata $(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE) + +recipe_eclipse_common_text_replacement_data_file: + $(call mtb__file_write,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__OPENOCD_CFG&&=$(_MTB_RECIPE__OPENOCD_DEVICE_CFG)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__OPENOCD_CHIP&&=$(_MTB_RECIPE__OPENOCD_CHIP_NAME)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__SVD_PATH&&=$(_MTB_RECIPE__ECLIPSE_OPENOCD_SVD_PATH)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__SYM_FILE&&=$(_MTB_RECIPE__ECLIPSE_SYM_FILE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__PROG_FILE&&=$(_MTB_RECIPE__ECLIPSE_PROG_FILE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__ECLIPSE_GDB&&=$(_MTB_RECIPE__ECLIPSE_GDB)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__ECLIPSE_JLINK_EXE&&=$(_MTB_RECIPE__ECLIPSE_JLINK_EXE)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__APP_NAME&&=$(_MTB_RECIPE__ECLIPSE_APPLICATION_NAME)) + $(call mtb__file_append,$(_MTB_RECIPE__IDE_COMMON_TEXT_DATA_FILE),&&_MTB_RECIPE__PRJ_NAME&&=$(_MTB_RECIPE__ECLIPSE_PROJECT_NAME)) + +.PHONY: recipe_eclipse_common_text_replacement_data_file + +############################################## +# EW +############################################## +_MTB_RECIPE__IDE_DFP_DATA_FILE=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/recipe_ide_dfp_data.txt +ewarm8: MTB_CORE__EXPORT_CMDLINE+= -dfp_data $(_MTB_RECIPE__IDE_DFP_DATA_FILE) +ewarm8: recipe_ewarm_dfp_data_file + +recipe_ewarm_dfp_data_file: + $(call mtb__file_write,$(_MTB_RECIPE__IDE_DFP_DATA_FILE),DEVICE=$(DEVICE)$(_MTB_RECIPE__IAR_CORE_SUFFIX)) + +.PHONY: recipe_ewarm_dfp_data_file + diff --git a/make/recipe/program.mk b/make/recipe/program.mk index d252898..5795e07 100644 --- a/make/recipe/program.mk +++ b/make/recipe/program.mk @@ -7,7 +7,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,13 +27,69 @@ ifeq ($(WHICHFILE),true) $(info Processing $(lastword $(MAKEFILE_LIST))) endif -program: - $(call mtb__error,CLI program is not supported for the current device. Use IDE for program purpose) +_MTB_RECIPE__GDB_ARGS=$(MTB_TOOLS__RECIPE_DIR)/make/scripts/gdbinit +_MTB_RECIPE__SYMBOL_IMG=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) + +# +# jlink gdb server command line launch +# +_MTB_RECIPE__JLINK_GDB_SERVER_ARGS=-if swd -device $(DEVICE) -endian little -speed auto -port 2331 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui +_MTB_RECIPE__GDB_SERVER_COMMAND:="$(MTB_CORE__JLINK_GDB_EXE)" $(_MTB_RECIPE__JLINK_GDB_SERVER_ARGS) +_MTB_RECIPE__JLink_COMMANDER_ARGS:=-AutoConnect 1 -ExitOnError 1 -NoGui 1 -Device $(DEVICE) -If SWD -Speed 4000 +_MTB_RECIPE__JLink_PROGRAM_COMMAND:="$(MTB_CORE__JLINK_EXE)" $(_MTB_RECIPE__JLink_COMMANDER_ARGS) -CommandFile $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/program.jlink +_MTB_RECIPE__JLink_ERASE_COMMAND:="$(MTB_CORE__JLINK_EXE)" $(_MTB_RECIPE__JLink_COMMANDER_ARGS) -CommandFile $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/erase.jlink + +# Generate command files required by JLink tool for programming/erasing +jlink_generate: + sed "s|&&PROG_FILE&&|$(_MTB_RECIPE__OPENOCD_PROGRAM_IMG)|g;" $(MTB_TOOLS__RECIPE_DIR)/make/scripts/program.jlink > $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/program.jlink + cp $(MTB_TOOLS__RECIPE_DIR)/make/scripts/erase.jlink $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/erase.jlink + +program: build qprogram + +program_JLink: jlink_generate +erase_JLink: jlink_generate + +# +# only program if it is not a lib project, and if not DIRECT_LOAD +# qprogram: - $(call mtb__error,CLI program is not supported for the current device. Use IDE for program purpose) -debug: - $(call mtb__error,CLI program is not supported for the current device. Use IDE for debug) +ifeq ($(LIBNAME),) + $(MTB__NOISE)echo;\ + echo "Programming target device ... " + $(_MTB_RECIPE__JLink_PROGRAM_COMMAND) + echo "Programming complete" +else + $(MTB__NOISE)echo "Library application detected. Skip programming... ";\ + echo +endif + +debug: program qdebug + qdebug: - $(call mtb__error,CLI program is not supported for the current device. Use IDE for debug) +ifeq ($(LIBNAME),) + $(MTB__NOISE)echo;\ + echo ==============================================================================;\ + echo "Instruction:";\ + echo "Open a separate shell and run the attach target (make attach)";\ + echo "to start the GDB client. Then use the GDB commands to debug.";\ + echo ==============================================================================;\ + echo;\ + echo "Opening GDB port ... ";\ + $(_MTB_RECIPE__GDB_SERVER_COMMAND) +else + $(MTB__NOISE)echo "Library application detected. Skip debug... ";\ + echo +endif + attach: - $(call mtb__error,CLI program is not supported for the current device. Use IDE for debug) + $(MTB__NOISE)echo;\ + echo "Starting GDB Client... ";\ + echo "DBG: $(MTB_TOOLCHAIN_GCC_ARM__GDB) $(_MTB_RECIPE__SYMBOL_IMG) -x $(_MTB_RECIPE__GDB_ARGS)";\ + $(MTB_TOOLCHAIN_GCC_ARM__GDB) $(_MTB_RECIPE__SYMBOL_IMG) -x $(_MTB_RECIPE__GDB_ARGS) + +erase: + $(MTB__NOISE)echo;\ + echo "Erasing target device ... ";\ + $(_MTB_RECIPE__JLink_ERASE_COMMAND) + +.PHONY: erase attach qdebug debug qprogram program \ No newline at end of file diff --git a/make/recipe/recipe.mk b/make/recipe/recipe.mk index 5a0dc79..73f5fd1 100644 --- a/make/recipe/recipe.mk +++ b/make/recipe/recipe.mk @@ -7,7 +7,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/make/recipe/recipe_common.mk b/make/recipe/recipe_common.mk index f3211a4..2fd92b1 100644 --- a/make/recipe/recipe_common.mk +++ b/make/recipe/recipe_common.mk @@ -6,7 +6,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,6 +26,22 @@ ifeq ($(WHICHFILE),true) $(info Processing $(lastword $(MAKEFILE_LIST))) endif +# Determine programming interface. Use BSP_PROGRAM_INTERFACE if it is set, +# otherwise use the default one +_MTB_RECIPE__DEFAULT_PROGRAM_INTERFACE?=KitProg3 +ifeq (,$(BSP_PROGRAM_INTERFACE)) +_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR:=$(_MTB_RECIPE__DEFAULT_PROGRAM_INTERFACE) +else +_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR:=$(BSP_PROGRAM_INTERFACE) +endif + +# debug interface validation +debug_interface_check: +ifeq ($(filter $(_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR), $(_MTB_RECIPE__PROGRAM_INTERFACE_SUPPORTED)),) + $(error "$(_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR)" interface is not supported for this device. \ + Supported interfaces are "$(_MTB_RECIPE__PROGRAM_INTERFACE_SUPPORTED)") +endif + ################################################################################ # QSPI programming flags ################################################################################ @@ -48,9 +64,11 @@ _MTB_RECIPE__PROJECT_DIR_NAME=$(notdir $(realpath $(MTB_TOOLS__PRJ_DIR))) ifeq ($(_MTB_RECIPE__CONFIG_MODUS_FILE),) _MTB_RECIPE__CONFIG_MODUS_OUTPUT= _MTB_RECIPE__OPENOCD_QSPI_CFG_PATH_WITH_FLAG= +_MTB_RECIPE__OPENOCD_QSPI_CFG_PATH_APPLICATION_WITH_FLAG= else _MTB_RECIPE__CONFIG_MODUS_OUTPUT=$(call mtb__get_dir,$(_MTB_RECIPE__CONFIG_MODUS_FILE))/GeneratedSource _MTB_RECIPE__OPENOCD_QSPI_CFG_PATH_WITH_FLAG=-s "$(_MTB_RECIPE__CONFIG_MODUS_OUTPUT)"&\#13;&\#10; +_MTB_RECIPE__OPENOCD_QSPI_CFG_PATH_APPLICATION_WITH_FLAG=-s "$(patsubst $(call mtb_path_normalize,$(MTB_TOOLS__PRJ_DIR)/..)/%,%,$(call mtb_path_normalize,$(_MTB_RECIPE__CONFIG_MODUS_OUTPUT)))"&\#13;&\#10; endif _MTB_RECIPE__OPENOCD_QSPI_CFG_PATH=$(_MTB_RECIPE__CONFIG_MODUS_OUTPUT) _MTB_RECIPE__OPENOCD_QSPI_CFG_PATH_APPLICATION=$(patsubst $(call mtb_path_normalize,$(MTB_TOOLS__PRJ_DIR)/..)/%,%,$(call mtb_path_normalize,$(_MTB_RECIPE__CONFIG_MODUS_OUTPUT))) @@ -138,48 +156,64 @@ recipe_prebuild: # ifeq ($(LIBNAME),) -recipe_postbuild: $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +_MTB_RECIPE__PROG_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +_MTB_RECIPE__TARG_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) + +recipe_postbuild: $(_MTB_RECIPE__PROG_FILE) -$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM): $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) +$(_MTB_RECIPE__PROG_FILE): $(_MTB_RECIPE__TARG_FILE) ifeq ($(TOOLCHAIN),A_Clang) $(_MTB_RECIPE__ACLANG_POSTBUILD) endif ifeq ($(TOOLCHAIN),ARM) - $(MTB_TOOLCHAIN_ARM__BASE_DIR)/bin/fromelf --output $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) --i32combined $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) + $(MTB_TOOLCHAIN_ARM__BASE_DIR)/bin/fromelf --output $(_MTB_RECIPE__PROG_FILE) --i32combined $(_MTB_RECIPE__TARG_FILE) endif ifeq ($(TOOLCHAIN),IAR) - $(MTB_TOOLCHAIN_GCC_ARM__OBJCOPY) -O ihex $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) + $(MTB_TOOLCHAIN_GCC_ARM__OBJCOPY) -O ihex $(_MTB_RECIPE__TARG_FILE) $(_MTB_RECIPE__PROG_FILE) endif ifeq ($(TOOLCHAIN),GCC_ARM) - $(MTB_TOOLCHAIN_GCC_ARM__OBJCOPY) -O ihex $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) + $(MTB_TOOLCHAIN_GCC_ARM__OBJCOPY) -O ihex $(_MTB_RECIPE__TARG_FILE) $(_MTB_RECIPE__PROG_FILE) endif ifeq ($(MTB_TYPE),PROJECT) +# There are 2 dependencies on this file. +# The first is from build_proj and qbuild_proj. In ths case, we are promoting. We add project_postbuild as a dependency becase that could modify the hex file. +# The second is when generating the combined hex file or fist stage build. In this case, we are not promoting and cannot depend on project_postbuild as that is only defined in second stage. ifeq ($(MTB_APPLICATION_PROMOTE),true) -recipe_postbuild: $(_MTB_RECIPE__PRJ_HEX_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +ifneq ($(CY_SECONDSTAGE),) +build_proj qbuild_proj: $(_MTB_RECIPE__PRJ_HEX_DIR)/$(_MTB_RECIPE__PROJECT_DIR_NAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +$(_MTB_RECIPE__PRJ_HEX_DIR)/$(_MTB_RECIPE__PROJECT_DIR_NAME).$(MTB_RECIPE__SUFFIX_PROGRAM): project_postbuild +endif endif -# Copy project-specific program image to the application directory -$(_MTB_RECIPE__PRJ_HEX_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM): $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +$(_MTB_RECIPE__PRJ_HEX_DIR): $(MTB__NOISE)mkdir -p $(_MTB_RECIPE__PRJ_HEX_DIR) - cp $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) $(_MTB_RECIPE__PRJ_HEX_DIR)/$(_MTB_RECIPE__PROJECT_DIR_NAME).$(MTB_RECIPE__SUFFIX_PROGRAM) -# always regenerate the hex file in case the build dir or config changes -.PHONY: $(_MTB_RECIPE__PRJ_HEX_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) +.PHONY:$(_MTB_RECIPE__PRJ_HEX_DIR) + +$(_MTB_RECIPE__PRJ_HEX_DIR)/$(_MTB_RECIPE__PROJECT_DIR_NAME).$(MTB_RECIPE__SUFFIX_PROGRAM).d: $(_MTB_RECIPE__PRJ_HEX_DIR) + $(MTB__NOISE)echo $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) > $@.tmp + $(MTB__NOISE)if ! cmp -s "$@" "$@.tmp"; then \ + mv -f "$@.tmp" "$@" ; \ + else \ + rm -f "$@.tmp"; \ + fi + +# Copy project-specific program image to the application directory +$(_MTB_RECIPE__PRJ_HEX_DIR)/$(_MTB_RECIPE__PROJECT_DIR_NAME).$(MTB_RECIPE__SUFFIX_PROGRAM): $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_PROGRAM) $(_MTB_RECIPE__PRJ_HEX_DIR)/$(_MTB_RECIPE__PROJECT_DIR_NAME).$(MTB_RECIPE__SUFFIX_PROGRAM).d + $(MTB__NOISE)cp -rf $< $@ ifneq ($(MTB_APPLICATION_SUBPROJECTS),) # Multi-core application build/qbuild targets run application_postbuild # for the first project in the MTB_PROJECTS list application_postbuild: $(_MTB_RECIPE__APP_HEX_FILE) -$(_MTB_RECIPE__APP_HEX_FILE): $(foreach project,$(MTB_APPLICATION_SUBPROJECTS),$(_MTB_RECIPE__PRJ_HEX_DIR)/$(project).$(MTB_RECIPE__SUFFIX_PROGRAM)) +$(_MTB_RECIPE__APP_HEX_FILE): $(foreach project,$(MTB_APPLICATION_SUBPROJECTS),$(_MTB_RECIPE__PRJ_HEX_DIR)/$(project).$(MTB_RECIPE__SUFFIX_PROGRAM) $(_MTB_RECIPE__PRJ_HEX_DIR)/$(project).$(MTB_RECIPE__SUFFIX_PROGRAM).d) ifeq ($(CY_TOOL_srec_cat_EXE_ABS),) $(call mtb__error,Unable to proceed. srec_cat executable not found) endif - $(CY_TOOL_srec_cat_EXE_ABS) $(foreach project,$(MTB_APPLICATION_SUBPROJECTS),$(_MTB_RECIPE__PRJ_HEX_DIR)/$(project).$(MTB_RECIPE__SUFFIX_PROGRAM) -intel) -o $(_MTB_RECIPE__APP_HEX_FILE) -intel --Output_Block_Size 16 - -# always regenerate the hex file in case the build dir or config changes -.PHONY: $(_MTB_RECIPE__APP_HEX_FILE) + $(info Generating combined hex file: $(_MTB_RECIPE__APP_HEX_FILE)) + $(MTB__NOISE)$(CY_TOOL_srec_cat_EXE_ABS) $(foreach project,$(MTB_APPLICATION_SUBPROJECTS),$(_MTB_RECIPE__PRJ_HEX_DIR)/$(project).$(MTB_RECIPE__SUFFIX_PROGRAM) -intel) -o $(_MTB_RECIPE__APP_HEX_FILE) -intel --Output_Block_Size 16 endif #($(MTB_APPLICATION_SUBPROJECTS),) endif #($(MTB_TYPE),PROJECT) @@ -193,7 +227,7 @@ ifeq ($(TOOLCHAIN),A_Clang) _MTB_RECIPE__GEN_READELF= _MTB_RECIPE__MEMORY_CAL= else -_MTB_RECIPE__GEN_READELF=$(MTB_TOOLCHAIN_GCC_ARM__READELF) -Sl $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET) > $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).readelf +_MTB_RECIPE__GEN_READELF=$(MTB_TOOLCHAIN_GCC_ARM__READELF) -Sl $(_MTB_RECIPE__TARG_FILE) > $(MTB_TOOLS__OUTPUT_CONFIG_DIR)/$(APPNAME).readelf _MTB_RECIPE__MEM_CALC=\ bash --norc --noprofile\ $(MTB_TOOLS__CORE_DIR)/make/scripts/memcalc.bash\ diff --git a/make/recipe/recipe_setup.mk b/make/recipe/recipe_setup.mk index ba33315..640c30a 100644 --- a/make/recipe/recipe_setup.mk +++ b/make/recipe/recipe_setup.mk @@ -6,7 +6,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -63,7 +63,7 @@ ifeq ($(MTB_RECIPE__LINKER_SCRIPT),) ifneq ($(wildcard $(call mtb_core__escaped_path,$(_MTB_RECIPE__LINKER_SCRIPT_USER))),) MTB_RECIPE__LINKER_SCRIPT:=$(_MTB_RECIPE__LINKER_SCRIPT_USER) else -$(call mtb_error,Unable to find linker script '$(LINKER_SCRIPT)'.) +$(call mtb__error,Unable to find linker script '$(LINKER_SCRIPT)'.) endif endif # ($(_MTB_RECIPE__LINKER_SCRIPT_USER),) endif # ($(LINKER_SCRIPT),) @@ -75,7 +75,7 @@ ifeq ($(MTB_RECIPE__LINKER_SCRIPT),) ifneq ($(wildcard $(call mtb_core__escaped_path,$(_MTB_RECIPE__LINKER_SCRIPT_BSP))),) MTB_RECIPE__LINKER_SCRIPT:=$(_MTB_RECIPE__LINKER_SCRIPT_BSP) else -$(call mtb_error,Unable to find linker script '$(MTB_BSP__LINKER_SCRIPT)'.) +$(call mtb__error,Unable to find linker script '$(MTB_BSP__LINKER_SCRIPT)'.) endif endif # ($(_MTB_RECIPE__LINKER_SCRIPT_BSP),) endif # ($(MTB_BSP__LINKER_SCRIPT),) @@ -104,7 +104,7 @@ endif endif ifeq ($(wildcard $(call mtb_core__escaped_path,$(MTB_RECIPE__LINKER_SCRIPT))),) -$(call mtb_error,Unable to find linker.$(MTB_RECIPE__SUFFIX_LS) in $(_MTB_RECIPE__LINKER_SCRIPT_MC1)$(MTB__COMMA) $(_MTB_RECIPE__LINKER_SCRIPT_MC2)$(MTB__COMMA) or $(_MTB_RECIPE__LINKER_SCRIPT_SC).) +$(call mtb__error,Unable to find linker.$(MTB_RECIPE__SUFFIX_LS) in $(_MTB_RECIPE__LINKER_SCRIPT_MC1)$(MTB__COMMA) $(_MTB_RECIPE__LINKER_SCRIPT_MC2)$(MTB__COMMA) or $(_MTB_RECIPE__LINKER_SCRIPT_SC).) endif ifeq ($(TOOLCHAIN),A_Clang) @@ -113,11 +113,11 @@ endif # Compiler, assember, linker, etc. arguments. -MTB_RECIPE__CFLAGS:=$(CFLAGS) $(MTB_TOOLCHAIN_$(TOOLCHAIN)__CFLAGS) -MTB_RECIPE__CXXFLAGS:=$(CXXFLAGS) $(MTB_TOOLCHAIN_$(TOOLCHAIN)__CXXFLAGS) -MTB_RECIPE__ASFLAGS:=$(ASFLAGS) $(MTB_TOOLCHAIN_$(TOOLCHAIN)__ASFLAGS) -MTB_RECIPE__ARFLAGS:=$(MTB_TOOLCHAIN_$(TOOLCHAIN)__ARFLAGS) -MTB_RECIPE__LDFLAGS:=$(LDFLAGS) $(MTB_TOOLCHAIN_$(TOOLCHAIN)__LDFLAGS) +MTB_RECIPE__CFLAGS=$(CFLAGS) $(MTB_TOOLCHAIN_$(TOOLCHAIN)__CFLAGS) +MTB_RECIPE__CXXFLAGS=$(CXXFLAGS) $(MTB_TOOLCHAIN_$(TOOLCHAIN)__CXXFLAGS) +MTB_RECIPE__ASFLAGS=$(ASFLAGS) $(MTB_TOOLCHAIN_$(TOOLCHAIN)__ASFLAGS) +MTB_RECIPE__ARFLAGS=$(MTB_TOOLCHAIN_$(TOOLCHAIN)__ARFLAGS) +MTB_RECIPE__LDFLAGS=$(LDFLAGS) $(MTB_TOOLCHAIN_$(TOOLCHAIN)__LDFLAGS) ifneq ($(TOOLCHAIN),A_Clang) MTB_RECIPE__LDFLAGS+=$(MTB_RECIPE__LSFLAGS)"$(MTB_RECIPE__LINKER_SCRIPT)" @@ -150,3 +150,5 @@ MTB_RECIPE__EXPLICIT_DEPENDENCIES=$(MTB_TOOLCHAIN_$(TOOLCHAIN)__EXPLICIT_DEPENDE MTB_RECIPE__TOOLCHAIN_INCLUDES:=$(MTB_TOOLCHAIN_$(TOOLCHAIN)__INCLUDES) MTB_RECIPE__TOOLCHAIN_DEFINES:=$(MTB_TOOLCHAIN_$(TOOLCHAIN)__DEFINES) + +MTB_RECIPE__TOOLCHAIN_VSCODE_INTELLISENSE_MODE:=$(MTB_TOOLCHAIN_$(TOOLCHAIN)__VSCODE_INTELLISENSE_MODE) diff --git a/make/recipe/recipe_toolchain_file_types.mk b/make/recipe/recipe_toolchain_file_types.mk index d4ca880..cb260c2 100644 --- a/make/recipe/recipe_toolchain_file_types.mk +++ b/make/recipe/recipe_toolchain_file_types.mk @@ -6,7 +6,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/make/scripts/erase.jlink b/make/scripts/erase.jlink new file mode 100644 index 0000000..ae71985 --- /dev/null +++ b/make/scripts/erase.jlink @@ -0,0 +1,2 @@ +Erase +Exit \ No newline at end of file diff --git a/make/scripts/gdbinit b/make/scripts/gdbinit new file mode 100644 index 0000000..c667d96 --- /dev/null +++ b/make/scripts/gdbinit @@ -0,0 +1,17 @@ +# Core port +target remote:2331 + +# Open all memory +set mem inaccessible-by-default off + +# Load the executable +# load + +# Reset device +monitor reset + +# Set temporary breakpoint at main +tbreak main + +# Continue program execution +continue \ No newline at end of file diff --git a/make/scripts/eclipse/Attach (JLink).xml b/make/scripts/interface_version_1/eclipse/Attach (JLink).xml similarity index 100% rename from make/scripts/eclipse/Attach (JLink).xml rename to make/scripts/interface_version_1/eclipse/Attach (JLink).xml diff --git a/make/scripts/eclipse/Debug (JLink).xml b/make/scripts/interface_version_1/eclipse/Debug (JLink).xml similarity index 100% rename from make/scripts/eclipse/Debug (JLink).xml rename to make/scripts/interface_version_1/eclipse/Debug (JLink).xml diff --git a/make/scripts/eclipse/Erase (JLink).xml b/make/scripts/interface_version_1/eclipse/Erase (JLink).xml similarity index 100% rename from make/scripts/eclipse/Erase (JLink).xml rename to make/scripts/interface_version_1/eclipse/Erase (JLink).xml diff --git a/make/scripts/eclipse/Program (JLink).xml b/make/scripts/interface_version_1/eclipse/Program (JLink).xml similarity index 100% rename from make/scripts/eclipse/Program (JLink).xml rename to make/scripts/interface_version_1/eclipse/Program (JLink).xml diff --git a/make/scripts/vscode/launch.json b/make/scripts/interface_version_1/vscode/launch.json similarity index 100% rename from make/scripts/vscode/launch.json rename to make/scripts/interface_version_1/vscode/launch.json diff --git a/make/scripts/vscode/openocd.tcl b/make/scripts/interface_version_1/vscode/openocd.tcl similarity index 100% rename from make/scripts/vscode/openocd.tcl rename to make/scripts/interface_version_1/vscode/openocd.tcl diff --git a/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Attach (JLink).launch b/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Attach (JLink).launch new file mode 100644 index 0000000..a86e341 --- /dev/null +++ b/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Attach (JLink).launch @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Debug (JLink).launch b/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Debug (JLink).launch new file mode 100644 index 0000000..3a04fc5 --- /dev/null +++ b/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Debug (JLink).launch @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Erase (JLink).launch b/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Erase (JLink).launch new file mode 100644 index 0000000..9ace5c0 --- /dev/null +++ b/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Erase (JLink).launch @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Program (JLink).launch b/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Program (JLink).launch new file mode 100644 index 0000000..bbaeee8 --- /dev/null +++ b/make/scripts/interface_version_2/eclipse/JLink/&&_MTB_RECIPE__PRJ_NAME&& Program (JLink).launch @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/make/scripts/interface_version_2/vscode/JLink/launch.json b/make/scripts/interface_version_2/vscode/JLink/launch.json new file mode 100644 index 0000000..10d9ca4 --- /dev/null +++ b/make/scripts/interface_version_2/vscode/JLink/launch.json @@ -0,0 +1,120 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + // + // NOTE for JLink users: + // + // Ensure that Segger Sottware is preinstalled on PC + // Windows: Download latest version from: https://www.segger.com/downloads/jlink/JLink_Windows.exe + // Please create the following setting in your VSCode User Settings or in + // your global PATH. Cortex-Debug needs to find the specific gdb-server + // you want to use. + // + // Windows : "cortex-debug.JLinkGDBServerPath": "/JLinkGDBServerCL" + // Linux / Mac : "cortex-debug.JLinkGDBServerPath": "/JLinkGDBServer" + // + // User settings are located in: + // + // Windows : %APPDATA%/Code/User/settings.json + // Mac : $HOME/Library/Application Support/Code/User/settings.json + // Linux : $HOME/.config/Code/User/settings.json + // + // You can use the VSCode Settings UI to edit the files mentioned above. + // + // For the JLink configurations in this file, the "device" name comes from + // the list found here: + // https://www.segger.com/downloads/supported-devices.php + // + "version": "0.2.0", + "configurations": [ + { + "name": "Launch (JLink)", + "type": "cortex-debug", + "request": "launch", + "cwd": "${workspaceFolder}", + "executable": "&&_MTB_RECIPE__ELF_FILE&&", + "servertype": "jlink", + "device": "&&DEVICE&&", + "preLaunchCommands": [ + // Program via the hex file to get complete coverage + "exec-file &&_MTB_RECIPE__HEX_FILE&&" + ], + "overrideRestartCommands": [ + "starti" + ], + // svdFile is optional, it can be very large. + "svdFile": "&&_MTB_RECIPE__SVD_FILE_NAME&&", + "breakAfterReset": true, + "runToEntryPoint": "main", // Specifies application entry point name where program will halt + "preLaunchTask": "Build", // Set this to run a task from tasks.json before + // starting a debug session + "showDevDebugOutput": "none" + }, + // When using 'attach', make sure your program is running on the board and that your + // executable matches the image in the chip exactly, or else strange things can happen + // with breakpoints, variables, etc. + { + "name": "Attach (JLink)", + "type": "cortex-debug", + "request": "attach", + "cwd": "${workspaceFolder}", + "executable": "&&_MTB_RECIPE__ELF_FILE&&", + "servertype": "jlink", + "device": "&&_MTB_RECIPE__DEVICE_ATTACH&&", + "overrideRestartCommands": [ + "starti" + ], + // svdFile is optional, it can be very large. + "svdFile": "&&_MTB_RECIPE__SVD_FILE_NAME&&", + "breakAfterReset": true, + "runToEntryPoint": "&&_MTB_RECIPE__APP_ENTRY_POINT&&", // Specifies application entry point name for restart/reset + "showDevDebugOutput": "none" + }, + { + "name": "Erase (JLink)", + "type": "cortex-debug", + "request": "launch", + "cwd": "${workspaceFolder}", + // executable not needed but need some valid file to get the session to start + "executable": "&&_MTB_RECIPE__ELF_FILE&&", + "servertype": "jlink", + "device": "&&DEVICE&&", + "overrideLaunchCommands": [ + "monitor reset", // Reset both core and the peripherals + "monitor flash erase", + "monitor reset" // Reset both core and the peripherals + ], + "postStartSessionCommands": [ + "quit" + ], + "showDevDebugOutput": "none" + }, + { + "name": "Program (JLink)", + "type": "cortex-debug", + "request": "launch", + "cwd": "${workspaceFolder}", + // Program via the hex file to get complete coverage, no need for symbols + "executable": "&&_MTB_RECIPE__ELF_FILE&&", + "servertype": "jlink", + "device": "&&DEVICE&&", + "preLaunchCommands": [ + // Program via the hex file to get complete coverage + "exec-file &&_MTB_RECIPE__HEX_FILE&&" + ], + "overrideLaunchCommands": [ + "monitor reset", // Reset both core and the peripherals + "-target-download", + "monitor reset", // Reset both core and the peripherals + "monitor go" + ], + "postStartSessionCommands": [ + "quit" + ], + "preLaunchTask": "Build", // Set this to run a task from tasks.json + // before device programming + "showDevDebugOutput": "none" + } + ] +} diff --git a/make/scripts/program.jlink b/make/scripts/program.jlink new file mode 100644 index 0000000..0fe4cd8 --- /dev/null +++ b/make/scripts/program.jlink @@ -0,0 +1,5 @@ +Connect +LoadFile &&PROG_FILE&& 0 reset +Reset +Go +Exit \ No newline at end of file diff --git a/make/toolchains/ARM.mk b/make/toolchains/ARM.mk index 82cca8e..2d8b43b 100644 --- a/make/toolchains/ARM.mk +++ b/make/toolchains/ARM.mk @@ -6,7 +6,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -76,6 +76,9 @@ mtb_toolchain_ARM__elf2bin=$(MTB_TOOLCHAIN_ARM__ELF2BIN) --output $2 --bin $1 ifeq ($(CONFIG),Debug) _MTB_TOOLCHAIN_ARM__DEBUG_FLAG:=-DDEBUG=DEBUG _MTB_TOOLCHAIN_ARM__OPTIMIZATION:=-O1 +ifneq (,$(filter -fomit-frame-pointer,$(CFLAGS) $(CXXFLAGS))) +_MTB_TOOLCHAIN_ARM__OPTIMIZATION+=-fno-omit-frame-pointer +endif else ifeq ($(CONFIG),Release) _MTB_TOOLCHAIN_ARM__DEBUG_FLAG:=-DNDEBUG @@ -94,7 +97,7 @@ ifeq ($(MTB_RECIPE__CORE),CM0) # Arm Cortex-M0 CPU _MTB_TOOLCHAIN_ARM__CFLAGS_CORE:=-mcpu=cortex-m0 _MTB_TOOLCHAIN_ARM__FLAGS_CORE:=--cpu=Cortex-M0 -_MTB_TOOLCHAIN_ARM__VFP_FLAGS0:= +_MTB_TOOLCHAIN_ARM__VFP_FLAGS:= endif ifeq ($(MTB_RECIPE__CORE),CM0P) @@ -191,3 +194,5 @@ MTB_TOOLCHAIN_ARM__INCLUDES:= # Additional libraries in the link process based on this toolchain MTB_TOOLCHAIN_ARM__DEFINES:=$(_MTB_TOOLCHAIN_ARM__DEBUG_FLAG) + +MTB_TOOLCHAIN_ARM__VSCODE_INTELLISENSE_MODE:=clang-arm diff --git a/make/toolchains/GCC_ARM.mk b/make/toolchains/GCC_ARM.mk index e75b88f..215cb58 100644 --- a/make/toolchains/GCC_ARM.mk +++ b/make/toolchains/GCC_ARM.mk @@ -6,7 +6,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -113,9 +113,6 @@ _MTB_TOOLCHAIN_GCC_ARM__COMMON_FLAGS:=\ -Wall\ -pipe -# NOTE: The official NewLib Nano build leaks file buffers when used with reentrant support. -# The ModusToolbox 2.2+ installer bundles a version that fixes this leak that has not yet been -# accepted upstream. _MTB_TOOLCHAIN_GCC_ARM__NEWLIBNANO:=--specs=nano.specs # CPU core specifics @@ -217,3 +214,5 @@ MTB_TOOLCHAIN_GCC_ARM__INCLUDES:= # Additional libraries in the link process based on this toolchain MTB_TOOLCHAIN_GCC_ARM__DEFINES:=$(_MTB_TOOLCHAIN_GCC_ARM__DEBUG_FLAG) + +MTB_TOOLCHAIN_GCC_ARM__VSCODE_INTELLISENSE_MODE:=gcc-arm diff --git a/make/toolchains/IAR.mk b/make/toolchains/IAR.mk index 085fa86..3b1dfd9 100644 --- a/make/toolchains/IAR.mk +++ b/make/toolchains/IAR.mk @@ -6,7 +6,7 @@ # ################################################################################ # \copyright -# Copyright 2018-2021 Cypress Semiconductor Corporation +# Copyright 2018-2023 Cypress Semiconductor Corporation # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -182,8 +182,8 @@ MTB_TOOLCHAIN_IAR__ARFLAGS:=\ --verbose # Enable Multi-Threaded build arguments -# Note: If these FreeRTOS-specific flags are modified, the instructions in ide.mk should be updated to reflect the changes. -ifeq ($(filter FREERTOS,$(COMPONENTS)),FREERTOS) +# Note: If these RTOS-specific flags are modified, the instructions in ide.mk should be updated to reflect the changes. +ifneq (,$(filter MW_ABSTRACTION_RTOS,$(COMPONENTS))) MTB_TOOLCHAIN_IAR__CFLAGS +=--dlib_config=full MTB_TOOLCHAIN_IAR__CXXFLAGS+=--dlib_config=full MTB_TOOLCHAIN_IAR__LDFLAGS +=--threaded_lib @@ -224,3 +224,7 @@ MTB_TOOLCHAIN_IAR__INCLUDES:= # Additional libraries in the link process based on this toolchain MTB_TOOLCHAIN_IAR__DEFINES:=$(_MTB_TOOLCHAIN_IAR__DEBUG_FLAG) + +# https://github.com/microsoft/vscode-cmake-tools/issues/1096 +# vsocde c/c++ pluggin current does not suppot IAR intellisense mode. Use gcc-arm for now. +MTB_TOOLCHAIN_IAR__VSCODE_INTELLISENSE_MODE:=gcc-arm diff --git a/version.xml b/version.xml index ccab39e..2fc5c01 100644 --- a/version.xml +++ b/version.xml @@ -1 +1 @@ -2.0.0.4056 +2.1.1.4648