Initial import of NFC GNSS SDK project
This commit is contained in:
@@ -0,0 +1,200 @@
|
||||
#Default: DS-5 is added in Patch
|
||||
CC = armcc.exe
|
||||
LINK = armlink.exe
|
||||
FROMELF = fromelf.exe
|
||||
AR = armar.exe
|
||||
|
||||
TARGET_ = updater
|
||||
obj_dir = obj
|
||||
|
||||
common_dir = ../../common
|
||||
common_tool_dir = $(common_dir)/tool
|
||||
|
||||
|
||||
cflag :=
|
||||
dep_files :=
|
||||
objs :=
|
||||
|
||||
feedback = feedback.txt
|
||||
cflag += --cpu Cortex-R5 --no_unaligned_access -g -O2 --apcs /inter --gnu --feedback $(feedback)
|
||||
|
||||
|
||||
# set the target type -------------------------------------------
|
||||
lcd_type :=
|
||||
#1. NO_LCD
|
||||
ifneq (,$(findstring NO_LCD,${LCD_TYPE}))
|
||||
# lcd_type = _no_lcd
|
||||
endif
|
||||
ifneq (,$(findstring NOUPDT,${FOTA_TYPE}))
|
||||
lcd_type :=${lcd_type}_NoPartition
|
||||
endif
|
||||
ifneq (,$(findstring SECFOTA,${FOTA_TYPE}))
|
||||
lcd_type :=${lcd_type}_sec
|
||||
endif
|
||||
ifneq (,$(findstring FBF,${FOTA_TYPE}))
|
||||
lcd_type :=${lcd_type}_fbf
|
||||
endif
|
||||
ifneq (,$(findstring SPINOR_SUPPORT,${FOTA_TYPE}))
|
||||
lcd_type :=${lcd_type}_exflash
|
||||
endif
|
||||
ifneq (,$(findstring SPINAND_SUPPORT,${FOTA_TYPE}))
|
||||
lcd_type :=${lcd_type}_exnand
|
||||
endif
|
||||
TARGET = ${TARGET_}${lcd_type}
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
# chose libraries and makefile ----------------------------------
|
||||
lib_dir = ..\lib
|
||||
LIB = ${lib_dir}/ql_updater$(lcd_type).lib
|
||||
include ${lib_dir}/ql_updater$(lcd_type).mk
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
# sctript chose -------------------------------------------------
|
||||
scatter_dir = ..
|
||||
ifneq (,$(findstring CRANEL,${FOTA_TYPE}))
|
||||
scatter_file_name = scatter_craneL
|
||||
else ifneq (,$(findstring CRANEM_SINGLESIM,${FOTA_TYPE}))
|
||||
scatter_file_name = scatter_craneL
|
||||
else
|
||||
scatter_file_name = scatter
|
||||
endif
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
|
||||
# set the source files ------------------------------------------
|
||||
src_common_dir = ../../common/src
|
||||
inc_common_dir = ../../common/inc
|
||||
|
||||
srcs_common = \
|
||||
$(src_common_dir)/plat_api.c \
|
||||
$(src_common_dir)/asr_property.c \
|
||||
$(src_common_dir)/bsp_tavor.c \
|
||||
$(src_common_dir)/utilities.c \
|
||||
$(src_common_dir)/pmic.c \
|
||||
$(src_common_dir)/ningbo.c \
|
||||
$(src_common_dir)/guilin.c \
|
||||
$(src_common_dir)/guilin_lite.c \
|
||||
$(src_common_dir)/guilin_lite2.c \
|
||||
$(src_common_dir)/guilin_lite3.c \
|
||||
$(src_common_dir)/FreqChange.c \
|
||||
$(src_common_dir)/uart.c \
|
||||
$(src_common_dir)/sdcard.c \
|
||||
$(src_common_dir)/diskio.c \
|
||||
$(src_common_dir)/ff.c \
|
||||
$(src_common_dir)/ff_dump_mem.c \
|
||||
$(src_common_dir)/ffsystem.c \
|
||||
$(src_common_dir)/ffunicode.c \
|
||||
$(src_common_dir)/qspi_core.c \
|
||||
$(src_common_dir)/qspi_dma.c \
|
||||
$(src_common_dir)/qspi_host.c \
|
||||
$(src_common_dir)/qspi_nor.c \
|
||||
$(src_common_dir)/system.c \
|
||||
$(src_common_dir)/loadtable.c \
|
||||
$(src_common_dir)/ptable.c \
|
||||
$(src_common_dir)/LzmaDec.c \
|
||||
$(src_common_dir)/LzmaEnc.c \
|
||||
$(src_common_dir)/LzFind.c \
|
||||
$(src_common_dir)/LzmaLib.c \
|
||||
$(src_common_dir)/tinyalloc.c \
|
||||
$(src_common_dir)/updater_table.c \
|
||||
$(src_common_dir)/asr_lzma.c \
|
||||
$(src_common_dir)/logo_table.c \
|
||||
$(src_common_dir)/qspi_nor_bp.c \
|
||||
$(src_common_dir)/quec_startup_gpio.c \
|
||||
$(src_common_dir)/gpio.c
|
||||
|
||||
ifneq (,$(findstring SPINOR_SUPPORT,${FOTA_TYPE}))
|
||||
srcs_common += $(src_common_dir)/SPI.c
|
||||
srcs_common += \
|
||||
$(src_common_dir)/quec_spi_nor.c \
|
||||
$(src_common_dir)/quec_spi.c \
|
||||
$(src_common_dir)/SPI.c
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring USE_LCD,${LCD_TYPE}))
|
||||
srcs_common += \
|
||||
$(src_common_dir)/quec_lcd_application.c \
|
||||
$(src_common_dir)/quec_spi_drv.c \
|
||||
$(src_common_dir)/quec_ssp_lcd.c
|
||||
endif
|
||||
|
||||
objs_common += $(patsubst %.c, ${obj_dir}/%.o, ${notdir ${srcs_common}})
|
||||
|
||||
cflag += -I$(inc_common_dir)
|
||||
dep_files += $(wildcard $(inc_common_dir)/*.h)
|
||||
VPATH += $(src_common_dir)
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
# set updater source files --------------------------------------
|
||||
src_updater_dir = ../src
|
||||
inc_common_dir = ../inc
|
||||
|
||||
|
||||
cflag += -I$(inc_common_dir)
|
||||
dep_files += $(wildcard $(inc_common_dir)/*.h)
|
||||
VPATH += $(src_updater_dir)
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
# set quectel source files --------------------------------------
|
||||
src_quectel_dir = ../quectel/src
|
||||
inc_quectel_dir = ../quectel/inc
|
||||
|
||||
srcs_quectel = $(src_quectel_dir)/src/ql_updater_usr_func.c
|
||||
|
||||
ifneq (,$(findstring SPINAND_SUPPORT,${FOTA_TYPE}))
|
||||
srcs_quectel += \
|
||||
$(src_quectel_dir)/src/dosilicon.c \
|
||||
$(src_quectel_dir)/src/gigadevice.c \
|
||||
$(src_quectel_dir)/src/spinand_dev.c \
|
||||
$(src_quectel_dir)/src/winbond.c \
|
||||
$(src_quectel_dir)/src/fudaiwei.c
|
||||
endif
|
||||
|
||||
objs_quectel += $(patsubst %.c, ${obj_dir}/%.o, ${notdir ${srcs_quectel}})
|
||||
|
||||
cflag += -I$(inc_quectel_dir)
|
||||
dep_files += $(wildcard $(inc_quectel_dir)/*.h)
|
||||
VPATH += $(src_quectel_dir)
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
objs_sum += $(objs_common) $(objs_quectel)
|
||||
|
||||
${TARGET}.axf:$(objs_sum)
|
||||
if not exist ${feedback} @echo "ERROR : make feedback firstly" && exit 1
|
||||
$(LINK) $(LIB) $(objs_sum) --scatter $(scatter_dir)/$(scatter_file_name).scat --output $@ --map --symbols --info sizes,totals --list ${TARGET}.map --keep version_block.o(IMGVERBLOCK)
|
||||
$(FROMELF) --output ${TARGET}.bin --bin ${TARGET}.axf
|
||||
ifneq (,$(findstring CRANEL,${FOTA_TYPE}))
|
||||
#1. UPD_SIZE = {updater.bin} size
|
||||
perl $(common_tool_dir)/external_ext_bin_size_update.pl ${TARGET}.bin UPD_SIZE
|
||||
ifneq (,$(findstring y,$(CONFIG_APPEND_DSP_ADC)))
|
||||
#2. append dsp_adc.bin into {updater.bin}. ( note: need provide front.bin size --- UPD_SIZE)
|
||||
perl $(common_tool_dir)/external_ext_bin_append.pl APPEND ${TARGET}.bin UPD_SIZE $(common_lib_dir)/dsp_adc_lzma.bin ADC_SIZE
|
||||
endif
|
||||
#3. EXT_SIZE = {updater.bin + dsp_adc.bin} size
|
||||
perl $(common_tool_dir)/external_ext_bin_size_update.pl ${TARGET}.bin EXT_SIZE
|
||||
#4. append "internal crc res" into end of image.
|
||||
perl $(common_tool_dir)/external_append_pad_crc.pl ${TARGET}.bin
|
||||
endif
|
||||
|
||||
#common start
|
||||
${obj_dir}/%.o: %.c $(dep_files)
|
||||
if not exist $(obj_dir) mkdir $(obj_dir)
|
||||
$(CC) $(cflag) --thumb -c $< -o $@
|
||||
#common end
|
||||
|
||||
|
||||
feedback:$(objs_sum)
|
||||
$(LINK) ${LIB} $(objs_sum) --scatter $(scatter_dir)/scatter.scat --output feedback.axf --keep version_block.o(IMGVERBLOCK) --feedback=${feedback}
|
||||
rd /s /q $(obj_dir)
|
||||
del feedback.axf
|
||||
|
||||
|
||||
clean:
|
||||
del updater*.bin
|
||||
del updater*.map
|
||||
del updater*.axf
|
||||
rd /s /q $(obj_dir)
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
::Note: must excute build_updater_no_lcd.bat in DS-5 env.
|
||||
::devide by LCD_TYPE and FOTA_TYPE
|
||||
::naming rule: updater_[lcdtype]_[fota_type].bin
|
||||
|
||||
@echo off
|
||||
|
||||
::define some variables
|
||||
set DIR_RELEASE=..\release
|
||||
set DIR_README_UPDATER=..
|
||||
|
||||
::create release directory and updater_axf_map directory in updater directory
|
||||
::1. create release directory in updater directory
|
||||
if not exist %DIR_RELEASE% md %DIR_RELEASE%
|
||||
::2. create updater_axf_map directory in updater\release directory
|
||||
if not exist %DIR_RELEASE%\updater_axf_map md %DIR_RELEASE%\updater_axf_map
|
||||
|
||||
del /s /q /f %DIR_RELEASE%\*
|
||||
::first copy updater_readme.txt
|
||||
::copy /Y %DIR_README_UPDATER%\readme_updater.txt %DIR_RELEASE%\
|
||||
|
||||
::*********************************************
|
||||
::set SMALL_CODE=UPDATER
|
||||
::*********************************************
|
||||
|
||||
::NOTE
|
||||
::open comment(goto START and goto SUCCESS) to control build specilize updater*.bin
|
||||
goto START
|
||||
|
||||
:START
|
||||
gnumake clean
|
||||
gnumake feedback
|
||||
gnumake
|
||||
copy /Y updater*.bin %DIR_RELEASE%\
|
||||
copy /Y updater*.axf %DIR_RELEASE%\updater_axf_map\
|
||||
copy /Y updater*.map %DIR_RELEASE%\updater_axf_map\
|
||||
|
||||
::check file exist in release?
|
||||
if not exist %DIR_RELEASE%\updater*.bin goto ERROR
|
||||
goto SUCCESS
|
||||
|
||||
:ERROR
|
||||
::make clean
|
||||
echo ****************************************************************
|
||||
echo *********************** ERROR ********************************
|
||||
echo ****************************************************************
|
||||
goto END
|
||||
|
||||
:SUCCESS
|
||||
gnumake clean
|
||||
echo ****************************************************************
|
||||
echo *********************** SUCCESS ******************************
|
||||
echo ****************************************************************
|
||||
|
||||
:END
|
||||
Binary file not shown.
Reference in New Issue
Block a user