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-Q1:偶尔出现 SBL 身份验证失败

Guru**** 2540720 points
Other Parts Discussed in Thread: UNIFLASH

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1365738/am62a7-q1-occasional-sbl-authentication-failure

器件型号:AM62A7-Q1
主题中讨论的其他器件:UNIFLASH

尊敬的 TI 专家:

客户使用 AM62A SDK9.2 FS、并使用 HS-SBL 器件。

他们已经尝试将如下所示的器件类型分别设置为 GP 和 HS、但这两个器件都可能发生身份验证失败、稍后将对此进行讨论。

无论将器件类型设置为 GP 或 HS、我们都将获得以下结果 xxxx_release.appimage.hs_fs . 我们已经尝试了这两种 HS_FS 映像来自 GP 器件类型和 HS 器件类型、但这两个类型都偶尔会出现 身份验证失败、稍后将对此进行介绍。

当 偶尔 发生身份验证失败时、相应的错误日志显示如下。

请问您对此问题有何建议吗?

非常感谢、

Kevin

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

    尊敬的 Kevin:

    Bootloader_verifyMulticoreImage 函数中存在多个故障点。 可能是映像本身在 DDR 中读取不正确的情况、因此即使在向 TIFS 发出任何映像身份验证请求之前、也可能会错误地读取证书长度、从而导致失败。

      

    您能否要求客户在身份验证失败时检查映像长度(imageLen)和证书长度(certLen)的值是多少。

    此致、

    Prashant

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

    您好、Prashant  

    我检查一下 imageLen 和 certLen、它们是有效的。  

    Bootloader_socAuthImage 返回值函数的错误为0xffffffff

    出现"Debug (调试)"日志  

    [sbl_emmc_linux_stage1] step 1
    [sbl_emmc_linux_stage1] step 2
    [sbl_emmc_linux_stage1] step 3
    [sbl emmc linux stage1] Enter App_loadImages Functions
    [sbl emmc linux stage1] App_loadImages step 1
    [Bootloader] Enter Function of Bootloader_parseMultiCoreAppImage...
    [Bootloader:Bootloader_parseMultiCoreAppImage] HS Device : VerifyMulticoreImage
    [Bootloader] Enter Function of Bootloader_verifyMulticoreImage...
    [Bootloader:Bootloader_verifyMulticoreImage] The bootMedia is 0xb0070003
    [Bootloader:Bootloader_verifyMulticoreImage] The bootMedia is Flash or EMMC
    [Bootloader:Bootloader_verifyMulticoreImage] certLen = 0x676
    [Bootloader:Bootloader_verifyMulticoreImage] imageLen = 0xe754
    [Bootloader:Bootloader_verifyMulticoreImage] authStatus = 0xffffffff
    ERROR: Bootloader_verifyMulticoreImage:660: Failed to authenticate Image
    [sbl emmc linux stage1] App_loadImages step 2
    [sbl emmc linux stage1] App_loadImages step 3
    [sbl emmc linux stage1] App_loadImages step 6
    [sbl_emmc_linux_stage1] Some tests have failed!!
    

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

    您好、Prashant

    我在 Sciclient_procBootAuthAndStart 函数中找到问题位置

    我在后面添加了一些调试信息  

    int32_t Sciclient_procBootAuthAndStart(
                const struct tisci_msg_proc_auth_boot_req * authBootCfg,
                uint32_t timeout)
    {
        int32_t retVal = CSL_PASS;
    
        struct tisci_msg_proc_auth_boot_resp response = {0};
        DebugP_log("[DM-sciclient] Enter Function of Sciclient_procBootAuthAndStart... \r\n");
        Sciclient_ReqPrm_t reqParam = {0};
        reqParam.messageType    = (uint16_t) TISCI_MSG_PROC_AUTH_BOOT;
        reqParam.flags          = (uint32_t) TISCI_MSG_FLAG_AOP;
        reqParam.pReqPayload    = (const uint8_t *) authBootCfg;
        reqParam.reqPayloadSize = (uint32_t) sizeof (struct tisci_msg_proc_auth_boot_req);
        reqParam.timeout        = (uint32_t) timeout;
    
        Sciclient_RespPrm_t respParam = {0};
        respParam.flags           = (uint32_t) 0;   /* Populated by the API */
        respParam.pRespPayload    = (uint8_t *) &response;
        respParam.respPayloadSize = (uint32_t) sizeof (response);
    
        retVal = Sciclient_service(&reqParam, &respParam);
        DebugP_log("[Bootloader:Sciclient_procBootAuthAndStart]  retVal = 0x%x,respParam.flags = 0x%x\r\n",retVal,respParam.flags);
        if((retVal != CSL_PASS) ||
            ((respParam.flags & TISCI_MSG_FLAG_ACK) != TISCI_MSG_FLAG_ACK))
        {
            retVal = CSL_EFAIL;
        }
        return retVal;
    }

    和调试输出信息

    [sbl_emmc_linux_stage1] step 1
    [sbl_emmc_linux_stage1] step 2
    [sbl_emmc_linux_stage1] step 3
    [sbl emmc linux stage1] Enter App_loadImages Functions
    [sbl emmc linux stage1] App_loadImages step 1
    [Bootloader] Enter Function of Bootloader_parseMultiCoreAppImage...
    [Bootloader:Bootloader_parseMultiCoreAppImage] HS Device : VerifyMulticoreImage
    [Bootloader] Enter Function of Bootloader_verifyMulticoreImage...
    [Bootloader:Bootloader_verifyMulticoreImage] The bootMedia is 0xb0070003
    [Bootloader:Bootloader_verifyMulticoreImage] The bootMedia is Flash or EMMC
    [Bootloader:Bootloader_verifyMulticoreImage] certLen = 0x676
    [Bootloader:Bootloader_verifyMulticoreImage] imageLen = 0xe754
    [Bootloader:Bootloader_verifyMulticoreImage] certLoadAddr = 0x84000000
    [Bootloader] Enter Function of Bootloader_socAuthImage...
    [DM-sciclient] Enter Function of Sciclient_procBootAuthAndStart...
    [DM-sciclient] Enter Function of Sciclient_service...
    [DM-sciclient] Running the function of Sciclient_serviceGetThreadIds and ret = 0x0...
    [DM-sciclient] Running the function of Sciclient_servicePrepareHeader and ret = 0x0...
    [DM-sciclient] msgType = 0xc120...
    [Bootloader:Sciclient_procBootAuthAndStart]  retVal = 0x0,respParam.flags = 0x0
    [Bootloader:Bootloader_verifyMulticoreImage] authStatus = 0xffffffff
    ERROR: Bootloader_verifyMulticoreImage:661: Failed to authenticate Image
    [sbl emmc linux stage1] App_loadImages step 2
    [sbl emmc linux stage1] App_loadImages step 3
    [sbl emmc linux stage1] App_loadImages step 6
    [sbl_emmc_linux_stage1] Some tests have failed!!
    

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

    您好、Tom、

    感谢您提供详细的调试。

    在进行进一步讨论前、我想作一些澄清。

    该问题是在对 sbl_uart_uniflash_stage2 appimage 进行身份验证时首次报告的。 但是、最新的日志显示 sbl_eMMC_linux_stage1可能无法验证 MCU appimage。 那么、您是否在这两种情况下都看到了身份验证失败?

    此外、只是为了确认身份验证失败是随机的、而不是每次都发生?

    此外、您使用的是定制电路板还是 TI AM62A EVM?

    此致、

    Prashant

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

    您好、Prashant

    是、在 sbl_uart_uniflash_stage1和 sbl_eMMC_linux_stage1中发现的问题。

    我测试了 EVM、未发生此问题。

    BR

    Tom

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    我测试了 EVM、未发生此问题。

    您的意思是此问题仅发生在您的定制电路板上吗?

    另外、您没有说明身份验证失败是随机的还是在每次 POR 上发生的? 如果是随机的、您能告诉随机故障的百分比吗?

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

    是的、在定制电路板中会发生这种情况。 这是随机故障。未添加调试信息时、发生的概率大约为50%、并且在添加调试信息后、发生的概率会下降到大约10%

    i debuging、因为需要 sciclient、但它不会响应 ACK、因此它失败。请参阅上面的调试信息

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

    您好、Tom、

    您能否按此处所述启用并共享 TIFS 日志

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM62AX/09_02_00_38/exports/docs/api_guide_am62ax/TOOLS_SYSFW.html#SYSFW_TRACE_ENABLE

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

    您好、Prashant

    我使用该指南、它会报告错误、后面显示错误信息

     28/05/2024   16:22.14   /drives/c/ti/mcu_plus_sdk_am62ax_09_01_00_39   master  gmake -s -C tools/sysfw/boardcfg SOC=am62ax
    "Build Board Configuration Obj Files"
    "Create unsigned Board Configuration binary"
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LC_ALL = "zh_CN.UTF-8",
            LC_CTYPE = "zh_CN.UTF-8",
            LANG = "zh_CN.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the system default locale ("Chinese (Simplified)_China.936").
    Load address not computed for file that does not have a segment table at XML_TI_OFD.pm line 1441.
    Use of uninitialized value in multiplication (*) at script/mkhex4bin.pl line 295.
    "Sign Board Configuration with GP key"
    "  (note: GP board configuration not ACTUALLY signed with anything)"
    "Generate include-able header file from signed Board Configuration"
    "Build Board Configuration Obj Files"
    "Create unsigned Board Configuration binary"
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LC_ALL = "zh_CN.UTF-8",
            LC_CTYPE = "zh_CN.UTF-8",
            LANG = "zh_CN.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the system default locale ("Chinese (Simplified)_China.936").
    Load address not computed for file that does not have a segment table at XML_TI_OFD.pm line 1441.
    Use of uninitialized value in multiplication (*) at script/mkhex4bin.pl line 295.
    "Sign Board Configuration with GP key"
    "  (note: GP board configuration not ACTUALLY signed with anything)"
    "Generate include-able header file from signed Board Configuration"
    "Build Board Configuration Obj Files"
    "Create unsigned Board Configuration binary"
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LC_ALL = "zh_CN.UTF-8",
            LC_CTYPE = "zh_CN.UTF-8",
            LANG = "zh_CN.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the system default locale ("Chinese (Simplified)_China.936").
    Load address not computed for file that does not have a segment table at XML_TI_OFD.pm line 1441.
    Use of uninitialized value in multiplication (*) at script/mkhex4bin.pl line 295.
    "Sign Board Configuration with GP key"
    "  (note: GP board configuration not ACTUALLY signed with anything)"
    "Generate include-able header file from signed Board Configuration"
    "Build Board Configuration Obj Files"
    "Create unsigned Board Configuration binary"
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LC_ALL = "zh_CN.UTF-8",
            LC_CTYPE = "zh_CN.UTF-8",
            LANG = "zh_CN.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the system default locale ("Chinese (Simplified)_China.936").
    Load address not computed for file that does not have a segment table at XML_TI_OFD.pm line 1441.
    Use of uninitialized value in multiplication (*) at script/mkhex4bin.pl line 295.
    "Sign Board Configuration with GP key"
    "  (note: GP board configuration not ACTUALLY signed with anything)"
    "Generate include-able header file from signed Board Configuration"
    SYSFW Boardcfg blob created at C:\ti\mcu_plus_sdk_am62ax_09_01_00_39\source\drivers\sciclient\sciclient_default_boardcfg\am62ax\boardcfg_blob.bin
    SYSFW Boardcfg blob created at C:\ti\mcu_plus_sdk_am62ax_09_01_00_39\source\drivers\sciclient\sciclient_default_boardcfg\am62ax\boardcfg_sbldata_blob.bin
    

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

    您好、Prashant

    我尝试两次、一次不报告错误、但它根据输出 TISCI 跟踪、  

    [sbl uart uniflash stage1] recv the sbl_uart_uniflash stage2 image...
    [sbl uart uniflash stage1] recv the sbl_uart_uniflash stage2 image Done!!!
    [Bootloader:Bootloader_parseMultiCoreAppImage] HS Device : VerifyMulticoreImage
    [Bootloader:Bootloader_verifyMulticoreImage] The bootMedia is 0xb0070001
    [Bootloader:Bootloader_verifyMulticoreImage] certLoadAddr = 0x84000000
    [DM:SCICLIENT] Request Sciclient_service for msgType = 0xc120...
    [DM:SCICLIENT] Request Sciclient_serviceSecureProxy for msgType = 0xc120...
    [DM:SCICLIENT:Sciclient_procBootAuthAndStart] retVal = 0x0,respParam.flags = 0x2
    [Bootloader:Bootloader_verifyMulticoreImage] authStatus = 0x0
    [sbl uart uniflash stage1] App_loadSelfcoreImage function : Bootloader_parseMultiCoreAppImage return status 0...
    [DM:SCICLIENT] Request Sciclient_service for msgType = 0x10c...
    0x6180010C
    0x61C00079
    0x612F7CA7
    0x612F7CA7
    [DM:SCICLIENT] Request Sciclient_service for msgType = 0x10e...
    0x6180010E
    0x61C00079
    [sbl uart uniflash stage1] Loading the sbl_uart_uniflash_stage2 image to WKP core...
    [sbl uart uniflash stage1] Loading the sbl_uart_uniflash_stage2 image Done and Response message for XMODEM...
    
    
    [sbl uart uniflash stage2] Init has been Done!!!
    ERROR: Board_flashOpen:201: FLASH open failed for instance 0 !!!
    

    其中一个报告身份验证错误、它输出 TISCI 跟踪、如下所示

    [sbl uart uniflash stage1] recv the sbl_uart_uniflash stage2 image...
    [sbl uart uniflash stage1] recv the sbl_uart_uniflash stage2 image Done!!!
    [Bootloader:Bootloader_parseMultiCoreAppImage] HS Device : VerifyMulticoreImage
    [Bootloader:Bootloader_verifyMulticoreImage] The bootMedia is 0xb0070001
    [Bootloader:Bootloader_verifyMulticoreImage] certLoadAddr = 0x84000000
    [DM:SCICLIENT] Request Sciclient_service for msgType = 0xc120...
    [DM:SCICLIENT] Request Sciclient_serviceSecureProxy for msgType = 0xc120...
    [DM:SCICLIENT:Sciclient_procBootAuthAndStart] retVal = 0x0,respParam.flags = 0x0
    [DM:SCICLIENT:Sciclient_procBootAuthAndStart] Sciclient_procBootAuthAndStart request is NOACK
    [Bootloader:Bootloader_verifyMulticoreImage] authStatus = 0xffffffff
    ERROR: Bootloader_verifyMulticoreImage:658: Failed to authenticate Image
    [sbl uart uniflash stage1] App_loadSelfcoreImage function : Bootloader_parseMultiCoreAppImage return status -1...
    [sbl uart uniflash stage1] Loading the sbl_uart_uniflash_stage2 image to WKP core...
    [sbl uart uniflash stage1] Loading the sbl_uart_uniflash_stage2 image Done and Response message for XMODEM...
    

    请帮助 anaysis,谢谢

    BR

    Tom

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

    您好、Tom、

    如果启用了 TIFS 日志、将按此处所述从存储器中收集

    https://software-dl.ti.com/tisci/esd/latest/4_trace/trace.html#trace-memory-buffer-location

    此外、如果使用 HSFS 器件类型、请确保将 DEVICE_TYPE 设置为仅 GP、因为 DEVICE_TYPE=HS 适用于 HSSE 器件。

    此致、

    Prashant

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

    我的器件是 HSFS、器件类型设置也为 GP。

    启用 TIFS 日志后、从唤醒 UART0输出一些 TIFS 日志、请参阅

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

    您好、Tom、

    启用 TIFS 日志时、从唤醒 UART0输出的某些 TIFS 日志中、请参阅

    这些是 DM 日志。 TIFS 日志将独立、并从其定义的存储器缓冲区中收集。

    我希望您在身份验证失败后以无限循环的方式捕获执行、并收集 TIFS 日志。

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

    什么从存储器缓冲区收集 TIFS 日志?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    从内存缓冲区收集 TIFS 日志的内容是什么?

    您可以使用任何调试器收集日志。

    或者、您可以使用以下函数转储它们

    void dump_tifs_logs()
    {
        #define TIFS_LOGS_BUFFER_ADDR 0x4405F000
        #define TIFS_LOGS_BUFFER_SIZE 0x1000
    
        uint8_t* ptr = (uint8_t*)TIFS_LOGS_BUFFER_ADDR;
    
        DebugP_log("\r\n<<TIFS_LOGS\r\n");
    
        for(int32_t i = 0; i < TIFS_LOGS_BUFFER_SIZE; i++)
        {
            DebugP_log("%c", *ptr);
            ptr++;
        }
    
        DebugP_log("\r\nTIFS_LOGS\r\n");
    }

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

    您好、Tom、

    感谢您发送编修。

    在解析日志时、我们看到了以下内容

    0x0042C120:基端口:TISCI_MSG_RECEIVED (已处理 TISCI 消息中断):队列 ID:2消息 ID:C120
    0x00820024:基端口:TISCI_MSG_SENSOR_HOST_ID (收到来自安全主机的消息):队列 ID:2主机 ID:36
    0x20C00004:安全性:sec_boot (安全引导 API 调用期间的故障点):0x01 =>证书长度>ASN1P_IMAX、0x02 =>发出获取证书、0x3 =>哈希操作有问题、0x4 =>哈希比较失败:0

    失败的原因似乎是散列比较、可能是映像损坏所致。

    我认为这主要是一个 DDR 问题。 该映像在请求身份验证之前首先读入 DDR。 因此、如果您的 DDR 配置不稳定、这可能会导致映像有时被错误读取、从而导致身份验证失败。 即使单个字节损坏也足以应对该故障。

    那么、问题是、您是否对 DDR 进行了任何应力测试?

    此致、

    Prashant

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

    您好、Tom、

    我们先着重介绍一下 DDR 器件。 在深入研究 DDR 的压力测试之前、您能试一下以下内容吗?

    假设身份验证`sbl_uart_uniflash_stage2`、应用修改 stage1 linker.cmd 的以下补丁、以将读取的映像存储在身份验证后的加载地址不同的位置。

    diff --git a/examples/drivers/boot/sbl_uart_uniflash_multistage/sbl_uart_uniflash_stage1/am62ax-sk/r5fss0-0_nortos/ti-arm-clang/linker.cmd b/examples/drivers/boot/sbl_uart_uniflash_multistage/sbl_uart_uniflash_stage1/am62ax-sk/r5fss0-0_nortos/ti-arm-clang/linker.cmd
    index 31088ce..d9aabe0 100644
    --- a/examples/drivers/boot/sbl_uart_uniflash_multistage/sbl_uart_uniflash_stage1/am62ax-sk/r5fss0-0_nortos/ti-arm-clang/linker.cmd
    +++ b/examples/drivers/boot/sbl_uart_uniflash_multistage/sbl_uart_uniflash_stage1/am62ax-sk/r5fss0-0_nortos/ti-arm-clang/linker.cmd
    @@ -73,5 +73,5 @@ MEMORY
         R5F_TCMB0: ORIGIN = 0x41010000 , LENGTH = 0x00008000 */
         HSM_RAM_VECS: ORIGIN = 0x43C00000 , LENGTH = 0x100
         HSM_RAM  : ORIGIN = 0x43C00100 , LENGTH = 0x3c800 - 0x100
    -    DDR      : ORIGIN = 0x84000000 , LENGTH = 0x800000
    +    DDR      : ORIGIN = 0x88000000 , LENGTH = 0x800000
     }
    

    这应该读取位于0x88000000的映像、然后请求身份验证。 如果身份验证成功、则会在不同的地址0x84000000处加载最终映像。

    因此、想法是在身份验证失败发生时、可能使用调试器将读取的映像保存在0x88000000、并将该映像与 PC 中可用的黄金映像进行比较。 如果它们不同、它将确认解除武装、复员和重返社会是这里的问题、否则我们将不得不去别处看看。

    此致、

    Prashant

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

    为了防止出现这种情况、还可以通过其他方法来确认图像是否已正确读取。

    您可以在应用中集成一个基于软件的简单 CRC32计算。 然后、就在身份验证请求之前、计算 DDR 中读取的映像的 CRC32校验和。 如果身份验证失败、请将计算出的 CRC32与黄金映像的 CRC32进行比较。

    我们没有 CRC32代码、但您应该可以在互联网上找到它。 如果找到、我认为这种方法比上一种方法更好。

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

    当使用 UART uniflash 程序时、xds110不连接板、因此没有工具可以转储 DDR 数据。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    当使用 UART uniflash 程序时、xds110未连接电路板、因此没有工具可以转储 DDR 数据。

    我无法理解。 您的电路板是否没有任何外部或板载调试器? 如果您这样做、您可以在故障后连接到内核并从 DDR 读取数据。

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

    该程序基于串行端口刷写程序、且刷写程序在 DM-R5F 内核上运行、由于该芯片是 FS_HS 芯片、每个引导都需要等待 SYSFW 固件、所以在开发 SBL 时您不能使用 XDS110调试器、不能看到板上没有调试接口。

    因此、请勿通过 XDS110转储原始数据

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

    这是不正确的。 在引导流程中、您可以随时连接到 DM-R5F 内核。

    我希望您在身份验证失败时立即在无限循环中捕获执行。 然后、使用调试器连接到 DM-R5F 内核并转储来自 DDR 的映像。

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

    您好、Tom、

    事实证明、DDR 数据已被篡改、下一步是进行 DDR 压力测试

    如果确实是这种情况、您能否为 DDR 应力测试创建一个单独的线程、以便将其分配给合适的专家。

    DDR 应力测试完成后、我们可以回到这一点、看看问题是否仍然存在。

    此致、

    Prashant

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

    您好、Prashant

    我们使用两块电路板做 DDR 应力测试2 dyas、没有任何错误。

    后面的测试日志

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

    Prashant、您好!

    我让客户在整个周末在两块有问题的主板上运行 DDR 压力测试仪(他们只有两块主板、都有此问题)。 结果表明、DDR 应力测试没有失败。

    这超出了我们的预期、我们不知道下一步将要努力做什么。

    谢谢!

    Kevin

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

    您好、Tom、

    您是否使用了用于 DDR 应力测试的 MCU+ SDK 中的确切 DDR 配置?

    [报价 userid="590305" url="~/support/processors-group/processors/f/processors-forum/1365738/am62a7-q1-occasional-sbl-authentication-failure/5226209 #5226209"]我检查0x8400000至0x8480000的整个 DDR、之后的调试代码 

    此外、 gUniflashFileBuf_bk 数组如何获取其值? 也许您可以共享将有所帮助的完整 bootloader.c 源文件。

    此致、

    Prashant

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

    您好、Prashant  

    后面的 main.c 代码  

     /*
     *  Copyright (C) 2018-2021 Texas Instruments Incorporated
     *
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions
     *  are met:
     *
     *    Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     *    Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the
     *    distribution.
     *
     *    Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /*
     * Auto generated file - DO NOT MODIFY
     */
    
    #include <stdlib.h>
    #include <string.h>
    #include "ti_drivers_config.h"
    #include "ti_drivers_open_close.h"
    #include "ti_board_open_close.h"
    #include <drivers/soc.h>
    #include <drivers/pinmux.h>
    #include <drivers/device_manager/sciclient.h>
    #include <drivers/bootloader.h>
    #include <drivers/bootloader/bootloader_xmodem.h>
    #include <drivers/bootloader/bootloader_uniflash.h>
    #include <kernel/dpl/DebugP.h>
    #include <drivers/device_manager/sciclient.h>
    #include <drivers/sciclient/include/tisci/am62ax/tisci_hosts.h>
    #include <drivers/sciclient/include/tisci/am62ax/tisci_boardcfg_constraints.h>
    #include <drivers/sciclient/include/tisci/am62ax/tisci_devices.h>
    
    #define BOOTLOADER_UNIFLASH_MAX_FILE_SIZE (0x800000) /* This has to match the size of DDR section in linker.cmd */
    uint8_t gUniflashFileBuf[BOOTLOADER_UNIFLASH_MAX_FILE_SIZE] __attribute__((aligned(128), section(".bss.filebuf")));
    uint8_t gUniflashFileBuf_bk[BOOTLOADER_UNIFLASH_MAX_FILE_SIZE] __attribute__((aligned(128), section(".bss.filebuf")));
    
    #define BOOTLOADER_UNIFLASH_VERIFY_BUF_MAX_SIZE (32*1024)
    uint8_t gUniflashVerifyBuf[BOOTLOADER_UNIFLASH_VERIFY_BUF_MAX_SIZE] __attribute__((aligned(128), section(".bss")));
    
    extern const struct tisci_boardcfg gBoardConfigLow_debug;
    
    /* call this API to stop the booting process and spin, do that you can connect
     * debugger, load symbols and then make the 'loop' variable as 0 to continue execution
     * with debugger connected.
     */
    void loop_forever()
    {
        volatile uint32_t loop = 1;
        while(loop)
            ;
    }
    
    int32_t App_loadSelfcoreImage(Bootloader_Handle bootHandle, Bootloader_BootImageInfo *bootImageInfo)
    {
    	int32_t status = SystemP_FAILURE;
    
        if(bootHandle != NULL)
        {
            status = Bootloader_parseMultiCoreAppImage(bootHandle, bootImageInfo);
            DebugP_log("[sbl uart uniflash stage1] App_loadSelfcoreImage function : Bootloader_parseMultiCoreAppImage return status %d...\r\n",status);
    
            if(status == SystemP_SUCCESS)
            {
                /* Set clocks for self cluster */
                bootImageInfo->cpuInfo[CSL_CORE_ID_R5FSS0_0].clkHz = Bootloader_socCpuGetClkDefault(CSL_CORE_ID_R5FSS0_0);
    
                /* Reset self cluster, both Core0 and Core 1. Init RAMs and load the app  */
                status = Bootloader_loadSelfCpu(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_R5FSS0_0]));
                //status = Bootloader_setSelfCpuEntryPoint(bootHandle, &(bootImageInfo->cpuInfo[CSL_CORE_ID_R5FSS0_0]));
            }
        }
    
        return status;
    }
    
    int main()
    {
        int32_t status = SystemP_SUCCESS;
        uint32_t done = 0U;
        uint32_t fileSize;
        Bootloader_UniflashResponseHeader respHeader;
        // Sciclient_BoardCfgPrms_t        sciclient_boardcfg;
    
        Bootloader_socWaitForFWBoot();
        status = Bootloader_socOpenFirewalls();
    
        DebugP_assertNoLog(status == SystemP_SUCCESS);
    
        System_init();
        Board_init();
        Drivers_open();
    
        status = Board_driversOpen();
        DebugP_assert(status == SystemP_SUCCESS);
    
        Sciclient_getVersionCheck(1);  
    
        while(!done)
        {
            /* Xmodem Receive */
            status = Bootloader_xmodemReceive(CONFIG_UART0, gUniflashFileBuf - sizeof(Bootloader_UniflashResponseHeader), BOOTLOADER_UNIFLASH_MAX_FILE_SIZE, &fileSize);
            DebugP_log("[sbl uart uniflash stage1] recv the sbl_uart_uniflash stage2 image...\r\n");
            /*
             * The `fileSize` wouldn't be the actual filesize, but (actual filesize + size of the header + padding bytes) added by xmodem.
             * This adds ~1KB. We can't know exactly how many bytes will be padded without checking the file header. But doing that
             * will unnecessary complicate the logic, so since the overhead is as small as ~1KB we could check for file size exceed
             * by checking * this `fileSize` returned by xmodem as well.
            */
            if(fileSize >= BOOTLOADER_UNIFLASH_MAX_FILE_SIZE)
            {
                /* Possible overflow, send error to host side */
                status = SystemP_FAILURE;
    
                respHeader.magicNumber = BOOTLOADER_UNIFLASH_RESP_HEADER_MAGIC_NUMBER;
                respHeader.statusCode = BOOTLOADER_UNIFLASH_STATUSCODE_FLASH_ERROR;
    
                Bootloader_xmodemTransmit(CONFIG_UART0, (uint8_t *)&respHeader, sizeof(Bootloader_UniflashResponseHeader));   
            }
    
            uint8_t sum = 0x00;
            for(int32_t i = 0; i < BOOTLOADER_UNIFLASH_MAX_FILE_SIZE; i++)
            // for(int32_t i = 0; i < 0x19d8; i++)
            {
                sum = sum + gUniflashFileBuf[i];
                gUniflashFileBuf_bk[i] = gUniflashFileBuf[i];
                // DebugP_log("index = %d,gUniflashFileBuf = 0x%x,gUniflashFileBuf_bk = 0x%x ...\r\n", i,gUniflashFileBuf[i], gUniflashFileBuf_bk[i]);
            }
            
            DebugP_log("[sbl uart uniflash stage1] fileSize is %d...\r\n",fileSize);
    
    
            if(status == SystemP_SUCCESS)
            {
                Bootloader_BootImageInfo bootImageInfo;
                Bootloader_Params bootParams;
                Bootloader_Handle bootHandle;
    
                Bootloader_Params_init(&bootParams);
                Bootloader_BootImageInfo_init(&bootImageInfo);
    
                bootParams.memArgsAppImageBaseAddr = (uintptr_t)(gUniflashFileBuf);
    
                bootHandle = Bootloader_open(CONFIG_BOOTLOADER_MEM, &bootParams);
    
                DebugP_log("[sbl uart uniflash stage1] recv the sbl_uart_uniflash stage2 image Done!!!\r\n");
    
                if((bootHandle != NULL) && (SystemP_SUCCESS == status))
                {
                    status = App_loadSelfcoreImage(bootHandle, &bootImageInfo);
                    DebugP_log("[sbl uart uniflash stage1] Loading the sbl_uart_uniflash_stage2 image to WKP core...\r\n");
    
                }
    
                // if(SystemP_SUCCESS == status)  //Has Issue in the A0 Sample
                {
                    DebugP_log("[sbl uart uniflash stage1] Loading the sbl_uart_uniflash_stage2 image Done and Response message for XMODEM...\r\n");
                    respHeader.magicNumber = BOOTLOADER_UNIFLASH_RESP_HEADER_MAGIC_NUMBER;
                    respHeader.statusCode = BOOTLOADER_UNIFLASH_STATUSCODE_SUCCESS;
                    status = Bootloader_xmodemTransmit(CONFIG_UART0, (uint8_t *)&respHeader, sizeof(Bootloader_UniflashResponseHeader));
                }
    
                if(status == SystemP_SUCCESS)
                {
                    Bootloader_close(bootHandle);
                    done = TRUE;
                }
    
            }
        }
    
        /* Call DPL deinit to close the tick timer and disable interrupts before jumping to Stage2*/
        Dpl_deinit();
    
        Bootloader_JumpSelfCpu();
    
        Drivers_close();
        Board_deinit();
        System_deinit();
    
        return 0;
    }
    

    未经修改的 SDK 中的 bootloade.c。

    在 MCU+SDK 中、不运行 DDR 应力测试、而是针对 Linux 测试内核。  

    在 MCU+SDK 中、未修改任何使用 SDK 默认配置的 DDR 配置

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

    您好、Tom、

    并且在 MCU+SDK 中未修改任何使用 SDK 默认配置的 DDR 配置

    我假设您的定制电路板上有定制的 DDR。 如果是、您需要为 DDR 配置正确的 DDR 配置、并将它们集成在 MCU+ SDK 中。

    在运行所有通过的压力测试之前、您是否在 Linux 中集成了正确的 DDR 配置?

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

    您好、Prashant

    我们使用的 DDR 与 EVM 相同。 我认为 SDK 具有 DDR 配置、我们没有修改。

    BR

    Tom

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

    您好、Tom、

    请允许我有一天或两天再次回顾整个回答、看看是否有任何遗漏。

    感谢您的耐心。

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

    您好、Prashant

    请提供任何线索

    BR

    Tom

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

    您好、Tom、

    您当前使用的是 MCU+ SDK v9.1。 您能否尝试一下最新发布的 v9.2?

    https://www.ti.com/tool/download/MCU-PLUS-SDK - AM62A/09.02.00.38

    此致、

    Prashant