2021-10-27 13:30:51 +02:00
|
|
|
# GCC prefix for FT90X compile tools.
|
2021-10-05 14:54:47 +02:00
|
|
|
CROSS_COMPILE = ft32-elf-
|
|
|
|
SKIP_NANOLIB = 1
|
|
|
|
|
2021-10-27 13:30:51 +02:00
|
|
|
# Set to use FT90X prebuilt libraries.
|
2021-12-08 14:56:23 +01:00
|
|
|
FT90X_PREBUILT_LIBS = 0
|
2021-10-27 13:30:51 +02:00
|
|
|
ifeq ($(FT90X_PREBUILT_LIBS),1)
|
|
|
|
# If the FT90X toolchain is installed on Windows systems then the SDK
|
|
|
|
# include files and prebuilt libraries are at: %FT90X_TOOLCHAIN%/hardware
|
|
|
|
FT9XX_SDK = $(FT90X_TOOLCHAIN)/hardware
|
2021-12-08 14:56:23 +01:00
|
|
|
INC += $(FT9XX_SDK)/include
|
2021-10-27 13:30:51 +02:00
|
|
|
else
|
|
|
|
# The submodule BRTSG-FOSS/ft90x-sdk contains header files and source
|
|
|
|
# code for the Bridgetek SDK. This can be used instead of the prebuilt
|
|
|
|
# library.
|
2021-12-08 14:56:23 +01:00
|
|
|
DEPS_SUBMODULES += hw/mcu/bridgetek/ft9xx/ft90x-sdk
|
2021-10-27 13:30:51 +02:00
|
|
|
# The SDK can be used to load specific files from the Bridgetek SDK.
|
2021-12-08 14:56:23 +01:00
|
|
|
FT9XX_SDK = hw/mcu/bridgetek/ft9xx/ft90x-sdk/Source
|
|
|
|
INC += $(TOP)/$(FT9XX_SDK)/include
|
2021-10-27 13:30:51 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Add include files which are within the TinyUSB directory structure.
|
|
|
|
INC += \
|
2022-11-28 18:41:00 +01:00
|
|
|
$(TOP)/$(BOARD_PATH)
|
2021-10-05 14:54:47 +02:00
|
|
|
|
2021-10-27 13:30:51 +02:00
|
|
|
# Add required C Compiler flags for FT90X.
|
2021-10-05 14:54:47 +02:00
|
|
|
CFLAGS += \
|
|
|
|
-D__FT900__ \
|
|
|
|
-fvar-tracking \
|
|
|
|
-fvar-tracking-assignments \
|
|
|
|
-fmessage-length=0 \
|
|
|
|
-ffunction-sections \
|
2022-11-28 18:41:00 +01:00
|
|
|
-DCFG_TUSB_MCU=OPT_MCU_FT90X
|
|
|
|
|
|
|
|
# Maximum USB device speed supported by the board
|
|
|
|
CFLAGS += -DBOARD_TUD_MAX_SPEED=OPT_MODE_HIGH_SPEED
|
2021-10-05 14:54:47 +02:00
|
|
|
|
|
|
|
# lwip/src/core/raw.c:334:43: error: declaration of 'recv' shadows a global declaration
|
|
|
|
CFLAGS += -Wno-error=shadow
|
|
|
|
|
2021-10-27 13:30:51 +02:00
|
|
|
# Set Linker flags.
|
|
|
|
LD_FILE = hw/mcu/bridgetek/ft9xx/scripts/ldscript.ld
|
2021-10-05 14:54:47 +02:00
|
|
|
LDFLAGS += $(addprefix -L,$(LDINC)) \
|
|
|
|
-Xlinker --entry=_start \
|
|
|
|
-Wl,-lc
|
|
|
|
|
2021-10-27 13:30:51 +02:00
|
|
|
# Additional Source files for FT90X.
|
2021-10-06 17:50:55 +02:00
|
|
|
SRC_C += src/portable/bridgetek/ft9xx/dcd_ft9xx.c
|
2021-10-05 14:54:47 +02:00
|
|
|
|
2021-10-27 13:30:51 +02:00
|
|
|
# Linker library.
|
|
|
|
ifneq ($(FT90X_PREBUILT_LIBS),1)
|
|
|
|
# Optionally add in files from the Bridgetek SDK instead of the prebuilt
|
|
|
|
# library. These are the minimum required.
|
|
|
|
SRC_C += $(FT9XX_SDK)/src/sys.c
|
|
|
|
SRC_C += $(FT9XX_SDK)/src/interrupt.c
|
|
|
|
SRC_C += $(FT9XX_SDK)/src/delay.c
|
|
|
|
SRC_C += $(FT9XX_SDK)/src/timers.c
|
|
|
|
SRC_C += $(FT9XX_SDK)/src/uart_simple.c
|
|
|
|
SRC_C += $(FT9XX_SDK)/src/gpio.c
|
|
|
|
else
|
|
|
|
# Or if using the prebuilt libraries add them.
|
|
|
|
LDFLAGS += -L"$(FT9XX_SDK)/lib"
|
|
|
|
LIBS += -lft900
|
|
|
|
endif
|
2021-10-05 14:54:47 +02:00
|
|
|
|
2021-10-27 13:30:51 +02:00
|
|
|
# Not required crt0 file for FT90X. Use compiler built-in file.
|
|
|
|
#SRC_S += hw/mcu/bridgetek/ft9xx/scripts/crt0.S
|