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: SPI: trying to access mcu domain SPI interrupt from main domain

Part Number: TDA4VM


Hi all,

Am trying to access mcu_mcspi0 from main domain using interrupt method  am trying to access the  from interrupt router. Can any one suggest me how to configure the router in the application.

Am using TI SPI example loopback application in  baremetal. Its works fine in polling method. When i  was trying with interrupt method; loopback is failing

 I have changed the rmIrqReq.dst_host_irq  value to different locations like from 255 to 412, but still interrupt is not configure.

Am adding the code which is present in McspiApp_Startup.c with the changed i made for configuring the interrupt

if (cfgPtr->hwUnitCfg[idx].enabledmaMode == FALSE)
{
rmIrqReq.valid_params = TISCI_MSG_VALUE_RM_DST_ID_VALID;
rmIrqReq.valid_params |= TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID;
rmIrqReq.src_id = TISCI_DEV_MCU_MCSPI0;
rmIrqReq.global_event = 0U;
rmIrqReq.src_index = 0U;
rmIrqReq.dst_id = TISCI_DEV_R5FSS0_CORE1;//tried to give the interuput router address//TISCI_DEV_R5FSS0_INTROUTER0//
rmIrqReq.dst_host_irq = //258;//APP_SPI_MCU_0_INT;//Trying to add differnt interupt lcation here
rmIrqReq.ia_id = 0U;
rmIrqReq.vint = 0U;
rmIrqReq.vint_status_bit_index = 0U;
rmIrqReq.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST;
retVal = Sciclient_rmIrqSet(
&rmIrqReq, &rmIrqResp, APP_SCICLIENT_TIMEOUT);

if(CSL_PASS != retVal)
{
AppUtils_Printf(APP_UTILS_PRINT_MSG_NORMAL,
"Error in SciClient Interrupt Params Configuration!!!\n");
}
Osal_RegisterInterrupt_initParams(&intrPrms);
#if (STD_ON == SPI_UNIT_MCU_MCSPI0_ACTIVE)
#if (SPI_ISR_TYPE == SPI_ISR_CAT1 || SPI_ISR_TYPE == SPI_ISR_VOID)
intrPrms.corepacConfig.arg = (uintptr_t)Spi_IrqUnitMcuMcspi0TxRx;
#endif
#endif
intrPrms.corepacConfig.isrRoutine = &SpiApp_SpiXIsr;
intrPrms.corepacConfig.priority = 1U;
intrPrms.corepacConfig.corepacEventNum = 0U; /* NOT USED ? */
intrPrms.corepacConfig.intVecNum =//258//APP_SPI_MCU_0_INT;

osalRetVal = Osal_RegisterInterrupt(&intrPrms, &hwiHandle);

my doubt is

1.how I can access mcu_mcspi0 from main domain using the interrupt method

2.Am trying to use interrupt router to get the interrupt from mcu domain. is there any configuration needed for the interrupt router? if yes is there any example provided by ti ,so that I can refer?

3.what is the correct number for the mcu_mcspi0 interrupt location? Or i can choose any location configured from interrupt router(255 to412)

4.How i can configure the interrupt router for my application

Thanks,

  • Hi ,

    Are you still facing this issue? 

    One possible solution is by using Sciclient_rmIrqSetRaw API, as shown below. Here, i am configuring R5F interrupt router to connect input 135 to one of the free output, for example 128, which generates irq number 384 on R5F.  

     

    struct tisci_msg_rm_irq_set_req rmIrqReq;
    struct tisci_msg_rm_irq_set_resp rmIrqResp;

    memset(&rmIrqReq, 0x0, sizeof(rmIrqReq));
    memset(&rmIrqResp, 0x0, sizeof(rmIrqResp));

    rmIrqReq.valid_params = 0U;
    rmIrqReq.global_event = 0U;
    rmIrqReq.src_id = 0U;
    rmIrqReq.src_index = 0U;
    rmIrqReq.dst_id = 0U;
    rmIrqReq.dst_host_irq = 0U;
    rmIrqReq.ia_id = 0U;
    rmIrqReq.vint = 0U;
    rmIrqReq.vint_status_bit_index = 0U;
    rmIrqReq.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST;

    rmIrqReq.secondary_host = TISCI_MSG_VALUE_RM_UNUSED_SECONDARY_HOST;

    rmIrqReq.src_id = 134;
    rmIrqReq.src_index = 136; // J721E_DEV_MCU_MCSPI0

    /* Set the destination based on the core */
    rmIrqReq.dst_id = 134;
    rmIrqReq.dst_host_irq = 128;

    /* Set the destination interrupt */
    rmIrqReq.valid_params |= TISCI_MSG_VALUE_RM_DST_ID_VALID;
    rmIrqReq.valid_params |= TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID;

    status = Sciclient_rmIrqSetRaw(
        (const struct tisci_msg_rm_irq_set_req *)&rmIrqReq,
        &rmIrqResp,
        SCICLIENT_SERVICE_WAIT_FOREVER);

    then you could use irq number 384 to get the SPI interrupt. 

    Regards,

    Brijesh