This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] SK-AM62:闪存 SOC 初始化二进制文件

Guru**** 645810 points
Other Parts Discussed in Thread: SYSCONFIG
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1254192/sk-am62-flash-soc-initialization-binary

器件型号:SK-AM62
主题中讨论的其他器件:SysConfig

您好!
我将尝试进行一些 SoC 初始化。
当我在 Windows 上安装 MCU_PLUS_SDK 并尝试构建所有二进制文件时、SBL_eMMC_Linux_stage2中会发生以下错误。

为什么说找不到 obj 文件?

CCS 的版本为12.4.0.00007。
MCU_PLUS_SDK 的版本为9.00.00。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    这是意料之外的。 您是否在示例的 makefile 中进行了任何更改? 此外、如果您能告诉我您用于构建示例的命令、将会有所帮助。

    此致、

    普拉桑特

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大家好、Prashant

    我使用的命令是"make -sj4 all"。
    我正在为 Windows 使用 GNU make (ver:3.81)。
    CCS 的版本不匹配、因此我将 imports.mak 的第12行更改如下。
    除此之外、我没有更改它。

    更改前
    ccs_path?=$(tools_path)/ccs1230/CCS
    更改后
    ccs_path?=$(tools_path)/ccs1240/CCS

    谢谢你。
    水野市

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    感谢您提供的信息!

     之前显示日志的共享图像 只是表明 SysConfig 自动生成的文件以某种方式没有进行编译、因此不会生成目标文件。 这导致 tiarmclang 报告目标文件缺失、因此编译失败。

    要找出根本原因、您能否附加示例的 makefile。 由于 AM62x-SK-LP 的 SBL_EMMC_Linux_stage2编译失败、因此 makefile 应位于 ${MCU_PLUS_SDK_PATH}/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage2/am62x-sk-lp/r5fss0-0_nortos/ti-arm-clang/makefile.

    谢谢!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    您希望我提供哪种 makefile?
    AM62x-SK-LP SBL_EMMC_Linux_stage2 makefile 是否正确?

    SBL_EMMC_Linux_stage2的 makefile 如下所示。

    谢谢你。

    #
    # Auto generated makefile
    #
    
    export MCU_PLUS_SDK_PATH?=$(abspath ../../../../../../../..)
    include $(MCU_PLUS_SDK_PATH)/imports.mak
    include $(MCU_PLUS_SDK_PATH)/devconfig/devconfig.mak
    
    CG_TOOL_ROOT=$(CGT_TI_ARM_CLANG_PATH)
    
    CC=$(CG_TOOL_ROOT)/bin/tiarmclang
    LNK=$(CG_TOOL_ROOT)/bin/tiarmclang
    STRIP=$(CG_TOOL_ROOT)/bin/tiarmstrip
    OBJCOPY=$(CG_TOOL_ROOT)/bin/tiarmobjcopy
    ifeq ($(OS), Windows_NT)
    	PYTHON=python
    else
    	PYTHON=python3
    endif
    
    PROFILE?=release
    ConfigName:=$(PROFILE)
    
    OUTNAME:=sbl_emmc_linux_stage2.$(PROFILE).out
    
    BOOTIMAGE_PATH=$(abspath .)
    BOOTIMAGE_NAME:=sbl_emmc_linux_stage2.$(PROFILE).appimage
    BOOTIMAGE_NAME_XIP:=sbl_emmc_linux_stage2.$(PROFILE).appimage_xip
    BOOTIMAGE_NAME_SIGNED:=sbl_emmc_linux_stage2.$(PROFILE).appimage.signed
    BOOTIMAGE_RPRC_NAME:=sbl_emmc_linux_stage2.$(PROFILE).rprc
    BOOTIMAGE_RPRC_NAME_XIP:=sbl_emmc_linux_stage2.$(PROFILE).rprc_xip
    BOOTIMAGE_RPRC_NAME_TMP:=sbl_emmc_linux_stage2.$(PROFILE).rprc_tmp
    BOOTIMAGE_NAME_HS:=sbl_emmc_linux_stage2.$(PROFILE).appimage.hs
    BOOTIMAGE_NAME_HS_FS:=sbl_emmc_linux_stage2.$(PROFILE).appimage.hs_fs
    TARGETS := $(BOOTIMAGE_NAME)
    ifeq ($(DEVICE_TYPE), HS)
       TARGETS += $(BOOTIMAGE_NAME_HS)
    endif
    
    FILES_common := \
    	main.c \
    	ti_drivers_config.c \
    	ti_drivers_open_close.c \
    	ti_board_config.c \
    	ti_board_open_close.c \
    	ti_dpl_config.c \
    	ti_pinmux_config.c \
    	ti_power_clock_config.c \
    
    FILES_PATH_common = \
    	.. \
    	../../.. \
    	generated \
    
    INCLUDES_common := \
    	-I${CG_TOOL_ROOT}/include/c \
    	-I${MCU_PLUS_SDK_PATH}/source \
    	-Igenerated \
    
    DEFINES_common := \
    	-DSOC_AM62X \
    
    CFLAGS_common := \
    	-mcpu=cortex-r5 \
    	-mfloat-abi=hard \
    	-mfpu=vfpv3-d16 \
    	-mthumb \
    	-Wall \
    	-Werror \
    	-g \
    	-Wno-gnu-variable-sized-type-not-at-end \
    	-Wno-unused-function \
    
    CFLAGS_cpp_common := \
    	-Wno-c99-designator \
    	-Wno-extern-c-compat \
    	-Wno-c++11-narrowing \
    	-Wno-reorder-init-list \
    	-Wno-deprecated-register \
    	-Wno-writable-strings \
    	-Wno-enum-compare \
    	-Wno-reserved-user-defined-literal \
    	-Wno-unused-const-variable \
    	-x c++ \
    
    CFLAGS_debug := \
    	-D_DEBUG_=1 \
    
    CFLAGS_release := \
    	-Os \
    
    LNK_FILES_common = \
    	linker.cmd \
    
    LIBS_PATH_common = \
    	-Wl,-i${MCU_PLUS_SDK_PATH}/source/kernel/nortos/lib \
    	-Wl,-i${MCU_PLUS_SDK_PATH}/source/drivers/lib \
    	-Wl,-i${MCU_PLUS_SDK_PATH}/source/drivers/device_manager/sciclient_direct/sbl/lib \
    	-Wl,-i${MCU_PLUS_SDK_PATH}/source/drivers/device_manager/rm_pm_hal/sbl/lib \
    	-Wl,-i${CG_TOOL_ROOT}/lib \
    
    LIBS_common = \
    	-lnortos.am62x.r5f.ti-arm-clang.${ConfigName}.lib \
    	-ldrivers.am62x.r5f.ti-arm-clang.${ConfigName}.lib \
    	-llibc.a \
    	-llibsysbm.a \
    
    LIBS_PREBUILD_common = \
        -lsciclient_direct_sbl.am62x.r5f.ti-arm-clang.${ConfigName}.lib \
        -lrm_pm_hal_sbl.am62x.r5f.ti-arm-clang.${ConfigName}.lib \
    
    LFLAGS_common = \
    	-Wl,--diag_suppress=10063 \
    	-Wl,--ram_model \
    	-Wl,--reread_libs \
    
    
    LIBS_NAME = \
    	nortos.am62x.r5f.ti-arm-clang.${ConfigName}.lib \
    	drivers.am62x.r5f.ti-arm-clang.${ConfigName}.lib \
    	libc.a \
    	libsysbm.a \
    
    LIBS_PREBUILD_NAME = \
        sciclient_direct_sbl.am62x.r5f.ti-arm-clang.${ConfigName}.lib \
        rm_pm_hal_sbl.am62x.r5f.ti-arm-clang.${ConfigName}.lib \
    
    LIBS_PATH_NAME = \
    	${MCU_PLUS_SDK_PATH}/source/kernel/nortos/lib \
    	${MCU_PLUS_SDK_PATH}/source/drivers/lib \
    	${MCU_PLUS_SDK_PATH}/source/drivers/device_manager/sciclient_direct/sbl/lib \
    	${MCU_PLUS_SDK_PATH}/source/drivers/device_manager/rm_pm_hal/sbl/lib \
    	${CG_TOOL_ROOT}/lib \
    
    LIBS_PREBUILD_PATH_NAME = \
    
    FILES := $(FILES_common) $(FILES_$(PROFILE))
    ASMFILES := $(ASMFILES_common) $(ASMFILES_$(PROFILE))
    FILES_PATH := $(FILES_PATH_common) $(FILES_PATH_$(PROFILE))
    CFLAGS := $(CFLAGS_common) $(CFLAGS_$(PROFILE))
    DEFINES := $(DEFINES_common) $(DEFINES_$(PROFILE))
    INCLUDES := $(INCLUDES_common) $(INCLUDE_$(PROFILE))
    LIBS := $(LIBS_common) $(LIBS_$(PROFILE))
    LIBS_PREBUILD := $(LIBS_PREBUILD_common) $(LIBS_PREBUILD_$(PROFILE))
    LIBS_PATH := $(LIBS_PATH_common) $(LIBS_PATH_$(PROFILE))
    LIBS_PREBUILD_PATH := $(LIBS_PREBUILD_PATH_common) $(LIBS_PREBUILD_PATH_$(PROFILE))
    LFLAGS := $(LFLAGS_common) $(LFLAGS_$(PROFILE))
    LNKOPTFLAGS := $(LNKOPTFLAGS_common) $(LNKOPTFLAGS_$(PROFILE))
    LNK_FILES := $(LNK_FILES_common) $(LNK_FILES_$(PROFILE))
    
    OBJDIR := obj/$(PROFILE)/
    OBJS := $(FILES:%.c=%.obj)
    OBJS += $(ASMFILES:%.S=%.obj)
    DEPS := $(FILES:%.c=%.d)
    
    vpath %.obj $(OBJDIR)
    vpath %.c $(FILES_PATH)
    vpath %.S $(FILES_PATH)
    vpath %.lib $(LIBS_PATH_NAME)
    vpath %.a $(LIBS_PATH_NAME)
    
    $(OBJDIR)/%.obj %.obj: %.c
    	@echo  Compiling: am62x:r5fss0-0:nortos:ti-arm-clang $(OUTNAME): $<
    	$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) -MMD -o $(OBJDIR)/$@ $<
    
    $(OBJDIR)/%.obj %.obj: %.S
    	@echo  Compiling: am62x:r5fss0-0:nortos:ti-arm-clang $(LIBNAME): $<
    	$(CC) -c $(CFLAGS) -o $(OBJDIR)/$@ $<
    
    all: $(TARGETS)
    
    SYSCFG_GEN_FILES=generated/ti_drivers_config.c generated/ti_drivers_config.h
    SYSCFG_GEN_FILES+=generated/ti_drivers_open_close.c generated/ti_drivers_open_close.h
    SYSCFG_GEN_FILES+=generated/ti_dpl_config.c generated/ti_dpl_config.h
    SYSCFG_GEN_FILES+=generated/ti_pinmux_config.c generated/ti_power_clock_config.c
    SYSCFG_GEN_FILES+=generated/ti_board_config.c generated/ti_board_config.h
    SYSCFG_GEN_FILES+=generated/ti_board_open_close.c generated/ti_board_open_close.h
    
    $(OUTNAME): syscfg $(SYSCFG_GEN_FILES) $(OBJS) $(LNK_FILES) $(LIBS_NAME)
    	@echo  .
    	@echo  Linking: am62x:r5fss0-0:nortos:ti-arm-clang $@ ...
    	$(LNK) $(LNKOPTFLAGS) $(LFLAGS) $(LIBS_PREBUILD_PATH) $(LIBS_PATH) -Wl,-m=$(basename $@).map -o $@ $(addprefix $(OBJDIR), $(OBJS)) $(LIBS_PREBUILD) $(LIBS) $(LNK_FILES)
    	@echo  Linking: am62x:r5fss0-0:nortos:ti-arm-clang $@ Done !!!
    	@echo  .
    
    clean:
    	@echo  Cleaning: am62x:r5fss0-0:nortos:ti-arm-clang $(OUTNAME) ...
    	$(RMDIR) $(OBJDIR)
    	$(RM) $(OUTNAME)
    	$(RM) $(BOOTIMAGE_NAME)
    	$(RM) $(BOOTIMAGE_NAME_XIP)
    	$(RM) $(BOOTIMAGE_NAME_SIGNED)
    	$(RM) $(BOOTIMAGE_NAME_HS)
    	$(RM) $(BOOTIMAGE_NAME_HS_FS)
    	$(RM) $(BOOTIMAGE_RPRC_NAME)
    	$(RM) $(BOOTIMAGE_RPRC_NAME_XIP)
    	$(RMDIR) generated/
    
    scrub:
    	@echo  Scrubing: am62x:r5fss0-0:nortos:ti-arm-clang sbl_emmc_linux_stage2 ...
    	$(RMDIR) obj
    ifeq ($(OS),Windows_NT)
    	$(RM) \*.out
    	$(RM) \*.map
    	$(RM) \*.appimage*
    	$(RM) \*.rprc*
    	$(RM) \*.tiimage*
    	$(RM) \*.bin
    else
    	$(RM) *.out
    	$(RM) *.map
    	$(RM) *.appimage*
    	$(RM) *.rprc*
    	$(RM) *.tiimage*
    	$(RM) *.bin
    endif
    	$(RMDIR) generated
    
    $(OBJS): | $(OBJDIR)
    
    $(OBJDIR):
    	$(MKDIR) $@
    
    .NOTPARALLEL:
    
    .INTERMEDIATE: syscfg
    $(SYSCFG_GEN_FILES): syscfg
    
    syscfg: ../example.syscfg
    	@echo Generating SysConfig files ...
    	$(SYSCFG_NODE) $(SYSCFG_CLI_PATH)/dist/cli.js --product $(SYSCFG_SDKPRODUCT) --context r5fss0-0 --part Default --package ALW --output generated/ ../example.syscfg
    
    syscfg-gui:
    	$(SYSCFG_NWJS) $(SYSCFG_PATH) --product $(SYSCFG_SDKPRODUCT) --device AM62x --context r5fss0-0 --part Default --package ALW --output generated/  ../example.syscfg
    
    #
    # Generation of boot image which can be loaded by Secondary Boot Loader (SBL)
    #
    ifeq ($(OS),Windows_NT)
    EXE_EXT=.exe
    endif
    ifeq ($(OS),Windows_NT)
      BOOTIMAGE_CERT_GEN_CMD=powershell -executionpolicy unrestricted -command $(MCU_PLUS_SDK_PATH)/tools/boot/signing/x509CertificateGen.ps1
    else
      BOOTIMAGE_CERT_GEN_CMD=$(MCU_PLUS_SDK_PATH)/tools/boot/signing/x509CertificateGen.sh
    endif
    BOOTIMAGE_TEMP_OUT_FILE=temp_stdout_$(PROFILE).txt
    
    BOOTIMAGE_CERT_KEY=$(APP_SIGNING_KEY)
    
    BOOTIMAGE_CORE_ID_a53ss0-0 = 0
    BOOTIMAGE_CORE_ID_a53ss0-1 = 1
    BOOTIMAGE_CORE_ID_a53ss1-0 = 2
    BOOTIMAGE_CORE_ID_a53ss1-1 = 3
    BOOTIMAGE_CORE_ID_r5fss0-0 = 4
    BOOTIMAGE_CORE_ID_m4fss0-0 = 5
    BOOTIMAGE_CORE_ID_hsm-m4fss0-0 = 6
    SBL_RUN_ADDRESS=0x43C00000
    SBL_DEV_ID=55
    
    MULTI_CORE_IMAGE_GEN = $(SYSCFG_NODE) $(MCU_PLUS_SDK_PATH)/tools/boot/multicoreImageGen/multicoreImageGen.js
    OUTRPRC_CMD = $(SYSCFG_NODE) $(MCU_PLUS_SDK_PATH)/tools/boot/out2rprc/elf2rprc.js
    APP_IMAGE_SIGN_CMD = $(MCU_PLUS_SDK_PATH)/tools/boot/signing/appimage_x509_cert_gen.py
    
    ifeq ($(OS),Windows_NT)
      XIPGEN_CMD=$(MCU_PLUS_SDK_PATH)/tools/boot/xipGen/xipGen.exe
    else
      XIPGEN_CMD=$(MCU_PLUS_SDK_PATH)/tools/boot/xipGen/xipGen.out
    endif
    
    MULTI_CORE_IMAGE_PARAMS = \
    	$(BOOTIMAGE_RPRC_NAME)@$(BOOTIMAGE_CORE_ID_r5fss0-0) \
    
    MULTI_CORE_IMAGE_PARAMS_XIP = \
    	$(BOOTIMAGE_RPRC_NAME_XIP)@$(BOOTIMAGE_CORE_ID_r5fss0-0) \
    
    $(BOOTIMAGE_NAME): $(OUTNAME)
    	@echo  Boot image: am62x:r5fss0-0:nortos:ti-arm-clang $(BOOTIMAGE_PATH)/$@ ...
    ifneq ($(OS),Windows_NT)
    	$(CHMOD) a+x $(XIPGEN_CMD)
    endif
    	$(OUTRPRC_CMD) $(OUTNAME) >> $(BOOTIMAGE_TEMP_OUT_FILE)
    	$(COPY) $(BOOTIMAGE_RPRC_NAME) $(BOOTIMAGE_RPRC_NAME_TMP)
    	$(RM) $(BOOTIMAGE_RPRC_NAME)
    	$(XIPGEN_CMD) -i $(BOOTIMAGE_RPRC_NAME_TMP) -o $(BOOTIMAGE_RPRC_NAME) -x $(BOOTIMAGE_RPRC_NAME_XIP) --flash-start-addr 0x60000000 -v > $(BOOTIMAGE_TEMP_OUT_FILE)
    	$(MULTI_CORE_IMAGE_GEN) --devID $(SBL_DEV_ID) --out $(BOOTIMAGE_NAME) $(MULTI_CORE_IMAGE_PARAMS) >> $(BOOTIMAGE_TEMP_OUT_FILE)
    	$(MULTI_CORE_IMAGE_GEN) --devID $(SBL_DEV_ID) --out $(BOOTIMAGE_NAME_XIP) $(MULTI_CORE_IMAGE_PARAMS_XIP) >> $(BOOTIMAGE_TEMP_OUT_FILE)
    # Sign the appimage for HS-FS using appimage signing script
    	$(PYTHON) $(APP_IMAGE_SIGN_CMD) --bin $(BOOTIMAGE_NAME) --authtype 2 --key $(APP_SIGNING_KEY) --output $(BOOTIMAGE_NAME_HS_FS)
    	$(RM) $(BOOTIMAGE_RPRC_NAME_TMP)
    	$(RM) $(BOOTIMAGE_TEMP_OUT_FILE)
    	@echo  Boot image: am62x:r5fss0-0:nortos:ti-arm-clang $(BOOTIMAGE_PATH)/$@ Done !!!
    	@echo  .
    	@echo  Boot image: am62x:r5fss0-0:nortos:ti-arm-clang $(BOOTIMAGE_PATH)/$(BOOTIMAGE_NAME_HS_FS) Done !!!
    	@echo  .
    
    $(BOOTIMAGE_NAME_HS): $(BOOTIMAGE_NAME)
    ifeq ($(DEVICE_TYPE), HS)
    # Sign the appimage using appimage signing script
    ifeq ($(ENC_ENABLED),no)
    	@echo Boot image signing: Encryption is disabled.
    	$(PYTHON) $(APP_IMAGE_SIGN_CMD) --bin $(BOOTIMAGE_NAME) --authtype 2 --key $(APP_SIGNING_KEY) --output $(BOOTIMAGE_NAME_HS)
    else
    	@echo Boot image signing: Encryption is enabled.
    	$(PYTHON) $(APP_IMAGE_SIGN_CMD) --bin $(BOOTIMAGE_NAME) --authtype 2 --key $(APP_SIGNING_KEY) --enc y --enckey $(APP_ENCRYPTION_KEY) --output $(BOOTIMAGE_NAME_HS)
    	$(RM) $(BOOTIMAGE_NAME)-enc
    endif
    	@echo  Boot image: am62x:r5fss0-0:nortos:ti-arm-clang $(BOOTIMAGE_PATH)/$(BOOTIMAGE_NAME_HS) Done !!!
    	@echo  .
    endif
    -include $(addprefix $(OBJDIR)/, $(DEPS))
    

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    感谢您的分享!

    事实证明、我能够使用 GNU make v3.81重现此问题。 然而、如果我使用 CCS 安装程序附带的 make 实用程序(gmake)、问题就不会出现。

    因此、我建议使用 CCS 的 gmake 文件进行构建。 这个 Gmake 应在以下位置提供: ${CCS_PATH}/ccs/utils/bin

    请告诉我它是否起作用!

    此致、

    普拉桑特

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!
    我使用了 CCS 中的 gmake、以便完成编译。
    非常感谢。