Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

CODECOMPOSER: How do I setup my CCS makefile to support two different devconfig.mak files (one for CUST_MPK and CUST_MEK keys)

Part Number: CODECOMPOSER

Tool/software:

I have a CCS bootloader project for a AM243x MCU that we need to build with and without a custom devconfig.mak so that we can build using custom HS-SE keys

Is there a way to have two different binaries from the same make file that uses two different devconfig.mak files

I need to build my bootloader with the default devconfig.mak and with one the makes the following changes:

  • Modified devconfig.mak
    • Line 2:  DEVICE_TYPE?=HS
    • Line 22: CUST_MPK=devMpk_am64x_am243x.pem
    • Line 23: CUST_MEK=devMek_am64x_am243x.txt
    • Line 30: ENC_SBL_ENABLED?=no
  • Custom devMek_am64x_am243x.txt file
  • Custom devMpk_am64x_am243x.pem file

I could build two different projects, but I would rather generate both images from the same project.

  • Hello,

    The following patch modifies the SBL's CCS makefile (makefile_ccs_bootimage_gen) to take devconfig path as an argument:

    diff --git a/examples/drivers/boot/sbl_null/am243x-evm/r5fss0-0_nortos/ti-arm-clang/makefile_ccs_bootimage_gen b/examples/drivers/boot/sbl_null/am243x-evm/r5fss0-0_nortos/ti-arm-clang/makefile_ccs_bootimage_gen
    index 63304e99..f4e4d9e7 100644
    --- a/examples/drivers/boot/sbl_null/am243x-evm/r5fss0-0_nortos/ti-arm-clang/makefile_ccs_bootimage_gen
    +++ b/examples/drivers/boot/sbl_null/am243x-evm/r5fss0-0_nortos/ti-arm-clang/makefile_ccs_bootimage_gen
    @@ -12,7 +12,9 @@
     
     CCS_PATH=$(CCS_INSTALL_DIR)
     include $(MCU_PLUS_SDK_PATH)/imports.mak
    -include $(MCU_PLUS_SDK_PATH)/devconfig/devconfig.mak
    +
    +DEVCONFIG_PATH?=$(MCU_PLUS_SDK_PATH)/devconfig/devconfig.mak
    +include $(DEVCONFIG_PATH)
     
     STRIP=$(CG_TOOL_ROOT)/bin/tiarmstrip
     OBJCOPY=$(CG_TOOL_ROOT)/bin/tiarmobjcopy
    

    Then, you could add an additional post build step passing the devconfig path as an arugment & any other necessary variables to produce different images. For example, the following additional command in the post build step generates custom SBL NULL image with the custom DEVCONFIG path.

    $(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} DEVCONFIG_PATH=${MCU_PLUS_SDK_PATH}/devconfig/cust_devconfig.mak BOOTIMAGE_NAME=custom_sbl_null.hs_fs.tiimage CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am243x

    Regards,

    Prashant

  • I only have access to the command-line build tools for this project.  Is there a way to add this post build step without using the IDE? It looks like the example MAKE instruction you shared goes in the .cproject file, that I doesn't look friendly for editing.

  • I should be able to, if needed modify the project on a system that is running the CCS IDE and copy over the .cproject file.

    From that IDE the existing post-build step I have is (I am not very fluent at understanding it)

    $(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE}
    I am thinking of adding something like this?

    $(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} DEVCONFIG_PATH=${CCS_PROJECT_DIR}/devconfig.mak BOOTIMAGE_NAME=${BuildArtifactFileBaseName}.se.hs_fs.tiimage CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE}

  • I should be able to, if needed modify the project on a system that is running the CCS IDE and copy over the .cproject file.

    Not sure but this should be okay.

    If manually editing the `.cproject` file, I saw the following difference on adding the additional command:

    diff --git a/.cproject b/.cproject
    index a504b15..8d29ddf 100644
    --- a/.cproject
    +++ b/.cproject
    @@ -14,7 +14,7 @@
     				</extensions>
     			</storageModule>
     			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
    -				<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1080308160" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep="$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am243x">
    +				<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1080308160" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep="$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am243x;$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} DEVCONFIG_PATH=${MCU_PLUS_SDK_PATH}/devconfig/cust_devconfig.mak BOOTIMAGE_NAME=custom_sbl_null.hs_fs.tiimage CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am243x">
     					<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.1080308160." name="/" resourcePath="">
     						<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.0.exe.DebugToolchain.1512285410" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.0.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_TICLANG_3.0.exe.linkerDebug.512515238">
     							<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.272720753" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
    

    If you have not imported the project in CCS yet then you could just modify the `example.projectspec` file & then import the project.

    diff --git a/examples/drivers/boot/sbl_null/am243x-evm/r5fss0-0_nortos/ti-arm-clang/example.projectspec b/examples/drivers/boot/sbl_null/am243x-evm/r5fss0-0_nortos/ti-arm-clang/example.projectspec
    index ffaafa07..a30e2912 100644
    --- a/examples/drivers/boot/sbl_null/am243x-evm/r5fss0-0_nortos/ti-arm-clang/example.projectspec
    +++ b/examples/drivers/boot/sbl_null/am243x-evm/r5fss0-0_nortos/ti-arm-clang/example.projectspec
    @@ -52,7 +52,7 @@
                 --reread_libs
             "
     
    -        postBuildStep="$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am243x"
    +        postBuildStep="$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am243x;$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} DEVCONFIG_PATH=${MCU_PLUS_SDK_PATH}/devconfig/cust_devconfig.mak BOOTIMAGE_NAME=custom_sbl_null.hs_fs.tiimage CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE} DEVICE=am243x"
     
             enableSysConfigTool="true"
             sysConfigBuildOptions="
    

  • I am using the cust_devconfig.mak that includes `DEVICE_TYPE?=HS`, so I was expecting per my `makefile_ccs_bootimage_gen` file to be using `sysfw-hs-enc.bin` and not `sysfw-hs-fs-enc.bin` for the last call to `$(MAKE)` but it is not.

    These are the two make commands from my `.cproject` file.
    				<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.346474771" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug" postbuildStep="$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE};$(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} DEVCONFIG_PATH=${CCS_PROJECT_DIR}/cust_devconfig.mak BOOTIMAGE_NAME=${BuildArtifactFileBaseName}.se.hs.tiimage CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE};mv ../bootloader_am243.se.hs.tiimage .;">


    This is the output for both of my two post build commands.
    /home/user/ti/ccs1250/ccs/utils/bin/gmake -C /proj -f makefile_ccs_bootimage_gen OUTNAME=bootloader_am243 PROFILE=Debug MCU_PLUS_SDK_PATH=/home/user/ti/mcu_plus_sdk_am243x_09_00_00_35 CG_TOOL_ROOT=/home/user/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_2.1.3.LTS CCS_INSTALL_DIR=/home/user/ti/ccs1250/ccs CCS_IDE_MODE=desktop
    Boot image: am243x:r5fss0-0:nortos:ti-arm-clang /proj/Debug/bootloader_am243.hs_fs.tiimage ...
    /home/user/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_2.1.3.LTS/bin/tiarmobjcopy --strip-sections -O binary Debug/bootloader_am243.out /proj/Debug/bootloader_am243.bin
    python3 /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/tools/boot/signing/rom_image_gen.py --swrv 1 --sbl-bin /proj/Debug/bootloader_am243.bin --sysfw-bin /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-fs-enc.bin --sysfw-inner-cert /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-fs-enc-cert.bin --boardcfg-blob /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/source/drivers/sciclient/sciclient_default_boardcfg/am243x/boardcfg_blob.bin --sbl-loadaddr 0x70000000 --sysfw-loadaddr 0x44000 --bcfg-loadaddr 0x7B000 --key /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/tools/boot/signing/rom_degenerateKey.pem --rom-image /proj/Debug/bootloader_am243.hs_fs.tiimage
    cp /proj/Debug/bootloader_am243.hs_fs.tiimage /proj/Debug/tiboot3.bin
    Boot image: am243x:r5fss0-0:nortos:ti-arm-clang /proj/Debug/bootloader_am243.hs_fs.tiimage Done !!!
    .
    /home/user/ti/ccs1250/ccs/utils/bin/gmake -C /proj -f makefile_ccs_bootimage_gen OUTNAME=bootloader_am243 PROFILE=Debug MCU_PLUS_SDK_PATH=/home/user/ti/mcu_plus_sdk_am243x_09_00_00_35 DEVCONFIG_PATH=/proj/cust_devconfig.mak BOOTIMAGE_NAME=bootloader_am243.se.hs.tiimage CG_TOOL_ROOT=/home/user/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_2.1.3.LTS CCS_INSTALL_DIR=/home/user/ti/ccs1250/ccs CCS_IDE_MODE=desktop
    Boot image: am243x:r5fss0-0:nortos:ti-arm-clang bootloader_am243.se.hs.tiimage ...
    /home/user/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_2.1.3.LTS/bin/tiarmobjcopy --strip-sections -O binary Debug/bootloader_am243.out /proj/Debug/bootloader_am243.bin
    python3 /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/tools/boot/signing/rom_image_gen.py --swrv 1 --sbl-bin /proj/Debug/bootloader_am243.bin --sysfw-bin /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-fs-enc.bin --sysfw-inner-cert /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-fs-enc-cert.bin --boardcfg-blob /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/source/drivers/sciclient/sciclient_default_boardcfg/am243x/boardcfg_blob.bin --sbl-loadaddr 0x70000000 --sysfw-loadaddr 0x44000 --bcfg-loadaddr 0x7B000 --key /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/tools/boot/signing/rom_degenerateKey.pem --rom-image bootloader_am243.se.hs.tiimage
    cp bootloader_am243.se.hs.tiimage /proj/Debug/tiboot3.bin
    Boot image: am243x:r5fss0-0:nortos:ti-arm-clang bootloader_am243.se.hs.tiimage Done !!!

    How do I use the correct `sysfw-hs-enc.bin` file for the last pst build?
  • It is taking the correct one for me as shown

    C:/ti/ccs1230/ccs/utils/bin/gmake -C C:\ti\ccs_workspaces\workspace_v12.3\sbl_null_am243x-evm_r5fss0-0_nortos_ti-arm-clang -f makefile_ccs_bootimage_gen OUTNAME=sbl_null_am243x-evm_r5fss0-0_nortos_ti-arm-clang PROFILE=Debug MCU_PLUS_SDK_PATH=X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35 CG_TOOL_ROOT=C:/ti/ccs1230/ccs/tools/compiler/ti-cgt-armllvm_2.1.3.LTS CCS_INSTALL_DIR=C:\ti\ccs1230\ccs CCS_IDE_MODE=desktop DEVICE=am243x
    ...
    python X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot/signing/rom_image_gen.py --swrv 1 --sbl-bin C:/ti/ccs_workspaces/workspace_v12.3/sbl_null_am243x-evm_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_null_am243x-evm_r5fss0-0_nortos_ti-arm-clang.bin --sysfw-bin X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-fs-enc.bin --sysfw-inner-cert X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-fs-enc-cert.bin --boardcfg-blob X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/source/drivers/sciclient/sciclient_default_boardcfg/am243x/boardcfg_blob.bin --sbl-loadaddr 0x70000000 --sysfw-loadaddr 0x44000 --bcfg-loadaddr 0x7B000 --key X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot/signing/rom_degenerateKey.pem --rom-image sbl_null.Debug.hs_fs.tiimage
    ...
    C:/ti/ccs1230/ccs/utils/bin/gmake -C C:\ti\ccs_workspaces\workspace_v12.3\sbl_null_am243x-evm_r5fss0-0_nortos_ti-arm-clang -f makefile_ccs_bootimage_gen OUTNAME=sbl_null_am243x-evm_r5fss0-0_nortos_ti-arm-clang PROFILE=Debug MCU_PLUS_SDK_PATH=X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35 DEVCONFIG_PATH=X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/devconfig/cust_devconfig.mak BOOTIMAGE_NAME=custom_sbl_null.hs_fs.tiimage CG_TOOL_ROOT=C:/ti/ccs1230/ccs/tools/compiler/ti-cgt-armllvm_2.1.3.LTS CCS_INSTALL_DIR=C:\ti\ccs1230\ccs CCS_IDE_MODE=desktop DEVICE=am243x
    ...
    python X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot/signing/rom_image_gen.py --swrv 1 --sbl-enc --enc-key X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot/signing/custMek_am64x_am243x.txt --sbl-bin C:/ti/ccs_workspaces/workspace_v12.3/sbl_null_am243x-evm_r5fss0-0_nortos_ti-arm-clang/Debug/sbl_null_am243x-evm_r5fss0-0_nortos_ti-arm-clang.bin --sysfw-bin X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-enc.bin --sysfw-inner-cert X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-enc-cert.bin --boardcfg-blob X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/source/drivers/sciclient/sciclient_default_boardcfg/am243x/boardcfg_blob.bin --sbl-loadaddr 0x70000000 --sysfw-loadaddr 0x44000 --bcfg-loadaddr 0x7B000 --key X:/home/p-shivhare/ti/mcu_plus_sdk/am243x/09_00_00_35/tools/boot/signing/custMpk_am64x_am243x.pem --debug DBG_FULL_ENABLE --rom-image custom_sbl_null.hs_fs.tiimage

    The following patch modifies the SBL's CCS makefile (makefile_ccs_bootimage_gen) to take devconfig path as an argument:

    Do you have these changes correctly applied in the makefile?

  • I shared the exact line from my makefile_ccs_bootimage_gen above. The applicable part being:

    $(MAKE) -C ${CCS_PROJECT_DIR} -f makefile_ccs_bootimage_gen OUTNAME=${BuildArtifactFileBaseName} PROFILE=${ConfigName} MCU_PLUS_SDK_PATH=${MCU_PLUS_SDK_PATH} DEVCONFIG_PATH=${CCS_PROJECT_DIR}/cust_devconfig.mak BOOTIMAGE_NAME=${BuildArtifactFileBaseName}.se.hs.tiimage CG_TOOL_ROOT=${CG_TOOL_ROOT} CCS_INSTALL_DIR=${CCS_INSTALL_DIR} CCS_IDE_MODE=${CCS_IDE_MODE}

    The other changes I made are specifically:

    1) Added devMek_am64x_am243x_dev.txt and devMpk_am64x_am243x_dev.pem files to my project folder that include the keys I want to use.

    2) Put a copy of the devconfig.mak file from my SDK in my project folder and named that file cust_devconfig.mak.

    3) I made the following modifications to my cust_devconfig.mak file in my project folder:

    • Line 2:  DEVICE_TYPE?=HS
    • Line 22: CUST_MPK=devMpk_am64x_am243x_dev.pem
    • Line 23: CUST_MEK=devMek_am64x_am243x_dev.txt
    • Line 30: ENC_SBL_ENABLED?=no

    Am I missing something?

    I can provide entire files for you if you need them.

  • I can provide entire files for you if you need them.

    Yes, please share the `makefile_ccs_bootimage_gen` file you are using.

  • #
    # Auto generated makefile
    #
    
    # Below variables need to be defined outside this file or via command line
    # - MCU_PLUS_SDK_PATH
    # - PROFILE
    # - CG_TOOL_ROOT
    # - OUTNAME
    # - CCS_INSTALL_DIR
    # - CCS_IDE_MODE
    
    CCS_PATH=$(CCS_INSTALL_DIR)
    include $(MCU_PLUS_SDK_PATH)/imports.mak
    include $(MCU_PLUS_SDK_PATH)/devconfig/devconfig.mak
    
    STRIP=$(CG_TOOL_ROOT)/bin/tiarmstrip
    OBJCOPY=$(CG_TOOL_ROOT)/bin/tiarmobjcopy
    ifeq ($(OS), Windows_NT)
    	PYTHON=python
    else
    	PYTHON=python3
    endif
    
    OUTFILE=$(PROFILE)/$(OUTNAME).out
    BOOTIMAGE_PATH=$(abspath ${PROFILE})
    BOOTIMAGE_NAME_GP:=$(BOOTIMAGE_PATH)/$(OUTNAME).tiimage
    BOOTIMAGE_NAME_HS:=$(OUTNAME).$(PROFILE).hs.tiimage
    BOOTIMAGE_NAME_HS_FS:=$(BOOTIMAGE_PATH)/$(OUTNAME).hs_fs.tiimage
    ifeq ($(DEVICE_TYPE),HS)
    	BOOTIMAGE_NAME=$(BOOTIMAGE_NAME_HS)
    else
    	BOOTIMAGE_NAME=$(BOOTIMAGE_NAME_HS_FS)
    endif
    BOOTIMAGE_BIN_NAME:=$(BOOTIMAGE_PATH)/$(OUTNAME).bin
    
    #
    # Generation of boot image which can be loaded by ROM Boot Loader (RBL)
    #
    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=$(PROFILE)/temp_stdout_$(PROFILE).txt
    
    BOOTIMAGE_CERT_KEY=$(APP_SIGNING_KEY)
    BOOTIMAGE_CERT_GEN_CMD=$(PYTHON) $(MCU_PLUS_SDK_PATH)/tools/boot/signing/rom_image_gen.py
    SYSFW_PATH=$(MCU_PLUS_SDK_PATH)/source/drivers/sciclient/soc/am64x_am243x
    SYSFW_LOAD_ADDR=0x44000
    BOARDCFG_LOAD_ADDR=0x7B000
    BOARDCFG_BLOB=$(MCU_PLUS_SDK_PATH)/source/drivers/sciclient/sciclient_default_boardcfg/am243x/boardcfg_blob.bin
    
    SBL_RUN_ADDRESS=0x70000000
    
    SBL_PREBUILT_PATH=$(MCU_PLUS_SDK_PATH)/tools/boot/sbl_prebuilt/am243x-evm
    
    all:
    ifeq ($(CCS_IDE_MODE),cloud)
    #	No post build steps
    else
    	@echo  Boot image: am243x:r5fss0-0:nortos:ti-arm-clang $(BOOTIMAGE_NAME) ...
    	$(OBJCOPY) --strip-sections -O binary $(OUTFILE) $(BOOTIMAGE_BIN_NAME)
    ifeq ($(DEVICE_TYPE),HS)
    ifeq ($(ENC_SBL_ENABLED),yes)
    	$(BOOTIMAGE_CERT_GEN_CMD) --swrv 1 --sbl-enc --enc-key $(APP_ENCRYPTION_KEY) --sbl-bin $(BOOTIMAGE_BIN_NAME) --sysfw-bin $(SYSFW_PATH)/sysfw-hs-enc.bin --sysfw-inner-cert $(SYSFW_PATH)/sysfw-hs-enc-cert.bin --boardcfg-blob $(BOARDCFG_BLOB) --sbl-loadaddr $(SBL_RUN_ADDRESS) --sysfw-loadaddr $(SYSFW_LOAD_ADDR) --bcfg-loadaddr $(BOARDCFG_LOAD_ADDR) --key $(BOOTIMAGE_CERT_KEY) --debug DBG_FULL_ENABLE --rom-image $(BOOTIMAGE_NAME)
    else
    	$(BOOTIMAGE_CERT_GEN_CMD) --swrv 1 --sbl-bin $(BOOTIMAGE_BIN_NAME) --sysfw-bin $(SYSFW_PATH)/sysfw-hs-enc.bin --sysfw-inner-cert $(SYSFW_PATH)/sysfw-hs-enc-cert.bin --boardcfg-blob $(BOARDCFG_BLOB) --sbl-loadaddr $(SBL_RUN_ADDRESS) --sysfw-loadaddr $(SYSFW_LOAD_ADDR) --bcfg-loadaddr $(BOARDCFG_LOAD_ADDR) --key $(BOOTIMAGE_CERT_KEY) --debug DBG_FULL_ENABLE --rom-image $(BOOTIMAGE_NAME)
    endif
    else
    	$(BOOTIMAGE_CERT_GEN_CMD) --swrv 1 --sbl-bin $(BOOTIMAGE_BIN_NAME) --sysfw-bin $(SYSFW_PATH)/sysfw-hs-fs-enc.bin --sysfw-inner-cert $(SYSFW_PATH)/sysfw-hs-fs-enc-cert.bin --boardcfg-blob $(BOARDCFG_BLOB) --sbl-loadaddr $(SBL_RUN_ADDRESS) --sysfw-loadaddr $(SYSFW_LOAD_ADDR) --bcfg-loadaddr $(BOARDCFG_LOAD_ADDR) --key $(BOOTIMAGE_CERT_KEY) --rom-image $(BOOTIMAGE_NAME)
    	$(COPY) $(BOOTIMAGE_NAME) $(BOOTIMAGE_PATH)/tiboot3.bin
    	@echo  Boot image: am243x:r5fss0-0:nortos:ti-arm-clang $(BOOTIMAGE_NAME) Done !!!
    	@echo  .
    endif
    endif
    

  • Hi, you haven't applied the patch I shared in my very first response.

    -include $(MCU_PLUS_SDK_PATH)/devconfig/devconfig.mak
    +
    +DEVCONFIG_PATH?=$(MCU_PLUS_SDK_PATH)/devconfig/devconfig.mak
    +include $(DEVCONFIG_PATH)

  • With that change my project doesn't build any more:

    /home/user/ti/ccs1250/ccs/utils/bin/gmake -C /proj -f makefile_ccs_bootimage_gen OUTNAME=bootloader_am243 PROFILE=Debug MCU_PLUS_SDK_PATH=/home/user/ti/mcu_plus_sdk_am243x_09_00_00_35 DEVCONFIG_PATH=/proj/cust_devconfig.mak BOOTIMAGE_NAME=bootloader_am243.se.hs.tiimage CG_TOOL_ROOT=/home/user/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_2.1.3.LTS CCS_INSTALL_DIR=/home/user/ti/ccs1250/ccs CCS_IDE_MODE=desktop
    Boot image: am243x:r5fss0-0:nortos:ti-arm-clang bootloader_am243.se.hs.tiimage ...
    /home/user/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_2.1.3.LTS/bin/tiarmobjcopy --strip-sections -O binary Debug/bootloader_am243.out /proj/Debug/bootloader_am243.bin
    python3 /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/tools/boot/signing/rom_image_gen.py --swrv 1 --sbl-bin /proj/Debug/bootloader_am243.bin --sysfw-bin /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-enc.bin --sysfw-inner-cert /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/source/drivers/sciclient/soc/am64x_am243x/sysfw-hs-enc-cert.bin --boardcfg-blob /home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/source/drivers/sciclient/sciclient_default_boardcfg/am243x/boardcfg_blob.bin --sbl-loadaddr 0x70000000 --sysfw-loadaddr 0x44000 --bcfg-loadaddr 0x7B000 --key custMpk_am64x_am243x_dev.pem --debug DBG_FULL_ENABLE --rom-image bootloader_am243.se.hs.tiimage
    makefile_ccs_bootimage_gen:66: recipe for target 'all' failed
    Could not open file or uri for loading private key from custMpk_am64x_am243x_dev.pem
    4087427E077F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
    4087427E077F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(custMpk_am64x_am243x_dev.pem)
    Traceback (most recent call last):
      File "/home/user/ti/mcu_plus_sdk_am243x_09_00_00_35/tools/boot/signing/rom_image_gen.py", line 313, in <module>
        subprocess.check_output('openssl req -new -x509 -key {} -nodes -outform DER -out {} -config {} -{}'.format(args.key, cert_name, cert_file_name, g_sha_to_use), shell=True)
      File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/usr/lib/python3.10/subprocess.py", line 526, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command 'openssl req -new -x509 -key custMpk_am64x_am243x_dev.pem -nodes -outform DER -out cert452 -config temp_cert334 -sha512' returned non-zero exit status 1.
    gmake[3]: *** [all] Error 1
    gmake[2]: [post-build] Error 2 (ignored)
    makefile:177: recipe for target 'post-build' failed
    mv ../bootloader_am243.se.hs.tiimage .
    makefile:177: recipe for target 'post-build' failed
    mv: cannot stat '../bootloader_am243.se.hs.tiimage': No such file or directory
    gmake[2]: [post-build] Error 1 (ignored)

  • 3) I made the following modifications to my cust_devconfig.mak file in my project folder:

    • Line 2:  DEVICE_TYPE?=HS
    • Line 22: CUST_MPK=devMpk_am64x_am243x_dev.pem
    • Line 23: CUST_MEK=devMek_am64x_am243x_dev.txt
    • Line 30: ENC_SBL_ENABLED?=no

    The CUST_MPK & CUST_MEK should be initialized with the absolute paths to the keys like they are initialized in the default devconfig.

    ❯ grep -n ".*am64x_am243x" -- devconfig/devconfig.mak
    28:     CUST_MPK=$(SIGNING_TOOL_PATH)/custMpk_am64x_am243x.pem
    29:     CUST_MEK=$(SIGNING_TOOL_PATH)/custMek_am64x_am243x.txt