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.

UART interrupt

Other Parts Discussed in Thread: SYSBIOS, TMS320C6678

I am using the C6678.  I want to use SYSBIOS to set up a HWI with the UART receive event, which in the Data Manual says has an event # 149.  When I try to use this event Id in the SYSBios, I get the error "eventId (149) must be less than 128".   What am I doing wrong? 

Mike

  • Mike,

    After offering you some apologies and comments, we will get this thread moved to the BIOS forum for what may be a SYS/BIOS detail. If you get moved back here later, I will stay with you and help where I can. It has been a long day, so please bear with my attitude, below, which is not directed toward you.

    I do not not know where you are in the world or how old you are, but in the 1980's in the USA there was a sitcom on TV called Newhart. Three characters in the show were always introduced by "Hi, I'm Larry. This is my brother Darryl, and this is my other brother Darryl." This is relevant to your situation.

    Inside each C66x CorePac is the C66x DSP core, plus local L1/L2 memories, plus some special control and logic modules. The C66x DSP core can only accept 16 interrupts, and 4 of those are hard-coded for certain functions, leave only 12 user-controlled interrupt inputs. There are many more than 12 possible interrupt sources, even just within the CorePac itself. So one of the special modules is the internal Interrupt Controller (INTC). This internal INTC accepts 124 events and selects among those 124 events or even combinations of those 124 events, and then generates 12 possible interrupt sources to the C66x DSP core.

    Some of the event inputs to the internal INTC come from within the CorePac, such as the "PMC memory protection fault event", number 121. Some of the event inputs to the internal INTC come from outside the CorePac but inside the C6678, such as TINT8L "Timer [8] interrupt low", number 66. In SPRS691a starting on page 146, Table 7-39 "TMS320C6678 System Event Mapping - C66x CorePac Primary Interrupts" lists the 128 events that are the selectable interrupt sources for a CorePac. Each CorePac has one of these internal INTC's. This is what you programmed in SYS/BIOS, and that is why it is limited to 128.

    But 128 is not enough. There are many more events that get generated by peripherals and pins and modules in the C6678 from outside the CorePacs. More than 40 events are generated by the combination of the three EDMA3 modules; more than 16 come from the SRIO.

    To allow for many more events to be routed through, ultimately to one of a C66x DSP's 12 user interrupts, we added device-level Interrupt Controllers (INTC), or "my other brother Darryl". The device INTC accepts how ever many interrupt sources the device design engineer decided were needed. INTC0 and INTC1 have 160 events numbered, although some are Reserved.

    In SPRS691a on page 149, Tables 7-39 through 7-42 lists the events that can be selected by the device INTCs. Those events (or combination of events) are then forwarded to each of the CorePacs and to the internal INTC in a CorePac.

    I am sorry that our documentation uses the exact same name for two different modules in the same device. We solved this in the C6474 by calling the internal one the INTC and the device one the Chip Interrupt Controller (CIC). It looks like we forgot some goods ideas from the past. My apologies, because I felt your same confusion as I was reading through the documents trying to figure this out.

    I do not know how to program the device INTCs in SYS/BIOS, so we can hope that someone in the BIOS forum can answer that for you. Or they may say you have to run some other package like the MCSDK, in which case you might have your thread moved again.

    Regards,
    RandyP

  • Good explanation of why I get this error.  I still would like to know how I can take advantage of SYSBIOS and use the "other brother Darryl" to set up this interrupt.  thanks Mike 

  • Mike,

    Can you please provide a code snippet of how you're configuring your interrupt?

    Alan

  • Alan,

    Not to speak out-of-turn for Mike, but I think he was trying to configure the interrupts using the SYS/BIOS tools. He found that the SYS/BIOS INTC configuration is for the CorePac INTC.

    How should he configure the device-level INTC with SYS/BIOS?

    Regards,
    RandyP

  • Mike,

    There is a module called ti.sysbios.family.c66.tci66xx.CpIntc which will allow you to configure this.  I have included a very simple example of configuring this.

    In this example, I'm mapping System interrupt 15 to Host interrupt 8.  Then I'm configuraing Hwi 4 with Host interrupt 8.  CpIntc_getEventId() API with the latest 6.32.04 release is correct but has a bug in earlier 6.32 releases.

        CpIntc_mapSysIntToHostInt(0, 15, 8);
        CpIntc_dispatchPlug(15, &event15Fxn, 15, TRUE);
        CpIntc_enableHostInt(0, 8);
        eventId = CpIntc_getEventId(8);

        Hwi_Params_init(&params);
        params.arg = 8;
        params.eventId = eventId;
        params.enableInt = TRUE;
        Hwi_create(4, &CpIntc_dispatch, &params, NULL);

    Judah

  • I will try this later on, I was hoping there was a way using the SYSBIOS gui.  Mike

  • Okay, I have my code below.  I am trying to create a interrupt with a receive event from the UART Receive. I think this should be event# 149.  'myrxint' is the interrupt routine.   So I map a system interrupt to 149.  Does it matter which system interrupt I use?  In the example you sent me it looks like #15.  What else do I need here to get this interrupt working?  Mike 

     

    Hwi_Params params;

     

    int eventId;

     

    CpIntc_mapSysIntToHostInt(0, 15, 149);

    CpIntc_dispatchPlug(15, &myrxint, 15, TRUE);

    CpIntc_enableHostInt(0, 149);

    eventId = CpIntc_getEventId(149);

     

    Hwi_Params_init(&params);

    params.arg = 149;

    params.eventId = eventId;

    params.enableInt = TRUE;

    Hwi_create(4, &CpIntc_dispatch, &params, NULL);

     

    Hwi_enableInterrupt(4);

    BIOS_start()

     

  • Mike,

    michael burke79518 said:

    Okay, I have my code below.  I am trying to create a interrupt with a receive event from the UART Receive. I think this should be event# 149.  'myrxint' is the interrupt routine.   So I map a system interrupt to 149.  Does it matter which system interrupt I use?  In the example you sent me it looks like #15.  What else do I need here to get this interrupt working?  Mike 

     

     

    Hwi_Params params;

    int eventId;

    CpIntc_mapSysIntToHostInt(0, 15, 149);

    CpIntc_dispatchPlug(15, &myrxint, 15, TRUE);

    CpIntc_enableHostInt(0, 149);

    eventId = CpIntc_getEventId(149);

    Hwi_Params_init(&params);

    params.arg = 149;

    params.eventId = eventId;

    params.enableInt = TRUE;

    Hwi_create(4, &CpIntc_dispatch, &params, NULL);

    Hwi_enableInterrupt(4);

    BIOS_start()

     

     

    You've got your system/host interrupts backwards.  149 is your system interrupt (This is defined by the hardware, you can't change this).

    Now, you need to choose a host interrupt to use.  This is important depending on which core you want to receive this interrupt. I'll post the table here for you conveniece:

    The left most number is the GEM event. Inside the array, the numbers corresponds to the host event for core0 or core4, core1 or core5, core2 or core6, core3 or core7 respectively. The array with only 1 number are broadcast events, these are received by all cores using the same CPINTC.                 

                        21: [32, 43, 54, 65],
                        22: [33, 44, 55, 66],
                        23: [34, 45, 56, 67],
                        24: [35, 46, 57, 68],
                        25: [36, 47, 58, 69],
                        26: [37, 48, 59, 70],
                        27: [38, 49, 60, 71],
                        28: [39, 50, 61, 72],
                        29: [40, 51, 62, 73],
                        30: [41, 52, 63, 74],
                        31: [42, 53, 64, 75],
                        62: [2, 10, 18, 26],
                        63: [3, 11, 19, 27],
                        92: [4, 12, 20, 28],
                        93: [5, 13, 21, 29],
                        94: [6, 14, 22, 30],
                        95: [7, 15, 23, 31],
                        102: [0],
                        103: [1],
                        104: [8],
                        105: [9],
                        106: [16],
                        107: [17],
                        108: [24],
                        109: [25],

    Assuming you are core0 and you want to receive this system interrupt.  You would do the following:

        CpIntc_mapSysIntToHostInt(0, 149, 32);                 // I picked host int 32 for CPINTC #0.  CPINTC #1 is for cores 4-7
        CpIntc_dispatchPlug(149, &myrxint, arg, TRUE);   //  the 'arg' parameter could be anything, doesn't have to be 149
        CpIntc_enableHostInt(0, 32);                                     // CPINT #0 is for cores 0-3, CPINTC #1 is for cores 4-7
        eventId = CpIntc_getEventId(32);                               // this should return the GEM event 21 (This was a bug fixed in 6.32.04)

        Hwi_Params_init(&params);
        params.arg = 32;                                       // required to be the host interrupt #
        params.eventId = eventId;
        params.enableInt = TRUE;
        Hwi_create(4, &CpIntc_dispatch, &params, NULL); // create ISR to handle this event in Hwi vector 4

    Okay, I think that should do it.

    Judah

  • Okay, I think I'm almost there.  However the UART RX interrupt is actually not one of the 127 system events. Its listed as INTC0 event inputs (secondary interrupts) in table 7-32 of sprs691.  Is what you have in the code above still apply or do I have to add something to link the secondary event INTC0 (#149) to one of the primary events?

  • Michael,

    michael burke79518 said:

    Okay, I think I'm almost there.  However the UART RX interrupt is actually not one of the 127 system events. Its listed as INTC0 event inputs (secondary interrupts) in table 7-32 of sprs691.  Is what you have in the code above still apply or do I have to add something to link the secondary event INTC0 (#149) to one of the primary events?

    I think there's some confusion on what is system interrupts, host interrupts, GEM interrupts, etc...  Just to clarify:

    1.  The secondary interupts which are INTC0 and INTC1 event inputs and also known as system interrupts.  There is 160 for INTC0 and 160 for INTC1.

    2.  The primary interrupts which are inputs to the C66x CPU are also known as GEM interrupts.  There are actually 128 of these. [C6678 docs also calls these system events - I suppose why the confusion here].  These are not to be confused with those from #1.

    In the INTC terminology...The secondary interrupts are called system interrupts.  The output of these secondary interrupts from INTC is called host interrupt.  These host interrupts are input into the GEM interrupts.  So having said all that, when you did a mapping of SysInt to HostInt in the API:  CpIntc_mapSysIntToHostInt(0, sysint, hostint).  You mapped one of the secondary interrupts into the GEM event (system event) so you shouldn't have to do anything else.

    Judah

  • Judah,

    I am trying to enable the UART interrupts also.

    I am using the TMDXEVM6678L eval board using MCSDK 2_00_05_17/PDK C6678_1_0_0_17.

    the API must be different than what your example uses

    CpIntc_mapSysIntToHostInt, CpIntc_dispatchPlug, etc do not exist in my enviornment

    is there an example of what API's I should use to map and enable the UART interrupt?

     

    thanks

    lwmcgl

     

  • Lyndon,

    What environment are you in?  What version of BIOS are you using?

    If it makes sense to open up a new thread for you problem, I would recommend doing so since this one is marked "answered" already.

    Judah

  • Judah,

    windows XP

    BIOS 6_32_05_54

    this thread is fine since it's the same basic question

     

    thanks,

    lwmcgl

     

  • Lyndon,

    I assumed that you followed the thread and things still don't make sense?

    If you are using SYSBIOS then CpIntc API's do exists for you.  They are located at:
         ti/sysbios/family/c66/tci6xx/CpIntc

    If you follow the thread, I think what you need to do is find out which INTC interrupt is associated with the UART.
    In BIOS terminology this is called the "system interrupt".  Then you need to map the "system interrupt" to a "host interrupt".
    You need to pick the "host interrrupt" appropriately (there's a table that I posted) because some host interrupt only interrupt to some cores.
    Then you need to map the "host interrupt" to a GEM interrupt

                GEM id: [Host interrupt # core 0 & 4, Host interrupt # core 1 & 5, Host interrupt # core 2 & 6, Host interrupt # core 3 & 7 ]
                        21: [32, 43, 54, 65],
                        22: [33, 44, 55, 66],
                        23: [34, 45, 56, 67],
                        24: [35, 46, 57, 68],
                        25: [36, 47, 58, 69],
                        26: [37, 48, 59, 70],
                        27: [38, 49, 60, 71],
                        28: [39, 50, 61, 72],
                        29: [40, 51, 62, 73],
                        30: [41, 52, 63, 74],
                        31: [42, 53, 64, 75],
                        62: [2, 10, 18, 26],
                        63: [3, 11, 19, 27],
                        92: [4, 12, 20, 28],
                        93: [5, 13, 21, 29],
                        94: [6, 14, 22, 30],
                        95: [7, 15, 23, 31],
                        102: [0],
                        103: [1],
                        104: [8],
                        105: [9],
                        106: [16],
                        107: [17],
                        108: [24],
                        109: [25],

    The first number is the GEM event.  The items in the array are the host interrupts #.
    The first element in array corresponds to core0 (INTC0) and core4 (INTC1)
    The second element in array for core 1 and core 5....etc
    Those with only one element means they go to all cores.

    The last thing is to create a Hwi for the GEM event.

    Judah

  • Judah,

    are the CpIntc API's calls used in a .cfg file or in a regular code .c file?

    I don't have the CpIntc folder:

     

    I added the PDK CSL library to the linker file search path thinking the CpIntc API was there.

    I see functions like “CSL_CPINTC_mapSystemIntrToChannel” in the PDK CSL,

    but didn’t know if these are the equivalent function that you used in your example?

     

    thanks again,

    lwmcgl

     

     

     

  • I'm sorry, I meant there is a module called CpIntc located at:    ti/sysbios/family/c66/tci6xx
    You can check out the BIOS cdoc documentation in your installation on the APIs.

    There is API support for configuring in your *.cfg and/or in your .c file.

    The PDK CSL is different but i think provides some of the same functionality.  These are not the APIs I use in my example. If you are configuring your interrupts with BIOS I would recommend staying with the BIOS Hwi APIs and CpIntc APIs to be consistent.  I believe I posted an example of configuring CpIntc earlier in this thread.

    Judah

  • Judah,

    Sorry, but I am still confused.

    In the sprs691b data manual :

    Table 7-40 (INTC1 Event Inputs) lists the UART interrupts as events 148, 149, 150.

    Figure 7-29 (TMS320C6678 Interrupt Topology) shows INTC1 only going to Core4,5,6 or 7

    Does this mean that only Core4,5,6 or 7 can get the UART interrupt and Core0,1,2 & 3 cannot get it?

    I thought your example was mapping the UART interrupt so Core0 will get it?

     

    lwmcgl

  • Judah,

    sorry again for my last post,

    I didn't see that the UART interrupts were in both INTC0 and INTC1

    my next problem is that I am getting undefined symbols:

     ti_sysbios_family_c66_tci66xx_CpIntc_dispatchPlug__E
     ti_sysbios_family_c66_tci66xx_CpIntc_dispatch__E
     ti_sysbios_family_c66_tci66xx_CpIntc_enableHostInt__E
     ti_sysbios_family_c66_tci66xx_CpIntc_getEventId__E
     ti_sysbios_family_c66_tci66xx_CpIntc_mapSysIntToHostInt__E

     

    I have added the include to the source file:

    #include <ti/sysbios/family/c66/tci66xx/CpIntc.h>

    and even pointed the linker to the library and file search path:

    ti.sysbios.family.c66.tci66xx.ae66

    "C:\Program Files\Texas Instruments\bios_6_32_05_54\packages\ti\sysbios\family\c66\tci66xx\lib\whole_program_debug"

    what have I missed now?

     

    thanks alot,

    lwmcgl

     

  • You need to do a useModule the CpIntc module in your .cfg file:

    var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');

  • Judah,

    thanks for all of your help, I got the project to build but...

    I do not see my interrupt routine getting called

    I have enabled the UART interrupts with this code:


           CSL_FINS (hUartRegs->IER, UART_IER_ERBI,  CSL_UART_IER_ERBI_ENABLE);
           CSL_FINS (hUartRegs->IER, UART_IER_ETBEI, CSL_UART_IER_ETBEI_ENABLE);

    I still don't understand the interrupt mapping stuff

    when you map the UART to host event 32 is that

    overwritting the default interrupt QM_INT_LOW_0?

    should I be using host event 0-3 (EVT0-EVT3)?

     

    thanks for any help

    lwmcgl

     

  • Mike,

    I am also trying to get UART interrupts working on the C6678

    I have tried what was posted here but still can't get my interrupt routine to be called

    did you ever get the UART interrupts working?

     

    thanks for any help,

    lwmcgl

     

  • Lwmcgl,

    I've attached a jpg here that tries to explain the whole interrupt configuration.  There's like 3 different levels that need to be correctly configured.
    Those APIs you are using are CSL APIs which I'm not familiar with so I don't know what they are doing.

    The # of system interrupts and # of host interrupt in the diagram can be different for different devices.  Everything to the right of Host Interrupt is the same for all C66 devices.

    1) So looks like your system interrupts are # 148, 149, and 150.  Next step would be to map these to a host interrupt. (Use CpIntc APIs to do this)

    2) You can map all 3 system ints to the same host int (for simplicity).  Lets pick Host int #32 (core 0), #43 (core 1), #54 (core 2), #65 (core3). (Use CpIntC APIs do to this)

    3) Those host ints map to GEM event 21.  Next question is do you want this GEM event to have a dedicated interrupt line? or Do you want to use a combined event?

    4) Assuming dedicated interrupt line, you would map it to one of the 12 re-mappable Hardware interrupts.  (Use Hwi APIs to do this)

    5) If you want to use the event combiner, then you need to enable the GEM event in the event combiner then map the combined event to one of the 12 Hardware interrupts
         (first use EventCombiner to enable GEM event 21,  Then map GEM Event 0 to one of the 12 re-mappable Hardware interrupt).

    I also attached here some very simple *.c and *.cfg that use Hwi and CpIntc APIs.

    2664.tests.zip

     

     

  • judah,

    thanks for the examples, they helped a lot

    I do have a question on the combined event example in CpIntcTest2.c

     

        /*
         * Map 3 sysInt interrupts (33-35) to single hostInt (1).
         */
        sysInt = 33;
        hostInt = 1;
        for (i = 0; i < 3; i++) {
         CpIntc_dispatchPlug(sysInt + i, myIsr, sysInt + i, TRUE);
         CpIntc_mapSysIntToHostInt(0, sysInt + i, hostInt);
        }
        CpIntc_enableHostInt(0, hostInt);

        eventId = CpIntc_getEventId(hostInt);
        System_printf("CpIntc_getEventId(%d) = %d\n", hostInt, eventId);
       
        EventCombiner_dispatchPlug(eventId, CpIntc_dispatch, hostInt, TRUE);
       
        Hwi_Params_init(&hwiParams);
        hwiParams.arg = (eventId / 32);
        hwiParams.eventId = (eventId / 32);
        hwiParams.enableInt = TRUE;
        Hwi_create(9, &EventCombiner_dispatch, &hwiParams, NULL);

        /* enable the 'global' switch */
        CpIntc_enableAllHostInts(0);

        BIOS_start();

     

    why is the eventId divided by 32 when setting hwiParams.eventId?

    why isn't just the eventId used?

     

    thanks,

    lwmcgl

     

  • lwmcgl,

    The eventId divided by 32 is used because the Hwi is being setup for one of the combined events and not the event itself.  The combined event ids are one of the following [0, 1, 2, 3].

    FYI:  combined event 0 corresponds to events 0-31,
             combined event 1 corresponds to events 32-63,
             combined event 2 corresponds to events 64-95,
             combined event 3 corresponds to events 96-127,

    Judah

  • Hey... I have been looking around (in vain) for a document that explains registers of the INTC 0,1,2 modules. I am specifically interested in 6670/6616 devices. The example code, data sheet and INTC manual(SPRUGW4.pdf) all have different explanations and register offsets. Can you please help me.

    Thanks,

    HSMTI

  • Hi HSMTI,

    I think Chapter 9: Interrupt Controller may be of help: here.

  • Wow...  I am new to the embedded system programming and I need to create a Hwi that will handle the UART receive event...  After reading this I am more confused than when I started...  Are there any examples out there for setting up a HWI for the UART receive events?

    Currently I have two tasks but the main task is running at a higher priority that my readUART task and It appears that I am missing some of the data the should be coming into the UART.  I am pretty sure that I want the main task to handle the UART receive event Hwi.  I am using the TMSEVM6678 and SYSBIOS.  It seems to me that this is a fairly common Hwi, but I am not seeing any examples of how this is done...

    Thanks in advance,

    Chad

  • Chad,

    I recommend you go to the TI Wiki Pages and search for "SYS/BIOS training" (no quotes). There are a variety of training resources there. After you have gone through some SYS/BIOS training, perhaps more of this thread will be helpful to you.

    You will probably be best served by starting a new thread with your specific new questions once you have been through the training material. This thread has been marked as Answered, so a lot of experts may not be looking as closely as they might with a new thread from you. If you do that, please post a reply here to point us to the new one.

    Regards,
    RandyP

  • Yeah, I have done that. I have done most if not all of the SYSBIOS training that I could find online. I know how to create Hwis, swis and tasks... I have the example code from the HUA demo, but that is using the abstracted platform_uart_write, and tried to implement the platform _uart_read, but that is just a method sitting inside a task, and seems to miss a lot of incoming data..  What I am hearing from TI is that is not an example for setting up a HWI for UART receive events?  If there is please direct me to that not more training...

    Thanks again,

    Chad

  • Here is what I have:

    int main()
    {
    Hwi_Params params;

    int eventId;
    CpIntc_mapSysIntToHostInt(0, 149, 32);
    CpIntc_dispatchPlug(149, &recieveUARTFxn, 149, TRUE);
    CpIntc_enableHostInt(0, 32);
    eventId = CpIntc_getEventId(32);

    Hwi_Params_init(&params);
    params.arg = 32;
    params.eventId = eventId;
    params.enableInt = TRUE;
    Hwi_create(4, &CpIntc_dispatch, &params, NULL);

    Hwi_enableInterrupt(4);

    platform_write("Start BIOS 6\n");

    BIOS_start();
    }

    But the recieveUARTFxn, is never called, I know the UART is working as I have a task running the platform_uart_read() method in an infinite loop and data is received.

  • CpIntc_mapSysIntToHostInt(0, 148, 32);

    CpIntc_dispatchPlug(148, myrxint, 148, TRUE);

    CpIntc_enableHostInt(0, 32);

    eventId = CpIntc_getEventId(32);

    Hwi_Params_init(&params);

    params.arg = 32;

    params.eventId = eventId;

    params.enableInt = TRUE;

    params.priority = 2;

    Hwi_create(5, &CpIntc_dispatch, &params, NULL);

    Hwi_enableInterrupt(5);

    Hwi_enable();

     

    This is wahat I did for a uart receive interrupt.  Worked pretty well.  Close to what you have though, so I'm not sure whats wrong.

  • Hey Michael,

    Yep that is where I got it from.  I was not getting the interrupt to fire, and I was not getting any help anywhere else so I thought I would post what I have here and see if I got any bites...   I am sure I am missing something...  And I have no idea what it is...  I will recompile with your code.  Can you post the myrxint method that you have maybe there is something in there, although when I set the breakpoint I never get to it..??

  • I love the way this is marked as "Answered" while the last two posts are questions where the users code does not work properly.  Gotta love TI Support.  

    The actual answer:  You have to do the above to connect the peripheral interrupt via SysBios to the Callback routines (6 separate function calls?  Really? I thought this was supposed to make development easier!).  However, that is not enough.  You also need to use CSL to set up the peripheral itself to generate interrupts.  The SysBios setup does absolutely nothing to the peripheral.

        // Force the Transmitter and Receiver into reset mode before init
        hUartRegs->PWREMU_MGMT = CSL_UART_PWREMU_MGMT_RESETVAL;

        platform_uart_init();
        platform_uart_set_baudrate(115200);

        //FCR- Fifo control reg - Enable fifos, disable DMA, Set Fifo trigger to 8 chars
        CSL_FINS (hUartRegs->FCR, UART_FCR_FIFOEN,   CSL_UART_FCR_FIFOEN_ENABLE);
        CSL_FINS (hUartRegs->FCR, UART_FCR_TXCLR,    CSL_UART_FCR_TXCLR_CLR);
        CSL_FINS (hUartRegs->FCR, UART_FCR_RXCLR,    CSL_UART_FCR_RXCLR_CLR);
        CSL_FINS (hUartRegs->FCR, UART_FCR_DMAMODE1, CSL_UART_FCR_DMAMODE1_DISABLE);
        CSL_FINS (hUartRegs->FCR, UART_FCR_RXFIFTL,  CSL_UART_FCR_RXFIFTL_CHAR8);

        // UART.IER Interrupt Enable Register
        // ERBI for Data Ready and Fifo trigger including timeout
        // ELSI for overrun, parity, framing errs
        // ETBEI for Transmitter empty interrupt
        hUartRegs->IER = (CSL_UART_IER_ERBI_MASK + CSL_UART_IER_ELSI_MASK);
        //hUartRegs->IER = (CSL_UART_IER_ERBI_MASK + CSL_UART_IER_ELSI_MASK + CSL_UART_IER_ETBEI_MASK);

  • I'm glad you were able to add to this thread.

    Regarding this comment: "I love the way this is marked as "Answered" while the last two posts are questions where the users code does not work properly.  Gotta love TI Support. "

    If you scroll back in the thread, I think you'll notice that the question was marked Verified by the original author of the post.

    Alan

  • Hi jonathan,

    I have a same question.

    I try  two type code,but it didn`t call my interrupt sever routine.

    My code is here:

    CpIntc_mapSysIntToHostInt(0, 148, 32);

    CpIntc_dispatchPlug(148, (CpIntc_FuncPtr)myrxint, NULL, TRUE);

    CpIntc_enableHostInt(0, 32);

    eventId = CpIntc_getEventId(32);

    Hwi_Params_init(&params);

    params.arg = 32;

    params.eventId = eventId;

    params.enableInt = TRUE;

    params.priority = 2;

    Hwi_create(5, &CpIntc_dispatch, &params, NULL);

    Hwi_enableInterrupt(5);

    Hwi_enable();


    /*CpIntc_dispatchPlug(CSL_INTC0_UARTINT, (CpIntc_FuncPtr)myrxint, NULL, TRUE);//后添加

    CpIntc_mapSysIntToHostInt(0, CSL_INTC0_UARTINT, 32);//后添加

    CpIntc_enableHostInt(0, 32);//后添加

    CpIntc_enableSysInt(0, CSL_INTC0_UARTINT);//后添加

    eventId = CpIntc_getEventId(32);//后添加

    EventCombiner_dispatchPlug (eventId, CpIntc_dispatch, 32, TRUE);//后添加*/

  • Hi,judahvang

    I try to use http://e2e.ti.com/cfs-file.ashx/__key/CommunityServer-Discussions-Components-Files/355/2664.tests.zip.But the interrupt routine not be called.

    Use 6678.

    My code like this:

    void idl0Fxn(void)
    {

    CpIntc_postSysInt(0, 15);


    }


    void event15Fxn()
    {
    event15Done = TRUE;
    }

    void main()
    {
    Hwi_Params params;
    Int eventId;

    printf("Running LX_uart\n");

    UartInit();

    CpIntc_mapSysIntToHostInt(0, 15, 8);

    CpIntc_dispatchPlug(15, (CpIntc_FuncPtr)&event15Fxn, 15, TRUE);

    CpIntc_enableHostInt(0, 8);

    eventId = CpIntc_getEventId(8);

    Hwi_Params_init(&params);

    params.arg = 8;

    params.eventId = eventId;

    params.enableInt = TRUE;

    params.priority = 6;

    Hwi_create(5, &CpIntc_dispatch, &params, NULL);

    // CpIntc_enableSysInt(0,15);

    // Hwi_enableInterrupt(5);

    // Hwi_enable();

    printf("main compelet\n");
    BIOS_start();


    }

    please tell me why? 

    Thanks 

    LI

  • Li,

    Were you able to get any of the SYS/BIOS examples to work?

    Todd

  • HI,

    Thank for your reply.

    I got some examples ( which from e2e forums)and coding like these,but i`m not sure the code is right.

    I have read SYS/BIOS 6.32.05.54 GA Release Notes and anything i can get.

    I think that I have understood c66 interrupt and uart init,but the code is still not OK.

    Can you give me some suggestion or example? And Please tell me where is wrong in my code?

    Thanks,

    Li

  • Hi todd,

    I want to use FIFO-interrupt mode of UART receiver.

    Uart  system interrupt id is 148.so i code like this:

    CpIntc_mapSysIntToHostInt(0, 148, 32);//core 0

    But i found when i called "eventId = CpIntc_getEventId(32);"

    the eventId is 255,i think it`s wrong.but did`t know why?

    My code is following:

    CpIntc_mapSysIntToHostInt(0, 148, 32);

    CpIntc_dispatchPlug(148, (CpIntc_FuncPtr)myrxint, NULL, TRUE);

    CpIntc_enableHostInt(0, 32);

    eventId = CpIntc_getEventId(32);

    Hwi_Params_init(&params);

    params.arg = 32;

    params.eventId = eventId;

    params.enableInt = TRUE;

    params.priority = 2;

    Hwi_create(5, &CpIntc_dispatch, &params, NULL);

    Hwi_enableInterrupt(5);

    Hwi_enable();

    Thanks Todd

  • First can you please verify that you can get any of the SYS/BIOS examples (e.g. Task Mutex) to work.

    Todd

  • Hi Todd,

    Yes,I can. Yesterday,I have resolved the problem with API eventcombiner.

    I have some question:

    Q1:What is the different between eventcombiner (to map hwi) and Hwi create(to map hwi).

    Q2:If I want to use Hwi create,How to use it correctly.I have try many times but still failed.

    Q3:The question about

    CpIntc_dispatchPlug(15, &event15Fxn, 15, TRUE);

    if I use it like this, it looks like wrong.

    But if i use like the folllowing:(event15Fxn the function is void return)

    CpIntc_dispatchPlug(15, event15Fxn, 15, TRUE);

    It is right.

    I have read

    SYS/BIOS 6.32.05.54

    API reference.

    I think it need a func address.

    Thanks,

    Li

  • Hi todd,

    Sorry , I try to use CpIntc_dispatchPlug(15, &event15Fxn, 15, TRUE) and CpIntc_dispatchPlug(15, event15Fxn, 15, TRUE);

    The both all right.

    But used Hwi_create to create a hwi still failed.

    I used CpIntc_postSysInt for test.But not to work(it meant the hwi create failed)

    I have another question today:

    I continually send data from PC,Mostly it can call interrupt routine only once.

    The reason is about BIOS or UART or CPU?

    Thanks,

    Li

     

  • Li,

    Can you start a new post when you have a new question? It makes it easier to answer the question and for other forum users to search and find answers.

    Todd

  • Hi todd,

    Sorry, I start a new post last week. But nobody answer me. Thank you.

    I will start a new post again.

    Thanks,

    Li