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.

TDA4VE-Q1: Greely_Smart TDA4 SCI Issue

Part Number: TDA4VE-Q1

Tool/software:

Hello TI experts,

We meet some issue happed when The A72 core booting time,when we remove some logs in bootApp which intigrated in autosar OS.The A72 core runs with issues when request the SCI resources ,and we debug the A72 core deeply and we found that 

the A72 core was stucked in here 

Value J7Mailbox_MessagesAvailable(
        J7MailboxDev * Dev,
        Value Channel)
{
    Assert(Dev != NULL);
    Assert(Channel < Dev->ValidQueues);
    
    volatile uint32_t * Status =
        (void *)(Dev->StatusKernAddr + Channel * MBOX_RGN_SIZE);
    
    
    console_printf("J7Mailbox_MessagesAvailable Channel %d address %x status %x *status %x\r\n",Channel,Dev->StatusKernAddr,Status,*Status);

    return ExtractField(*Status, MBOX_DBG_STS_MSG_CNT);
}

after we add some logs(as the logs shows) in the function we found that the reson why a72 core stuck here is that when the sci request was send to R5,

after the R5 reply the request the A72 core will read the 3240b000 which is a PROXY_0_STATUS Register I think,

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000001

to get the cur_cnt value to know that if the R5 have successfully replay the message.

but when the issue time the value of this reg is always 0x40000000.

We want to know where the R5 write the reg and why it can not be changes when R5 replay to A72 core.

  • Hello,

    May i know which SDK you are using? which HLOS A72 is running ?

    COuld you share us the entire log?

    Regards

    Tarun Mukesh

  • Hello Tarun,

    We are using greenhills for A72 core,and for the MCU R5 we using AUTOSAR os,and for the SCI server it works with the BL31,the Issue was found in GHS kernel booting.

  • Hello,

    If AUTOSAR OS is running on MCU1_0 and SCI Server is running correctly as you confirm. what could be reason ? As far as i know TI doesn't have any GHS SDK to support.Without complete logs, i may not be very helpful here.

    Regards

    Tarun MUkesh

  • Hello Tarun,

    this is in the very beginning of the GHS kernel boots,here is only Two log prints from BL31

    NOTICE:  BL31: Built : 09:28:03, May  1 2024

    ERROR:   GTC_CNTFID0 is 0! Assuming 200000000 Hz. Fix Bootloader

    ERROR:   GTC_CNTFID0 is 0! Assuming 200000000 Hz. Fix Bootloader

    and when the issue occures I open the CCS to connect the A72 core and found that the code was stuck in the 

    and I go depth into the source code and I found that the failed was send by this function 

    static Error J7Sci_IssueRequestSynchronous(
            J7SciDev * Dev,
            J7SciRequest Request,
            J7SciMessage * ToSend,
            J7SciMessage * ToReceive)
    {
        J7SciMessage Dummy = { 0 };
        /* According to some definitions ti_sci.c in the TI linux repo the
         * RX timeout should be 1000msec to 10000msec depending on the target.
         */
        const Value TimeoutMax = RX_TIMEOUT_1MSEC * 1000;
        Error TheError = OperationTimedOut;
    
        Assert(Dev != NULL);
        Assert(ToSend != NULL);
    
        if (ToReceive == NULL)
            ToReceive = &Dummy;
        
        *&ToSend->msg.data.header = (struct SciHeader) {
            .type = Request.MessageType,
            .host = Dev->HostId,
            .seq = (Dev->MsgSequenceNo) % 255,
            .flags = Request.AdditionalFlags | (
                    Request.PleaseAck? FieldValue(SCI_HDR_FLAG_ACK_ON_PROC, 1) : 0),
        };
    
        J7Mailbox_SendAsync(&Dev->MailboxDev, Dev->TxChanNo,
                (Address)&ToSend->msg.raw[0], sizeof(ToSend->msg.raw));
    
        Value Try = TimeoutMax;
        while (Try && J7Mailbox_MessagesAvailable(
                &Dev->MailboxDev, Dev->RxChanNo) == 0) {
            usDelay(10000);
            Try--;
        }
    
        if (Try)
            TheError = Success;
    
        if (TheError == Success) {
            J7Mailbox_DequeueMessage(&Dev->MailboxDev, Dev->RxChanNo,
                    (Address)&ToReceive->msg.raw[0], sizeof(ToReceive->msg.raw));
        
            /* We should have gotten back an ACK with the same sequence number */
            Assert(ToReceive->msg.data.header.seq == ToSend->msg.data.header.seq);
        
            Dev->MsgSequenceNo += 1;
        }
    
        return TheError;
    }

    which call this function and check if there is replay send from MCU R5

    Value J7Mailbox_MessagesAvailable(
            J7MailboxDev * Dev,
            Value Channel)
    {
        Assert(Dev != NULL);
        Assert(Channel < Dev->ValidQueues);
        
        volatile uint32_t * Status =
            (void *)(Dev->StatusKernAddr + Channel * MBOX_RGN_SIZE);
        return ExtractField(*Status, MBOX_DBG_STS_MSG_CNT);
    }

  • Hello,

    Is this an sci client call J7Sci_IssueRequestSynchronous ? May i know how did you confirm SCI server running on MCU1_0?

    Regards

    Tarun Mukesh

  • Hello Tarun,

    I think the SCI server was running successfully,because the before GHS kernel,there is a bl31 running,the sci client from the bl31 was running sucessfully.

    and 

    we add the g_dump_time_SCI array to save the times which the R5 core received ISR which send by the A72 core for Array index 0,and the task which haddle the SCI message times for array index 1,and the replay function for array index 2

    and we add logs in the source bsp code in GHS kenel to count the send and success recv count to see if the message was missed in some where.

    void J7Mailbox_SendAsync(
           J7MailboxDev * Dev,
           Value Channel,
           Address Data,
           Value Len)
    {
        Assert(Dev != NULL);
        Assert(Data != 0);
        Assert(Channel < Dev->ValidQueues);
        static uint32_t send_count=0;
        if (Len > Dev->MaxMessageSize)
            Len = Dev->MaxMessageSize;
        
        console_printf("success send %d ",send_count++);
    
        /* This must be an TX Queue with some message slots available */
        Assert(J7Mailbox_IsTransmitChannel(Dev, Channel));
        Assert(J7Mailbox_MessagesAvailable(Dev, Channel) > 0);

    Value J7Mailbox_MessagesAvailable(
            J7MailboxDev * Dev,
            Value Channel)
    {
        Assert(Dev != NULL);
        Assert(Channel < Dev->ValidQueues);
        static uint32_t count_success=0;
        volatile uint32_t * Status =
            (volatile uint32_t*)(Dev->StatusKernAddr + Channel * MBOX_RGN_SIZE);
            
        if  (ExtractField(*Status, MBOX_DBG_STS_MSG_CNT)!=0)
        {
            console_printf("success recv %d ",count_success++);
        }
    
        return ExtractField(*Status, MBOX_DBG_STS_MSG_CNT);
    }

    and after the issue happend the log as bellows:

    it seems the ghs kernel can not read the mail box cnt after the R5 replay the A72 core

    Value J7Mailbox_MessagesAvailable(
            J7MailboxDev * Dev,
            Value Channel)
    {
        Assert(Dev != NULL);
        Assert(Channel < Dev->ValidQueues);
        
        volatile uint32_t * Status =
            (void *)(Dev->StatusKernAddr + Channel * MBOX_RGN_SIZE);
        
        
        console_printf("J7Mailbox_MessagesAvailable Channel %d address %x status %x *status %x\r\n",Channel,Dev->StatusKernAddr,Status,*Status);
    
        return ExtractField(*Status, MBOX_DBG_STS_MSG_CNT);
    }

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    J7Mailbox_MessagesAvailable Channel 11 address 32400000 status 3240b000 *status 40000000

    is there any Precautions when we access the register 3240b000 mailbox status register ?

  • Hello,

    I think the SCI server was running successfully,because the before GHS kernel,there is a bl31 running,the sci client from the bl31 was running sucessfully.

    Can you share us the ATF logs ? WHere it is running fine. Please share me your boot flow as well.

    If the SCI server is running fine on AUTOSAR MCU R5F , then instead of running GHS can you run the linux which TI provided and see everything is fine ?

    since we don't have GHS related API's at our end , we cannot infer any what can be issue. TI doesn't provide any GHS SDK to look into. Mailbox registers can be accessed while using IPC.

    Regards

  • hello Tarun,

    the atf logs already in the tikets,we only have the bl31 do not have optee,so this already all logs from the atf

    NOTICE:  BL31: Built : 09:28:03, May  1 2024

    ERROR:   GTC_CNTFID0 is 0! Assuming 200000000 Hz. Fix Bootloader

    ERROR:   GTC_CNTFID0 is 0! Assuming 200000000 Hz. Fix Bootloader

    Can you share us the ATF logs ? WHere it is running fine. Please share me your boot flow as well.
    since we don't have GHS related API's at our end , we cannot infer any what can be issue. TI doesn't provide any GHS SDK to look into. Mailbox registers can be accessed while using IPC.

    OK fine closed tikets