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.

[参考译文] AM6442:AM64x-EVM R5FSS0 内核在 OSPI 多分区引导上无法引导

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1662542/am6442-am6442-evm-r5fss0-cores-fail-boot-on-ospi-multi-partitioned-boot

器件型号: AM6442

您好、我当前遇到了 ospi 多分区引导问题。 我的应用程序正在使用所有内核、这些是我要刷写的具有正确偏移量的文件:
r5fss0-0.mcelf.hs_fs  
r5fss0-1.mcelf.hs_fs
r5fss1-0.mcelf.hs_fs
r5fss1-1.mcelf.hs_fs
m4.mcelf.hs_fs
a53ss0-0.mcelf.hs_fs
a53ss0-1.mcelf.hs_fs
 

我的应用中的所有内核都在引导期间进行自初始化。 我修改了示例“sbl_opsi_multi_partition“以包含 a53ss0-1、根据我的内核应用程序的大小设置正确的偏移、并更改了关于如何加载和引导 R5FSS0-0 内核的代码。

原始设置采用以下方式进行设置:  

        if(SystemP_SUCCESS == status)
        {
            status = App_bootLoadSelfCpu( CONFIG_BOOTLOADER_FLASH_R5FSS0_0, CSL_CORE_ID_R5FSS0_0 );
        }
        if(SystemP_SUCCESS == status)
        {
            status = App_bootLoadSelfCpu( CONFIG_BOOTLOADER_FLASH_R5FSS0_1, CSL_CORE_ID_R5FSS0_1 );
        }



我将其更改为:

 
      if(SystemP_SUCCESS == status)
        {
            status = App_bootCpu( CONFIG_BOOTLOADER_FLASH_R5FSS0_0, CSL_CORE_ID_R5FSS0_0 );
        }
        if(SystemP_SUCCESS == status)
        {
            status = App_bootCpu( CONFIG_BOOTLOADER_FLASH_R5FSS0_1, CSL_CORE_ID_R5FSS0_1 );
        }

原因是我需要运行这些内核上的应用程序、并且 CPU.Cpu() 函数负责加载和运行 App_Boot。 虽然,该函数是为那些“不在自 CPU 集群“而被调用的原始函数,
App_bootLoadSelfCpu (),是为“加载但不在自 CPU 集群中运行 CPU,即 R5FSS0-0“而设计的。  

因此、我有以下问题:
1.错误是由于在 R5FSS0 内核上运行错误的函数而造成的,但是为什么 App_bootCpu () 不能与它们一起工作?  
2.在这种情况下,“自 CPU 集群,即 R5FSS0-0“的含义是什么?
3.如何正确加载 R5FSS0 内核、然后引导? 或者 App_bootLoadSelfCpu () 是否已经处理了这个问题?


App_bootLoadSelfCpu ():
/* load but DONT run CPU in self CPU cluster, i.e R5FSS0-0 */
int32_t App_bootLoadSelfCpu(uint32_t bootDrvInstanceId, uint32_t cpuId)
{
    int32_t status = SystemP_FAILURE;
    Bootloader_BootImageInfo bootImageInfo;
    Bootloader_Handle bootHandle;
    Bootloader_Params bootParams;
    Bootloader_Config *bootConfig;

    Bootloader_Params_init(&bootParams);
    Bootloader_BootImageInfo_init(&bootImageInfo);

    bootHandle = Bootloader_open(bootDrvInstanceId, &bootParams);
    bootConfig = (Bootloader_Config *)bootHandle;
    bootConfig->scratchMemPtr = gAppimage;
    if(bootHandle != NULL)
    {
        status = Bootloader_parseMultiCoreAppImage(bootHandle, &bootImageInfo);
        if(status == SystemP_SUCCESS)
        {
            bootImageInfo.cpuInfo[cpuId].clkHz = Bootloader_socCpuGetClkDefault(cpuId);
            status = Bootloader_loadSelfCpu( bootHandle, &bootImageInfo.cpuInfo[cpuId], FALSE);
        }
        Bootloader_close(bootHandle);
    }
    return status;
}


App_bootCpu ():
/* boot, i.e load and run CPUs not in self CPU cluster */
int32_t App_bootCpu(uint32_t bootDrvInstanceId, uint32_t cpuId)
{
    int32_t status = SystemP_FAILURE;
    Bootloader_BootImageInfo bootImageInfo;
    Bootloader_Params bootParams;
    Bootloader_Handle bootHandle;
    Bootloader_Config *bootConfig;

    Bootloader_Params_init(&bootParams);
    Bootloader_BootImageInfo_init(&bootImageInfo);

    bootHandle = Bootloader_open(bootDrvInstanceId, &bootParams);
    bootConfig = (Bootloader_Config *)bootHandle;
    bootConfig->scratchMemPtr = gAppimage;

    if(bootHandle != NULL)
    {
        status = Bootloader_parseMultiCoreAppImage(bootHandle, &bootImageInfo);
        if(status == SystemP_SUCCESS)
        {
            bootImageInfo.cpuInfo[cpuId].clkHz = Bootloader_socCpuGetClkDefault(cpuId);
            status = Bootloader_bootCpu(bootHandle, &bootImageInfo.cpuInfo[cpuId]);
        }
        Bootloader_close(bootHandle);
    }
    return status;
}
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    当我继续 在 R5FSS0 内核上使用 App_bootLoadSelfCpu () 时、它可以暂停、但随后在“Bootloader_soccpuResetReleaseSelf();“处冻结。 如何解决这种冻结问题? 如有任何帮助、将不胜感激。 下面是代码片段:

    ...
            if(status == SystemP_SUCCESS)
            {
                status = App_bootLoadSelfCpu( CONFIG_BOOTLOADER_FLASH_R5FSS0_0, CSL_CORE_ID_R5FSS0_0 );
                DebugP_log("Load R5F0_0 core and release!!\r\n");
            }
    
            if(status == SystemP_SUCCESS) //WHY MUST DO THIS FOR R5F0_0 cores??? TI TICKET SPEED RUN
            {
                status = App_bootLoadSelfCpu( CONFIG_BOOTLOADER_FLASH_R5FSS0_1, CSL_CORE_ID_R5FSS0_1 );
                DebugP_log("Load R5F0_1 core and release!!\r\n");
            }  
    
    
            if(SystemP_SUCCESS == status)
            {
                /* Enable Dac mode */
                status = OSPI_enableDacMode(gOspiHandle[CONFIG_OSPI0]);
            }
    
            bool check = SystemP_SUCCESS == status;
            DebugP_log("check code is %i \r\n ", check);
            DebugP_log("SystemP_SUCCESS code is %u\r\n", (uint32_t)SystemP_SUCCESS);
            DebugP_log("status code is %u\r\n", (uint32_t)status);
    
            if(SystemP_SUCCESS == status)
            {
                /* Reset self cluster and run both the CPUs */
                status = Bootloader_socCpuResetReleaseSelf();
                DebugP_log("Release self CPU from reset. Status code is" PRIu32 "\r\n", (uint32_t)status);
            }
        }
        DebugP_log("SystemP_SUCCESS code is %u\r\n", (uint32_t)SystemP_SUCCESS);
        DebugP_log("status code is %u\r\n", (uint32_t)status);
        if(status != SystemP_SUCCESS )
        {
            DebugP_log("Some tests have failed!!\r\n");
        } else {
            DebugP_log("All tests passed!!\r\n");
        }

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

    您好、

    本文中“自 CPU 集群、即 R5FSS0-0“的含义是什么?

    您的 SBL 程序在 R5F0-0 内核(R5FSS0 集群的一部分)上运行、这就是它被称为自 CPU 集群 的原因、App_bootCpu 调用 Bootloader_runCpu API、该 API 会复位特定的 CPU 以开始运行应用程序、您不应在 SBL 执行完成之前复位 R5FS0-0。 在默认的 SBL 流程中、您可以看到 在末尾调用了 Bootloader_socCpuResetReleaseSelf、以按该顺序运行 R5F0-1 和 R5F0-0、因此我仍然对为什么需要更改默认引导序列感到有点困惑。

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

    您好、谢谢您的澄清。 我不清楚 Bootloader_soccpuResetReleaseSelfSelf() 将负责允许 R5F0-1和 R5F0-0 上的应用程序在加载 App_bootLoadSelfCpu() 后运行。  

    当前我将其改回并运行到一个新问题中、其中 调用了 Bootloader_soccpuResetReleaseSelf()、但没有返回任何内容、并且在该阶段冻结。  

    对于如何解决此问题、您是否有任何指导?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    目前、我更改了它、并遇到了一个新问题、 该问题中调用了 Bootloader_soccpuResetReleaseSelf()、但没有返回任何内容、并且在该阶段会冻结。  [/报价]

    bootloader_socCpuResetReleaseSelf 复位 R5F0-0、我认为它不会卡在任何地方、很可能 R5F0-0 此时已切换到运行应用程序。 如何验证是否存在问题或冻结?

    您能否共享引导日志?

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

    如何验证是否存在问题或冻结?

    我在 SBL 代码中添加了在引导期间从不到达的调试日志消息。 代码如下:

        status = Board_driversOpen();
        DebugP_assert(status == SystemP_SUCCESS);
    
        status = Sciclient_getVersionCheck(1);
        if(SystemP_SUCCESS == status)
        {
            uint32_t coreVariant = Bootloader_socGetCoreVariant();
            if((coreVariant == BOOTLOADER_DEVICE_VARIANT_QUAD_CORE) || (coreVariant == BOOTLOADER_DEVICE_VARIANT_DUAL_CORE))
            {
                if(status == SystemP_SUCCESS)
                {
                    status = App_bootCpu( CONFIG_BOOTLOADER_FLASH_R5FSS1_0, CSL_CORE_ID_R5FSS1_0 );
                    DebugP_log("Load R5F1_0 core and release!!\r\n");
                }
                if((Bootloader_socIsR5FSSDual(BOOTLOADER_R5FSS1) == TRUE) && (status == SystemP_SUCCESS))
                {
                    status = App_bootCpu( CONFIG_BOOTLOADER_FLASH_R5FSS1_1, CSL_CORE_ID_R5FSS1_1 );
                    DebugP_log("Load R5F1_1 core and release!!\r\n");
                }     
            }
    
            /* Do not run M4 when MCU domain is reset isolated */
            if (!Bootloader_socIsMCUResetIsoEnabled())
            {
                if(SystemP_SUCCESS == status)
                {
                    status = App_bootCpu( CONFIG_BOOTLOADER_FLASH_M4FSS0_0, CSL_CORE_ID_M4FSS0_0 );
                    DebugP_log("Load M4F core and release!!\r\n");
                }
            }
            
            if(SystemP_SUCCESS == status)
            {
                status = App_bootCpu( CONFIG_BOOTLOADER_FLASH_A53SS0_0, CSL_CORE_ID_A53SS0_0 );
                //DebugP_log("Load A53SS0_0 core and release!!\r\n");
            }
    
            if(SystemP_SUCCESS == status)
            {
                status = App_bootCpu( CONFIG_BOOTLOADER_FLASH_A53SS0_1, CSL_CORE_ID_A53SS0_1 );
               // DebugP_log("Load A53SS0_1 core and release!!\r\n");
            }
    
            if(status == SystemP_SUCCESS)
            {   // 
                status = App_bootLoadSelfCpu( CONFIG_BOOTLOADER_FLASH_R5FSS0_0, CSL_CORE_ID_R5FSS0_0 );
               // DebugP_log("Load R5F0_0 core and release!!\r\n");
            }
    
            if(status == SystemP_SUCCESS) 
            {   // 
                status = App_bootLoadSelfCpu( CONFIG_BOOTLOADER_FLASH_R5FSS0_1, CSL_CORE_ID_R5FSS0_1 );
               // DebugP_log("Load R5F0_1 core and release!!\r\n");
            }  
    
    
            if(SystemP_SUCCESS == status)
            {
                /* Enable Dac mode */
                status = OSPI_enableDacMode(gOspiHandle[CONFIG_OSPI0]);
            }
    
            bool check = SystemP_SUCCESS == status;
            DebugP_log("Status code is %i (true if 1) \r\n ", check);
            DebugP_log("SystemP_SUCCESS code is %u\r\n", (uint32_t)SystemP_SUCCESS);
            DebugP_log("status code is %u\r\n", (uint32_t)status);
    
            if(SystemP_SUCCESS == status)
            {
                /* Reset self cluster and run both the CPUs */
                status = Bootloader_socCpuResetReleaseSelf();
                ~~~BELOW MESSAGE IS NEVER PRITNED~~~
                DebugP_log("Release R5FSS0_0/1 CPU from reset. Status code is" PRIu32 "\r\n", (uint32_t)status);
            }
        }
        ~~~BELOW MESSAGES ARE NEVER PRINTED~~~
        DebugP_log("SystemP_SUCCESS code is %u\r\n", (uint32_t)SystemP_SUCCESS);
        DebugP_log("status code is %u\r\n", (uint32_t)status);
        if(status != SystemP_SUCCESS )
        {
            DebugP_log("Some tests have failed!!\r\n");
        } else {
            DebugP_log("All tests passed!!\r\n");
        }

    您能否共享引导日志?

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

    您好、

    正如我在前面的响应中提到的、 Bootloader_socCpuResetReleaseSelf 会将 R5F0-0 复位、这意味着您在这一点之后放置的任何指令或调试消息都不会执行、因此这是预期行为。

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

    如果是这种情况、为什么在原始示例中它们会在末尾(在 Bootloader_soccpuResetReleaseSelf 之后):

    if(status != SystemP_SUCCESS )
        {
            DebugP_log("Some tests have failed!!\r\n");
        }


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

    这是 IF 条件导致的: https://github.com/TexasInstruments/mcupsdk-core/blob/next/examples/drivers/boot/sbl_ospi_multi_partition/am64x-evm/r5fss0-0_nortos/main.c#L225

    如果启动应用程序时出现问题、则状态不会返回 SystemP_Success 并且 从不执行 Bootloader_soccpuResetReleaseSelf、因此执行将到达此打印语句。

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

    你好、谢谢。 这一澄清很有帮助。