diff --git a/IDE/CCS/TMS570LC43xx/README.md b/IDE/CCS/TMS570LC43xx/README.md index 2ba330ac4..a599f35d9 100644 --- a/IDE/CCS/TMS570LC43xx/README.md +++ b/IDE/CCS/TMS570LC43xx/README.md @@ -1,11 +1,33 @@ # TMS750LC43xx +# Prerequisites + +Download and install: +1) "Code Composer Studio" - https://www.ti.com/tool/CCSTUDIO +2) "F021 Flash API - Software" - https://www.ti.com/tool/F021FLASHAPI + +Note: Avoid using spaces in the paths. Consider renaming "F021 Flash API" to "F021_Flash_API". + # Build ## Build from command line (msys, cygwin, etc) +1) Setup default configuration: + +``` +cp config/examples/ti-tms570lc435.config .config +``` + +2) Build passing in CCS_ROOT and F021_DIR make variables: + +Windows: +``` +make CCS_ROOT=/c/ti/ccs1250/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS F021_DIR=/c/ti/Hercules/F021\ Flash\ API/02.01.01 +``` + +Mac OS: ``` -make CCS_ROOT=/c/ti/ccs1031/ccs/tools/compiler/ti-cgt-arm_20.2.4.LTS F021_DIR=/c/ti/Hercules/F021\ Flash\ API/02.01.01 +make CCS_ROOT=/Applications/ti/ccs1250/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS F021_DIR=/Applications/ti/Hercules/F021_Flash_API/02.01.01 ``` ## Build using Code Composer Studio (CCS) diff --git a/Makefile b/Makefile index f0255b7fc..a2909d1cd 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ DEBUG?=0 DEBUG_UART?=0 LIBS= SIGN_ALG= +OBJCOPY_FLAGS= OBJS:= \ ./hal/$(TARGET).o \ @@ -67,7 +68,12 @@ ifeq ($(USE_GCC_HEADLESS),1) LDFLAGS+=-Wl,-gc-sections -Wl,-Map=wolfboot.map -ffreestanding -nostartfiles # Not setting LDFLAGS directly since it is passed to the test-app LSCRIPT_FLAGS+=-T $(LSCRIPT) + OBJCOPY_FLAGS+=--gap-fill $(FILL_BYTE) endif +ifeq ($(TARGET),ti_hercules) + LSCRIPT_FLAGS+=--run_linker $(LSCRIPT) +endif + MAIN_TARGET=factory.bin TARGET_H_TEMPLATE:=include/target.h.in @@ -136,7 +142,7 @@ wolfboot.efi: wolfboot.elf wolfboot.bin: wolfboot.elf @echo "\t[BIN] $@" - $(Q)$(OBJCOPY) --gap-fill $(FILL_BYTE) -O binary $^ $@ + $(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) -O binary $^ $@ @echo @echo "\t[SIZE]" $(Q)$(SIZE) wolfboot.elf @@ -153,7 +159,7 @@ standalone: MCUXPRESSO=$(MCUXPRESSO) MCUXPRESSO_CPU=$(MCUXPRESSO_CPU) MCUXPRESSO_DRIVERS=$(MCUXPRESSO_DRIVERS) \ MCUXPRESSO_CMSIS=$(MCUXPRESSO_CMSIS) NVM_FLASH_WRITEONCE=$(NVM_FLASH_WRITEONCE) \ FREEDOM_E_SDK=$(FREEDOM_E_SDK) standalone - $(Q)$(OBJCOPY) --gap-fill $(FILL_BYTE) -O binary test-app/image.elf standalone.bin + $(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) -O binary test-app/image.elf standalone.bin $(Q)$(SIZE) test-app/image.elf include tools/test.mk diff --git a/arch.mk b/arch.mk index c95cb7a50..2897dd197 100644 --- a/arch.mk +++ b/arch.mk @@ -491,6 +491,7 @@ ifeq ($(TARGET),ti_hercules) CFLAGS+=-D"CORTEX_R5" -D"BIG_ENDIAN_ORDER" -D"NVM_FLASH_WRITEONCE" -D"FLASHBUFFER_SIZE=32" STACK_USAGE=0 USE_GCC=0 + USE_GCC_HEADLESS=0 ifeq ($(CCS_ROOT),) $(error "CCS_ROOT must be defined to root of tools") @@ -510,7 +511,7 @@ ifeq ($(TARGET),ti_hercules) CFLAGS+=$(ARCH_FLAGS) LDFLAGS+=$(ARCH_FLAGS) -i"$(CCS_ROOT)/lib" -i"$(F021_DIR)" -z --be32 --map_file=wolfboot.map --reread_libs --diag_wrap=off --display_error_number --warn_sections --heap_size=0 --stack_size=0x800 --ram_model LD_START_GROUP= #--start-group - LD_END_GROUP= -llibc.a -l"$(F021_DIR)\\F021_API_CortexR4_BE_L2FMC_V3D16.lib" $(LSCRIPT) + LD_END_GROUP= -llibc.a -l"$(F021_DIR)/F021_API_CortexR4_BE_L2FMC_V3D16.lib" OPTIMIZATION_LEVEL=2 endif diff --git a/stage1/Makefile b/stage1/Makefile index 51591dece..538aecc3f 100644 --- a/stage1/Makefile +++ b/stage1/Makefile @@ -77,6 +77,7 @@ ifeq ($(USE_GCC_HEADLESS),1) CFLAGS+=-ffunction-sections -fdata-sections LDFLAGS+=-Wl,-gc-sections -Wl,-Map=loader_stage1.map LSCRIPT_FLAGS+=-T $(LSCRIPT) + OBJCOPY_FLAGS+=--gap-fill $(FILL_BYTE) endif MAIN_TARGET=loader_stage1.bin @@ -124,7 +125,7 @@ all: $(MAIN_TARGET) loader_stage1.bin: loader_stage1.elf @echo "\t[BIN] $@" - $(Q)$(OBJCOPY) --gap-fill $(FILL_BYTE) -O binary $^ $@ + $(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) -O binary $^ $@ @echo @echo "\t[SIZE]" $(Q)$(SIZE) loader_stage1.elf diff --git a/test-app/Makefile b/test-app/Makefile index 91398def6..4c638edb7 100644 --- a/test-app/Makefile +++ b/test-app/Makefile @@ -48,6 +48,9 @@ include ../arch.mk # Setup default linker flags LDFLAGS+=-T $(LSCRIPT) -Wl,-gc-sections -Wl,-Map=image.map +# Setup default objcopy flags +OBJCOPY_FLAGS+=--gap-fill $(FILL_BYTE) + ifeq ($(DEBUG_UART),1) APP_OBJS+=../src/string.o endif @@ -161,7 +164,8 @@ endif ifeq ($(TARGET),ti_hercules) LSCRIPT_TEMPLATE=ARM-r5be.ld # Override linker flags - LDFLAGS=$(LSCRIPT) --map_file=image.map + LDFLAGS=--run_linker $(LSCRIPT) --map_file=image.map + OBJCOPY_FLAGS= endif ifeq ($(TARGET),sim) @@ -338,7 +342,7 @@ delta-extra-data:LDFLAGS=-Wl,-Map=image.map image.bin: image.elf @echo "\t[BIN] $@" - $(Q)$(OBJCOPY) --gap-fill $(FILL_BYTE) -O binary $^ $@ + $(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) -O binary $^ $@ image.elf: $(APP_OBJS) $(LSCRIPT) @echo "\t[LD] $@"