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.

Help for error E_unpluggedSysInt on C6678

Other Parts Discussed in Thread: SYSBIOS

I set up CpIntc of sysbios to use the following system to host interrupt mapping:

[C66xx_7] m_sysInt(15) => m_hostInt(25)

[C66xx_0] m_sysInt(8) => m_hostInt(0)

[C66xx_1] m_sysInt(9) => m_hostInt(1)

[C66xx_2] m_sysInt(10) => m_hostInt(8)

[C66xx_3] m_sysInt(11) => m_hostInt(9)

[C66xx_4] m_sysInt(12) => m_hostInt(16)

[C66xx_5] m_sysInt(13) => m_hostInt(17)

[C66xx_6] m_sysInt(14) => m_hostInt(24)

The system interrupts corresponds the completion interrupts of the 2nd EDMA. In cfg script I configured the corresponding hardware interrupts as follows:

CpIntc.mapHostIntToHwiMeta(0, 4 + 0);

CpIntc.mapHostIntToHwiMeta(1, 4 + 8);

CpIntc.mapHostIntToHwiMeta(8, 4 + 2);

CpIntc.mapHostIntToHwiMeta(9, 4 + 3);

CpIntc.mapHostIntToHwiMeta(16, 4 + 4);

CpIntc.mapHostIntToHwiMeta(17, 4 + 5);

CpIntc.mapHostIntToHwiMeta(24, 4 + 6);

CpIntc.mapHostIntToHwiMeta(25, 4 + 7);

If I use Edma transfer completion to trigger the interrupts, I get the following errors:

[C66xx_1] ti.sysbios.family.c66.tci66xx.CpIntc: line 311: E_unpluggedSysInt: System Interrupt# 11 is unplugged

ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.

[C66xx_2] ti.sysbios.family.c66.tci66xx.CpIntc: line 311: E_unpluggedSysInt: System Interrupt# 8 is unplugged

ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.

[C66xx_3] ti.sysbios.family.c66.tci66xx.CpIntc: line 311: E_unpluggedSysInt: System Interrupt# 10 is unplugged

ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.

 [C66xx_5] ti.sysbios.family.c66.tci66xx.CpIntc: line 311: E_unpluggedSysInt: System Interrupt# 12 is unplugged

ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.

[C66xx_6] ti.sysbios.family.c66.tci66xx.CpIntc: line 311: E_unpluggedSysInt: System Interrupt# 13 is unplugged

ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.

[C66xx_7] ti.sysbios.family.c66.tci66xx.CpIntc: line 311: E_unpluggedSysInt: System Interrupt# 14 is unplugged

ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.

[C66xx_2] xdc.runtime.Error.raise: terminating execution

[C66xx_3] xdc.runtime.Error.raise: terminating execution

[C66xx_5] xdc.runtime.Error.raise: terminating execution

[C66xx_7] xdc.runtime.Error.raise: terminating execution

[C66xx_1] xdc.runtime.Error.raise: terminating execution

[C66xx_6] xdc.runtime.Error.raise: terminating execution

 

However, if I use CpIntc_postSysInt() to trigger the interrupt, I do not have these errors and my plugs will get called with no errors.  I am using the following components.

C6678PDK: 1.0.0.14

Sysbios: 6.32.04.49

IPC: 1.23.01.26

XDC: 3.22.01.21

CCS: 5.0.3.00028

 

 

Dongning

  • Dongning,

    Are you familiar with the ROV tools for SYSBIOS in CCS?  This can show you what Hwi's are plugged with what function.

    It seems like your interrupts are plugged for some reason.  Can you attached the .cfg file here?

    Judah

  • Hi Judah,

    Thank you for your prompt reply.
    From ROV, I can see, for example, on on core0:
    ,8,0,TraceEdmaCompletedTask0,,false
    on core1:
    9,1,TraceEdmaCompletedTask0,0x00000001,false

    As the last field corresponds to “enabled”, I was wondering how it could end up like this. At the end of this posting you can find some ROV info as well as my cfg script.

    Dongning

    Hwi module of ROV shows the following in "Basic" tab fore core0:
    ,0x00832070,,,4,ti_sysbios_family_c66_tci66xx_CpIntc_dispatch__F,0x00000000,0x0081f920,102,0x10,0x10
    ,0x00832088,,,12,ti_sysbios_family_c66_tci66xx_CpIntc_dispatch__F,0x00000001,0x008159c0,103,0x1000,0x1000
    ,0x008320a0,,,6,ti_sysbios_family_c66_tci66xx_CpIntc_dispatch__F,0x00000008,0x008159c0,104,0x40,0x40
    ,0x008320b8,,,7,ti_sysbios_family_c66_tci66xx_CpIntc_dispatch__F,0x00000009,0x00000000,105,0x80,0x80
    ,0x008320d0,,,8,ti_sysbios_family_c66_tci66xx_CpIntc_dispatch__F,0x00000010,0x00000000,106,0x100,0x100
    ,0x008320e8,,,9,ti_sysbios_family_c66_tci66xx_CpIntc_dispatch__F,0x00000011,0x00000000,107,0x200,0x200
    ,0x00832100,,,10,ti_sysbios_family_c66_tci66xx_CpIntc_dispatch__F,0x00000018,0x00000000,108,0x400,0x400
    ,0x00832118,,,11,ti_sysbios_family_c66_tci66xx_CpIntc_dispatch__F,0x00000019,0x00000000,109,0x800,0x800
    ,0x00832130,0x00832ab0,,14,ti_sysbios_knl_Clock_doTick__I,0x00000000,0x0081f9e0,64,0x4000,0x4000
    ,0x00822da0,,,5,ti_sdo_ipc_family_c647x_Interrupt_intShmStub__I,0x00822cd8,0x0081f920,91,0x20,0x20


    The following shows the first 21 entries of CpIntc module in ROV for core0:
    ,0,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,,false
    ,1,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000001,false
    ,2,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000002,false
    ,3,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000003,false
    ,4,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000004,false
    ,5,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000005,false
    ,6,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000006,false
    ,7,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000007,false
    ,8,0,TraceEdmaCompletedTask0,,false
    ,9,1,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000009,false
    ,10,8,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x0000000a,false
    ,11,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x0000000b,false
    ,12,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x0000000c,false
    ,13,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x0000000d,false
    ,14,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x0000000e,false
    ,15,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x0000000f,false
    ,16,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000010,false
    ,17,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000011,false
    ,18,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000012,false
    ,19,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000013,false
    ,20,0,ti_sysbios_family_c66_tci66xx_CpIntc_unused__F,0x00000014,false


    --------------------- The following is the cfg script

    switch (Program.platformName) {
        case "ti.sdo.ipc.examples.platforms.evm6670.core0":
            var nameList = ["CORE0", "CORE1", "CORE2", "CORE3"];
            break;
        case "ti.sdo.ipc.examples.platforms.evm6678.core0":
            var nameList = ["CORE0", "CORE1", "CORE2", "CORE3",
                            "CORE4", "CORE5", "CORE6", "CORE7"];
            break;
        case "ti.platforms.evm6678":
            var nameList = ["CORE0", "CORE1", "CORE2", "CORE3",
                            "CORE4", "CORE5", "CORE6", "CORE7"];
            break;
        default:
            throw("Platform " + Program.platformName + " not supported by this example");
            break;
    }

    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var GateMP = xdc.useModule('ti.sdo.ipc.GateMP');
    var Settings = xdc.useModule('ti.csl.Settings');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var Swi = xdc.useModule('ti.sysbios.knl.Swi');
    var Error = xdc.useModule('xdc.runtime.Error');
    var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');

    CpIntc.mapHostIntToHwiMeta(0, 4 + 0);
    CpIntc.mapHostIntToHwiMeta(1, 4 + 8);
    CpIntc.mapHostIntToHwiMeta(8, 4 + 2);
    CpIntc.mapHostIntToHwiMeta(9, 4 + 3);
    CpIntc.mapHostIntToHwiMeta(16, 4 + 4);
    CpIntc.mapHostIntToHwiMeta(17, 4 + 5);
    CpIntc.mapHostIntToHwiMeta(24, 4 + 6);
    CpIntc.mapHostIntToHwiMeta(25, 4 + 7);


    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
    MultiProc.setConfig(null, nameList);
                              
    var System   = xdc.useModule('xdc.runtime.System');
    var SysStd   = xdc.useModule('xdc.runtime.SysStd');
    System.SupportProxy = SysStd;

    var Ipc         = xdc.useModule('ti.sdo.ipc.Ipc');
    var MultiProc   = xdc.useModule('ti.sdo.utils.MultiProc');

    var BIOS        = xdc.useModule('ti.sysbios.BIOS');
    BIOS.heapSize   = 0x8000;
    var Task        = xdc.useModule('ti.sysbios.knl.Task');
    var Semaphore   = xdc.useModule('ti.sysbios.knl.Semaphore');

    var tsk0 = Task.create('&tsk0_func');
    tsk0.instance.name = "tsk0";

    Ipc.procSync = Ipc.ProcSync_ALL;

    var SHAREDMEM           = 0x0C000000;
    var SHAREDMEMSIZE       = 0x00200000;

    var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
    SharedRegion.setEntryMeta(0,
        { base: SHAREDMEM,
          len:  SHAREDMEMSIZE,
          ownerProcId: 0,
          isValid: true,
          name: "DDR2 RAM",
        });

  • Dongning,

    The issue is that you actually haven't plugged your CpIntc interrupts with a ISR handler.  All you have done so far with your .cfg file is you have mapped a Host Interrupt to a Hwi interrupt.  So you need to do something like the following for all of your system interrupts.

    By the way, what system interrupts are you using?  I don't see you mention any system interrupts.

    Here's an example of plugging system interrupt #15 and mapping it to Host Interrupt #8.  Then mapping Host Interrupt #8 to Hwi vector 6.

    CpIntc.sysInts[15].fxn = '&event15Fxn';   // function for system interrupt #15
    CpIntc.sysInts[15].arg = 15;                      // argument for function.  This does not have to be 15.
    CpIntc.sysInts[15].hostInt = 8;                  // This is ths host interrupt
    CpIntc.sysInts[15].enable = true;             // this means enable the system interrupt

    CpIntc.mapHostIntToHwiMeta(8, 4 + 2);   // This maps the host interrupt #8 to Hwi vector 6

    Judah

  • I did plug my CpIntc. I did this in C++ code instead of in script. It is done as follows:

      CpIntc_FuncPtr handler = (CpIntc_FuncPtr) &EdmaCompletedTask;
      CpIntc_Module_startup(0);
      CpIntc_mapSysIntToHostInt(m_intcId, m_sysInt, m_hostInt);
      CpIntc_dispatchPlug(m_sysInt, handler, coreId, true);
      CpIntc_enableHostInt(m_intcId, m_hostInt);
      CpIntc_enableSysInt(m_intcId, m_sysInt);
      printf("m_sysInt(%d) => m_hostInt(%d)\n", m_sysInt, m_hostInt);

    The printf() above generated the log in my original posting. If I do this all in script I do not have my handler called, even if I triger the interrupt by calling CpIntc_postSysInt(). However, if I do it in C++, I have no issueby calling CpIntc_postSysInt(). 

    Dongning

  • Further to my previous reply. The problem seems to have something to do with all cores running simulteneously, each with its own Edma channel. The Emda setup is as folows:


      char gEdmaTraceMsgBuf[sizeof(CEdma3Channel)];

      int coreId = MultiProc_self();
      //Int32 edmaId = 1;
      Int32 edmaId = (coreId >> 2) + 1;
      CSL_Edma3ParamSetup paramSetup;
      int aCnt = sizeof(sTraceMsg);
      int cc = 1 + coreId;
      Edma3ParamSetupCopy(paramSetup, aCnt, 1, 1, aCnt, aCnt, cc);
      m_edma  = new (gEdmaTraceMsgBuf) CEdma3Channel(paramSetup);

      Int16 paramNum = 1 +  coreId;
      Uint8 channelNum = 1 + coreId;
      Int32 regionNum = 0 + coreId;
      //CSL_Edma3Que edma3Que = (CSL_Edma3Que) (coreId & 3);
      CSL_Edma3Que edma3Que = CSL_EDMA3_QUE_1;
      rc = m_edma->Initialize(paramNum, edmaId, channelNum, regionNum, edma3Que);

    The code commented out shows what I have tried. If I let each core run the code alone, I have (almost) no issue to let EDMA completion to triger my interrupt (except that I need to reset the board twice in my test if the core uses Edma instance 2 with edmaId  == 2, i.e., reset, build, load, run, reset, load and run). Edma insance 1 does not seem to have this problem. I did not try Edma instace 0.

    Furthermore, is does not make any difference whether I use GateMP or not for protecting both trigering and handling contexts.

    Dongning

  • Dongning,

    If using the runtime APIs work for you then that's a positive, however, using the script functions properly should work too.  I don't know what else to suggest except look at the cdoc documentation and the examples I've posted here.

    Why are you calling CpIntc_Module_startup(0)?  This is function that should automatically get called by the xdc startup code.  You should not be calling this function.

    As far as the issue with the EDMA, I am unfamiliar with specific EDMA issues.  It might be wise to start a different thread on your EDMA issue so not to mix the two different problems?

    Judah

  • Hi Judah,

    thank you for your reply.

    I have been having E_unpluggedSysInt in my various tests. The early failure may partly due to some bug in my test routines, but even after the bug fix, I still had this problem in my tests until just a short while ago. Now I found  cases when this problem happens and when it does not happen. This together with some other problems was described in my new posting given below:

    Problems/Questions for Interrupt triggered by EDMA completion on C6678: http://e2e.ti.com/support/embedded/f/355/p/139674/503114.aspx#503114

     

    Dongning

  • I'll go ahead and marked this thread as Answered, since there is a new thread pending.