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.

TDA4VM: How to use OSPI to boot RTOS and QNX

Part Number: TDA4VM

Hello TI Teams:

        I tried to use OSPI to decrease the startup time , 

        I used TI's demo("sbl_cust_img" and “can_boot_app_mcu_rtos”) and i tried to modified the demo(can_boot_app_mcu_rtos), so that it could jump to my APP and start the QNX.

        The startup process is:(sbl_cust_img -> can_boot_app_mcu_rtos -> start My APP & QNX)

       a. SBL_CUST_IMG: to start MCU1_0/MCU1_1

       b. CAN_BOOT_APP_MCU_RTOS: I modified it , I add " status = OSPIBootImageLate(&k3xx_evmEntry, OSPI_OFFSET_APP);", to read my App file;

static int32_t OSPIBootStageImage(sblEntryPoint_t *pEntry, uint32_t address)
{
    int32_t status = E_FAIL;

    if ((NULL != address) && (NULL != pEntry))
    {
        if (address != MAIN_DOMAIN_HLOS)
        {
#    if !defined(MPU1_HLOS_BOOT_ONLY_ENABLED)
            /* non-HLOS image */
        //    status = OSPIBootImageLate(&k3xx_evmEntry, address);
        status = E_PASS;
#    else
            status = E_PASS;
#    endif
        }
#    if defined(MPU1_HLOS_BOOT_ENABLED) || defined(MPU1_HLOS_BOOT_ONLY_ENABLED)
        else
        {
              //   status = OSPIBootImageLate(&k3xx_evmEntry, OSPI_OFFSET_APP);
		//		AppUtils_Printf(MSG_NORMAL,
               //                     "START H97 APP \n");

            /* Load the HLOS appimages */
            status = OSPIBootImageLate(&k3xx_evmEntry, OSPI_OFFSET_A72IMG1);
            if (status != E_PASS)
            {
                AppUtils_Printf(MSG_NORMAL,
                                "Error parsing A72 appimage #1 for HLOS boot\n");
            }
            else
            {
                status = OSPIBootImageLate(&k3xx_evmEntry, OSPI_OFFSET_A72IMG2);
                if (status != E_PASS)
                {
                    AppUtils_Printf(MSG_NORMAL,
                                    "Error parsing A72 appimage #2 for HLOS boot\n");
                }
		else
		{
		#if 1
                status = OSPIBootImageLate(&k3xx_evmEntry, OSPI_OFFSET_APP);
		  if(status == E_PASS)
		  {
				//AppUtils_Printf(MSG_NORMAL,"START H97 APP \n");
				//AppUtils_Printf(MSG_NORMAL,"Entry point = %x\n",k3xx_evmEntry.CpuEntryPoint[4]);
				 Start_App = 1;
		  }
		  else
		 {
				AppUtils_Printf(MSG_NORMAL,"START H97 APP FAILED\n");
		  }
		#endif		
		 
		}
#        if defined(LINUX_OS)
                else
                {
                    status = OSPIBootImageLate(&k3xx_evmEntry, OSPI_OFFSET_A72IMG3);
                    if (status != E_PASS)
                        AppUtils_Printf(MSG_NORMAL,
                                        "Error parsing A72 appimage #3 for HLOS boot\n");
                }
#        endif
            }

            if (status == E_PASS)
            {
                /* Set the A72 entry point at the ATF address */
                pEntry->CpuEntryPoint[MPU1_CPU0_ID] = ATF_START_RAM_ADDR;
            }
        } /* if (address == MAIN_DOMAIN_HLOS) */
#    endif /* #if defined(MPU1_HLOS_BOOT_ENABLED)*/
    } /* if ((NULL != address) && (NULL != pEntry)) */

    return status;
}

 and then call the  SBL_SlaveCoreBoot(MCU1_CPU0_ID, 0, &k3xx_evmEntry, SBL_REQUEST_CORE); to jump to my APP.

It could jump to my APP correctly and start the QNX; But when i remove the "Task_sleep(4000)", it will lead QNX start failed, the error is :ti_sci_recv_message, unable to receive message

NOTICE:  BL31: v2.4(release):07.03.00.005-dirty
NOTICE:  BL31: Built : 00:15:40, Apr 10 2021
ERROR:   GTC_CNTFID0 is 0! Assuming 200000000 Hz. Fix Bootloader
MMU: 16-bit ASID 44-bit PA TCR_EL1=b5183519
cpu0: MPIDR=80000000
cpu0: MIDR=411fd080 Cortex-A72 r1p0
cpu0: CWG=4 ERG=4 Dminline=4 Iminline=4 PIPT
cpu0: CLIDR=a200023 LoUU=1 LoC=2 LoUIS=1
cpu0: L1 Icache 48K linesz=64 set/way=256/3
cpu0: L1 Dcache 32K linesz=64 set/way=256/2
cpu0: L2 Unified 1024K linesz=64 set/way=1024/16
ti_sci_recv_message, unable to receive message
init_gpu: Set GPU0 device state failed!
ti_sci_recv_message, unable to receive message
init_gpu: Set GPU1 device state failed!
Display set to R5
ti_sci_recv_message, unable to receive message
init_ospi: Set OSPI0 RCLK clock parent failed!
ti_sci_recv_message, unable to receive message
init_usb_host: HOST 0, failed! 69
ti_sci_recv_message, unable to receive message
init_usb_host: HOST 1, failed! 69
Loading IFS...decompressing...done
ERROR:   Timeout waiting for thread SP_RESPONSE to fill
ERROR:   Thread SP_RESPONSE verification failed (-60)
ERROR:   Message receive failed (-60)
ERROR:   Failed to get response (-60)
ERROR:   Transfer send failed (-60)
ERROR:   Request to start core failed: -60

So my questions:

1. Why will it start QNX failed when i remove the "Task_sleep(4000)"? Is it because mcu jump to the other APP and it leads the sci server closed?

2. Is there has the other way to help us solve this problem? we want the bootloader could jump to my App and start QNX

  • Dear TI team:

    About question1; how to avoid this problem?

    Please give me an answer as soon as possible. Your prompt reply would be appreciated.
    Best regards,

  • Hi,

    The A72 logs showing SCI failures are as you indicated, likely due to the sci server not running on the MCU1_0, at the time the A72 sends the SCI message to MCU1_0.  The A72 logs show the QNX BSP is attempting to enable the required clocks/states for GPU and OSPI, but not receiving expected response.

    The SCI Server must be running on the MCU R5 in order to for the A72 to send the SCI commands. Either A72 SCI commands must come later in boot sequence, or MCU R5 sciserver must be available earlier in boot sequence.   

    An additional test would be to remove the Task_sleep(4000) from the MCU R5, and add the same delay on the A72 BSP prior to the SCI commands being sent, to ensure the boot works.

    Regards,

    kb