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.

AM62A7: Uart log HS-SE device

Part Number: AM62A7
Other Parts Discussed in Thread: UNIFLASH, AM625

Hello,

     I'm working with AM62A7 HS-SE device which has been enabled secure boot with custom keys

     Only emmc is used on the board (no norflash, no SD) while emmc boot and uart boot is applied.

     Before the device is transfered to HS-SE, the images (SBL, HSM, MCU_R5, Uboot)  flashed into the eMMC could run normally and system startup logs can be output through UART. However, after the device is transfered to HS-SE (that is secure boot enabled) and the images signed with custom keys are flashed into emmc, The UART port no longer prints startup information of system.

     According to the debug result, I believe the secure boot verification is working, because the R5-core could work normally (the CAN bus messages of the R5-core are sent and received normally), besides, when the data of the R5-core image is tampered, the R5-core no longer work.

    I flashed the images by uniflash through UART.

    I want to know why the log on UART is lost and how to fix that?

    Thanks a lot!

  • Hello,

    Do you mean that the images are successfully booting on the HSSE device but you don't see any logs on the UART port which were coming on the HSFS device?

  • Yes, I have converted the device to HS-SE by importing SMPK&BMPK. I can't see any logs on the UART port which was visible before converting. 

  • According to the debug result, I believe the secure boot verification is working, because the R5-core could work normally

    I would like to know if you think that the booting seems to be successful but you don't see any logs.

    In any case,

    could you please follow the first few responses from the following thread to check if the images are signed correctly

    e2e.ti.com/.../am625-am62x-migration-sdk9-to-sdk11-issue-tiboot3-bin-hs-loads-but-does-not-run-dfu

  • My images are *.hs format, not bin, which are signed with custMpk_am62ax.pem. Is there somthing wrong? And I flashed the images to emmc on borad with uniflash based on the config file.

    Here is the information of the SE device.

  • If possible, could you please configure the backup bootmode to UART and primary to eMMC only? If the ROM jumps to the backup bootmode (UART) then you should see the hex string on the UART console. This would confirm ROM is rejecting the image read from the eMMC.

    Otherwise,

    If you have the debugging setup available, please apply the following patch and flash the updated SBL Stage1

    diff --git a/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage1/am62ax-sk/r5fss0-0_nortos/ti-arm-clang/makefile b/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage1/am62ax-sk/r5fss0-0_nortos/ti-arm-clang/makefile
    index c8866f5964d..4e5107907a8 100644
    --- a/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage1/am62ax-sk/r5fss0-0_nortos/ti-arm-clang/makefile
    +++ b/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage1/am62ax-sk/r5fss0-0_nortos/ti-arm-clang/makefile
    @@ -272,9 +272,9 @@ $(BOOTIMAGE_NAME): $(BOOTIMAGE_BIN_NAME)
     	@echo  Boot image: am62ax:r5fss0-0:nortos:ti-arm-clang $(BOOTIMAGE_PATH)/$@ ...
     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_PATH)/$(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) --boardcfg-sbldata-blob $(BOARDCFG_SBLDATA_BLOB) --sbl-loadaddr $(SBL_RUN_ADDRESS) --sysfw-loadaddr $(SYSFW_LOAD_ADDR) --bcfg-loadaddr $(BOARDCFG_LOAD_ADDR) --bcfg-sbldata-loadaddr $(BOARDCFG_SBLDATA_LOAD_ADDR) --key $(BOOTIMAGE_CERT_KEY) --rom-image $(BOOTIMAGE_PATH)/$(BOOTIMAGE_NAME) --enable-sbldata $(ENABLE_SBLDATA) --keyversion $(VERSION)
    +	$(BOOTIMAGE_CERT_GEN_CMD) --swrv 1 --sbl-enc --enc-key $(APP_ENCRYPTION_KEY) --sbl-bin $(BOOTIMAGE_PATH)/$(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) --boardcfg-sbldata-blob $(BOARDCFG_SBLDATA_BLOB) --sbl-loadaddr $(SBL_RUN_ADDRESS) --sysfw-loadaddr $(SYSFW_LOAD_ADDR) --bcfg-loadaddr $(BOARDCFG_LOAD_ADDR) --bcfg-sbldata-loadaddr $(BOARDCFG_SBLDATA_LOAD_ADDR) --debug DBG_FULL_ENABLE --key $(BOOTIMAGE_CERT_KEY) --rom-image $(BOOTIMAGE_PATH)/$(BOOTIMAGE_NAME) --enable-sbldata $(ENABLE_SBLDATA) --keyversion $(VERSION)
     else
    -	$(BOOTIMAGE_CERT_GEN_CMD) --swrv 1 --sbl-bin $(BOOTIMAGE_PATH)/$(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) --boardcfg-sbldata-blob $(BOARDCFG_SBLDATA_BLOB) --sbl-loadaddr $(SBL_RUN_ADDRESS) --sysfw-loadaddr $(SYSFW_LOAD_ADDR) --bcfg-loadaddr $(BOARDCFG_LOAD_ADDR) --bcfg-sbldata-loadaddr $(BOARDCFG_SBLDATA_LOAD_ADDR) --key $(BOOTIMAGE_CERT_KEY) --rom-image $(BOOTIMAGE_PATH)/$(BOOTIMAGE_NAME) --enable-sbldata $(ENABLE_SBLDATA) --keyversion $(VERSION)
    +	$(BOOTIMAGE_CERT_GEN_CMD) --swrv 1 --sbl-bin $(BOOTIMAGE_PATH)/$(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) --boardcfg-sbldata-blob $(BOARDCFG_SBLDATA_BLOB) --sbl-loadaddr $(SBL_RUN_ADDRESS) --sysfw-loadaddr $(SYSFW_LOAD_ADDR) --bcfg-loadaddr $(BOARDCFG_LOAD_ADDR) --bcfg-sbldata-loadaddr $(BOARDCFG_SBLDATA_LOAD_ADDR) --debug DBG_FULL_ENABLE --key $(BOOTIMAGE_CERT_KEY) --rom-image $(BOOTIMAGE_PATH)/$(BOOTIMAGE_NAME) --enable-sbldata $(ENABLE_SBLDATA) --keyversion $(VERSION)
     endif
     	$(COPY) $(BOOTIMAGE_NAME_HS) $(BOOTIMAGE_PATH)/tiboot3.bin
     else
    

    If the ROM is booting the SBL Stage1 correctly then it should unlock the JTAG for you to be able to connect to the WKUP R5F core. In that case, please connect to the core and note the address at which the core is halted.

  • Btw, what is the keywriter certificate generation command you used to generate the keywriter certificate for converting the device? I would like to verify if you have programmed the encryption keys as well since the SBL Stage1 is by default encrypted in the SDK. So, if you have not programmed the encryption, the ROM will not be able to boot the SBL Stage1.

  • I understand you concern. I have programed SMPK, SMEK, BMPK and BMEK to the efuse. the command I used is "./gen_keywr_cert.sh -t tifek/ti_fek_public.pem --msv 0xC0FFE -s keys_devel/v15/ smpk.pem --smek keys_devel/smek.key -b keys_devel/v15/bmpk.pem --bmek keys_devel/bmek.key --keycnt 2 --keyrev 1" and I also find the SBL stage1 is encrypted by default.

    The UART log looks normal on the demo board(AM625 SE device, I think AM62A7 and AM625 is similar for security feature.)

    Is "no UART log" a security  feature for SE device? I added "--debug DBG_FULL_ENABLE" in the makefile for SBL stage1 to  re-compile, but the problem of UART remains.

  • Is "no UART log" a security  feature for SE device?

    Not really.

    I added "--debug DBG_FULL_ENABLE" in the makefile for SBL stage1 to  re-compile, but the problem of UART remains.

    In that case, could you please use the debugger to connect to the WKUP R5F core? If you are able to connect then ROM is booting the SBL Stage1 but it is stuck somewhere.

    Could you please share the SBL Stage1 image as well?

  • OK, I could try.

    this is my SBL stage1 iamge.

  • The image looks good to me. I think it should at least be booting successfully. If you could provide the results of debugger testing, we could proceed further.

  • OK, thanks. I will try to use the debugger to connect to the WKUP R5F core, then provide the result.