Skip to content

Commit

Permalink
Upload recipe-make-cat5 1.2.0.5186 [2314]
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Apr 2, 2024
1 parent d40f42a commit 0bad169
Show file tree
Hide file tree
Showing 40 changed files with 2,261 additions and 1,553 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# CYW55513 GNU make Build System

## This version of the recipe-make-cat5 library is a Beta release to support CYW55513 devices only. Do not use it for production development or in applications targeting other devices.

## Overview

This repo provides the build recipe make files and scripts for building and programming CYW55513 applications. Builds can be run either through a command-line interface (CLI) or through the Eclipse IDE for ModusToolbox.
Expand All @@ -20,4 +18,4 @@ To list the build options, run the "help" target by typing "make help" in CLI. F
* [Infineon GitHub](https://github.com/Infineon)
* [ModusToolbox](https://www.infineon.com/cms/en/design-support/tools/sdk/modustoolbox-software)
---
© Cypress Semiconductor Corporation, 2022.
© Cypress Semiconductor Corporation, 2022-2024.
16 changes: 9 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# CYW55513 GNU make Build System Release Notes

## This version of the recipe-make-cat5 library is a Beta release to support CYW55513 devices only. Do not use it for production development or in applications targeting other devices.

# CYW55513 GNU make Build System Release Notes
This repo provides the build recipe make files and scripts for building and programming CYW55513 applications. Builds can be run either through a command-line interface (CLI) or through the Eclipse IDE for ModusToolbox.

Expand All @@ -21,6 +17,12 @@ This release of the CYW55513 GNU make build recipe includes complete support for
This also includes the getlibs.bash script that can be used directly, or via the make target to download additional git repo based libraries for the application.

### What Changed?
#### v1.2.0
* CYW55513 device support added

#### v1.1.1
* Minor change to symbol file handling

#### v1.0.0
* Initial production release

Expand All @@ -34,17 +36,17 @@ This version of the CYW55513 build system was validated for compatibility with t

| Software and Tools | Version |
| :--- | :----: |
| ModusToolbox Software Environment | 3.0 |
| ModusToolbox Software Environment | 3.2 |
| GCC Compiler | 11.3 |
| IAR Compiler | 9.3 |
| ARM Compiler | 6.16 |

Minimum required ModusToolbox Software Environment: v3.0
Minimum required ModusToolbox Software Environment: v3.2

### More information
* [Infineon GitHub](https://github.com/Infineon)
* [ModusToolbox](https://www.infineon.com/cms/en/design-support/tools/sdk/modustoolbox-software)

---
© Cypress Semiconductor Corporation, 2022.
© Cypress Semiconductor Corporation, 2022-2024.

2 changes: 1 addition & 1 deletion make/recipe/core_selection.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
################################################################################
# \copyright
# Copyright 2018-2023 Cypress Semiconductor Corporation
# Copyright 2018-2024 Cypress Semiconductor Corporation
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
139 changes: 100 additions & 39 deletions make/recipe/defines.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2016-2023, Cypress Semiconductor Corporation (an Infineon company) or
# Copyright 2016-2024, Cypress Semiconductor Corporation (an Infineon company) or
# an affiliate of Cypress Semiconductor Corporation. All rights reserved.
#
# This software, including source code, documentation and related
Expand Down Expand Up @@ -46,55 +46,79 @@ MTB_RECIPE__LINKER_SCRIPT:=$(lastword $(MAKEFILE_LIST))

# Programming interface description
ifeq (,$(BSP_PROGRAM_INTERFACE))
_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR=KitProg3
_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR:=KitProg3
else
_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR=$(BSP_PROGRAM_INTERFACE)
_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR:=$(BSP_PROGRAM_INTERFACE)
endif
ifeq ($(findstring $(_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR),KitProg3 JLink),)
$(call mtb__error,Unable to proceed. $(_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR) interface is not supported for this device)

# debug interface validation
debug_interface_check:
ifeq ($(filter $(_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR), KitProg3 JLink),)
$(error "$(_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR)" interface is not supported for this device. \
Supported interfaces are "KitProg3 JLink")
endif

_MTB_RECIPE__JLINK_DEVICE_CFG:=Cortex-M33
_MTB_RECIPE__OPENOCD_DEVICE_CFG:=cyw55500.cfg

#
# List the supported toolchains
#
CY_SUPPORTED_TOOLCHAINS=GCC_ARM
CY_SUPPORTED_TOOLCHAINS=GCC_ARM ARM
ifeq ($(filter $(TOOLCHAIN),$(CY_SUPPORTED_TOOLCHAINS)),)
$(error must use supported TOOLCHAIN such as: $(CY_SUPPORTED_TOOLCHAINS))
endif

ifeq ($(OS),Windows_NT)
CY_OS_DIR=Windows
CY_SHELL_STAT_CMD=stat -c %s
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CY_OS_DIR=Linux64
CY_SHELL_STAT_CMD=stat -c %s
endif
ifeq ($(UNAME_S),Darwin)
CY_OS_DIR=OSX
CY_SHELL_STAT_CMD=stat -f %z
endif
endif

CY_COMPILER_DIR_BWC:=$(MTB_TOOLCHAIN_GCC_ARM__BASE_DIR)
CY_COMPILER_DIR_BWC:=$(MTB_TOOLCHAIN_$(TOOLCHAIN)__BASE_DIR)
CY_MODUS_SHELL_DIR_BWC:=$(CY_TOOL_modus-shell_BASE_ABS)

################################################################################
# Feature processing
################################################################################
#
# floating point and other device specific compiler flags
#

# Enable CAT5 and THREADX support for all cat5 devices
MTB_RECIPE__COMPONENT+=CAT5 THREADX

# clib-support has _sbrk that needs heap section, default 128k
# also provide C link libraries
ifneq ($(filter %MW_CLIB_SUPPORT,$(COMPONENTS)),)
HEAP_SIZE?=0x20000
endif

# create a RAM download image *.hcd
DIRECT_LOAD?=1
ifeq ($(DIRECT_LOAD),0)
XIP?=1
endif
_MTB_RECIPE__XIP_FLASH:=$(if $(XIP),1)
ifeq ($(DIRECT_LOAD),0)
_MTB_RECIPE__XIP_FLASH:=1
endif

ifeq ($(DIRECT_LOAD),1)
CY_CORE_DIRECT_LOAD=_DIRECT_
CY_CORE_DIRECT_LOAD=_DIRECT_LOAD_
CY_CORE_CGS_ARGS+=-O DLConfigSSLocation:$(PLATFORM_DIRECT_LOAD_BASE_ADDR)
CY_CORE_CGS_ARGS+=-O DLMaxWriteSize:240
endif

CY_CORE_APP_ENTRY:=spar_crt_setup
# Bluetooth Device address
BT_DEVICE_ADDRESS:=default
BT_DEVICE_ADDRESS?=default
ifneq ($(BT_DEVICE_ADDRESS),)
CY_CORE_CGS_ARGS+=-O DLConfigBD_ADDRBase:$(BT_DEVICE_ADDRESS)
endif
Expand All @@ -115,47 +139,84 @@ CY_APP_DEFINES+=-DWICED_HCI_TRANSPORT=2
endif

# special handling for chip download
ifneq ($(XIP),)
CY_CORE_APP_CHIPLOAD_FLAGS+=-DL_TIMEOUT_MULTIPLIER 16
else
CY_CORE_APP_CHIPLOAD_FLAGS+=-DL_TIMEOUT_MULTIPLIER 2
endif

# flash area
CY_FLASH0_BEGIN_ADDR:=0x600000
CY_FLASH0_LENGTH:=0x1000000

# room to pad xip and fit app config
CY_FLASH0_PAD:=0x10000

# use flash offset and length to limit xip range
ifneq ($(CY_FLASH0_BEGIN_ADDR),)
CY_CORE_LD_DEFS+=FLASH0_BEGIN_ADDR=$(CY_FLASH0_BEGIN_ADDR)
endif
ifneq ($(CY_FLASH0_LENGTH),)
CY_CORE_LD_DEFS+=FLASH0_LENGTH=$(CY_FLASH0_LENGTH)
endif
# use btp file to determine flash layout
CY_CORE_LD_DEFS+=BTP=$(CY_CORE_BTP)

# XIP or flash patch
ifneq ($(_MTB_RECIPE__XIP_FLASH),)
CY_CORE_APP_SPECIFIC_DS_LEN?=0x1C
ifneq ($(XIP),1)
CY_CORE_LD_DEFS+=XIP_DS_OFFSET_FLASH_PATCH=$(CY_CORE_APP_SPECIFIC_DS_LEN)
CY_CORE_APP_FLASHPATCH_EXTRA=_FLASHPATCH_
$(info APP loads to RAM from FLASH except .cy_xip sections)
else
CY_CORE_LD_DEFS+=XIP_DS_OFFSET_FLASH_APP=$(CY_CORE_APP_SPECIFIC_DS_LEN)
CY_CORE_APP_XIP_EXTRA=_XIP_FLASHAPP_
$(info APP keeps code/rodata in XIP except .cy_ramfunc sections)
endif
CY_CORE_PATCH_FW_LEN:=$(shell $(CY_SHELL_STAT_CMD) $(CY_CORE_PATCH_FW))
CY_CORE_PATCH_SEC_LEN:=$(shell $(CY_SHELL_STAT_CMD) $(CY_CORE_PATCH_SEC))
CY_CORE_DS_LOCATION:=$(shell printf "0x%08X" $$(($(CY_CORE_PATCH_FW_LEN) + $(CY_CORE_PATCH_SEC_LEN) + 0x680048)))
CY_CORE_LD_DEFS+=DS_LOCATION=$(CY_CORE_DS_LOCATION)
CY_CORE_XIP_LEN_LD_DEFS:=XIP_LEN=$(shell printf "0x%08X" $$(($(CY_FLASH0_LENGTH) - ($(CY_CORE_DS_LOCATION) - $(CY_FLASH0_BEGIN_ADDR) + $(CY_FLASH0_PAD)))))
CY_CORE_LD_DEFS+=$(CY_CORE_XIP_LEN_LD_DEFS)
endif

# define heap
ifneq ($(HEAP_SIZE),)
CY_CORE_LD_DEFS+=HEAP_SIZE=$(HEAP_SIZE)
endif

#
# add to default linker script input section matches
#
LINKER_SCRIPT_ADD_XIP?=
LINKER_SCRIPT_ADD_RAM_CODE?=
LINKER_SCRIPT_ADD_RAM_DATA?=

# build into comma delimited lists for the command line
CY_CORE_LD_DEFS+=$(if $(LINKER_SCRIPT_ADD_XIP),ADD_XIP=$(subst $(MTB__SPACE),$(MTB__COMMA),$(LINKER_SCRIPT_ADD_XIP)))
CY_CORE_LD_DEFS+=$(if $(LINKER_SCRIPT_ADD_RAM_CODE),ADD_RAM_CODE=$(subst $(MTB__SPACE),$(MTB__COMMA),$(LINKER_SCRIPT_ADD_RAM_CODE)))
CY_CORE_LD_DEFS+=$(if $(LINKER_SCRIPT_ADD_RAM_DATA),ADD_RAM_DATA=$(subst $(MTB__SPACE),$(MTB__COMMA),$(LINKER_SCRIPT_ADD_RAM_DATA)))


#
# Core flags and defines
#
CY_CORE_CFLAGS+=\
$(CY_CORE_COMMON_OPTIONS)\
-ffreestanding\
-fshort-wchar\
-funsigned-char\
-ffunction-sections\
-fdata-sections\
-Wno-unused-variable\
-Wno-unused-function\

CY_CORE_SFLAGS=

CY_CORE_LDFLAGS=\
-nostartfiles\
-nodefaultlibs\
-nostdlib\
$(CY_CORE_EXTRA_LD_FLAGS)
CHIP_NUM:=$(shell a=$(CHIP_NAME);echo $${a:0:5})

CY_CORE_DEFINES+=\
-DCYW$(CHIP)$(CHIP_REV)=1 \
-DBCM$(CHIP)$(CHIP_REV)=1 \
-DBCM$(CHIP)=1 \
-DCYW$(CHIP)=1 \
-DCHIP=$(CHIP) \
-DAPP_CHIP=$(CHIP) \
-DOTA_CHIP=$(CHIP) \
-DCHIP_REV_$(BLD)_$(CHIP)$(CHIP_REV)=1 \
-DCOMPILER_ARM \
-DCYW$(CHIP_NAME)=1 \
-DCYW$(CHIP_NUM)=1 \
-DCHIP=$(CHIP_NUM) \
-DAPP_CHIP=$(CHIP_NUM) \
-DOTA_CHIP=$(CHIP_NUM) \
-DCHIP_REV_$(BLD)_$(CHIP_NAME)=1 \
-DSPAR_APP_SETUP=application_setup \
-DPLATFORM='"$(subst -,_,$(TARGET))"' \
-D$(subst -,_,$(TARGET))

ifeq ($(CHIP),55572)
ifeq ($(findstring 55572,$(CHIP_NAME)),55572)
CY_CORE_DEFINES+=-DBTSTACK_VER=0x03000001
endif

Expand Down
4 changes: 1 addition & 3 deletions make/recipe/interface_version_1/recipe_ide.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
################################################################################
# \copyright
# Copyright 2022-2023 Cypress Semiconductor Corporation
# Copyright 2022-2024 Cypress Semiconductor Corporation
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -47,8 +47,6 @@ endif
# This must set with = instead of :=
_MTB_RECIPE__C_FLAGS=$(subst $(MTB__SPACE),\"$(MTB__COMMA)$(MTB__NEWLINE_MARKER)\",$(strip $(MTB_RECIPE__CFLAGS)))

_MTB_RECIPE__JLINK_DEVICE_CFG:=Cortex-M33
_MTB_RECIPE__OPENOCD_DEVICE_CFG:=cyw55500.cfg
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

Expand Down
32 changes: 23 additions & 9 deletions make/recipe/interface_version_2/recipe_ide.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
################################################################################
# \copyright
# Copyright 2022-2023 Cypress Semiconductor Corporation
# Copyright 2022-2024 Cypress Semiconductor Corporation
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -37,9 +37,6 @@ else
_MTB_RECIPE__ELF_FILE?=./$(notdir $(MTB_TOOLS__OUTPUT_BASE_DIR))/$(TARGET)/$(CONFIG)/$(APPNAME).$(MTB_RECIPE__SUFFIX_TARGET)
endif

_MTB_RECIPE__JLINK_DEVICE_CFG:=Cortex-M33
_MTB_RECIPE__OPENOCD_DEVICE_CFG:=cyw55500.cfg

_MTB_RECIPE__IDE_TEMPLATE_DIR:=$(MTB_TOOLS__RECIPE_DIR)/make/scripts/interface_version_2

################################################################################
Expand All @@ -56,28 +53,46 @@ MTB_RECIPE__IDE_RECIPE_METADATA_FILE:=$(MTB_TOOLS__OUTPUT_CONFIG_DIR)/ide_recipe

# JLink path
ifneq (,$(MTB_JLINK_DIR))
ifneq (,$(MTB_CORE__JLINK_EXE))
_MTB_RECIPE__ECLIPSE_JLINK_EXE:=$(MTB_CORE__JLINK_EXE)
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)
endif
_MTB_RECIPE__ECLIPSE_PROJECT_NAME=$(CY_IDE_PRJNAME)

eclipse_generate: recipe_eclipse_text_replacement_data_file recipe_eclipse_metadata_file
eclipse_generate: MTB_CORE__EXPORT_CMDLINE += -textdata $(_MTB_RECIPE__IDE_TEXT_DATA_FILE) -metadata $(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE)

recipe_eclipse_text_replacement_data_file:
$(call mtb__file_write,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__OPENOCD_CFG&&=$(_MTB_RECIPE__OPENOCD_DEVICE_CFG))
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__JLINK_DEVICE&&=$(_MTB_RECIPE__JLINK_DEVICE_CFG))
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__PROG_FILE&&=$(_MTB_RECIPE__ECLIPSE_ELF_FILE))
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__ECLIPSE_GDB&&=$(CY_ECLIPSE_GDB))
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__ECLIPSE_GDB&&=$(_MTB_RECIPE__ECLIPSE_GDB))
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__ECLIPSE_JLINK_EXE&&=$(_MTB_RECIPE__ECLIPSE_JLINK_EXE))
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEXT_DATA_FILE),&&_MTB_RECIPE__PRJ_NAME&&=$(_MTB_RECIPE__ECLIPSE_PROJECT_NAME))

recipe_eclipse_metadata_file:
$(call mtb__file_write,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),TEMPLATE_REPLACE=$(_MTB_RECIPE__IDE_TEMPLATE_DIR)/eclipse/$(_MTB_RECIPE__PROGRAM_INTERFACE_SUBDIR)=.mtbLaunchConfigs)
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),TEMPLATE_REPLACE=$(_MTB_RECIPE__IDE_TEMPLATE_DIR)/eclipse/Program.launch=.mtbLaunchConfigs/$(_MTB_ECLIPSE_PROJECT_NAME) Program.launch)
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),TEMPLATE_REPLACE=$(_MTB_RECIPE__IDE_TEMPLATE_DIR)/eclipse/Program.launch=.mtbLaunchConfigs/$(_MTB_RECIPE__ECLIPSE_PROJECT_NAME) Program.launch)
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),UUID=&&PROJECT_UUID&&)

.PHONY: recipe_eclipse_text_replacement_data_file recipe_eclipse_metadata_file
Expand Down Expand Up @@ -117,7 +132,6 @@ recipe_vscode_text_replacement_data_file:
recipe_vscode_metadata_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)=.vscode)
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),TEMPLATE_REPLACE=$(_MTB_RECIPE__IDE_TEMPLATE_DIR)/vscode/tasks.json=.vscode/tasks.json)
$(call mtb__file_append,$(_MTB_RECIPE__IDE_TEMPLATE_META_DATA_FILE),TEMPLATE_REPLACE=$(MTB_TOOLS__CORE_DIR)/make/scripts/interface_version_2/vscode/workspace/wks.code-workspace=$(APPNAME).code-workspace)

.PHONY: recipe_vscode_text_replacement_data_file recipe_vscode_metadata_file

Loading

0 comments on commit 0bad169

Please sign in to comment.