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.

TMS320C6657: Multiple GPIO Interrupts not allowed

Part Number: TMS320C6657


I am integrating a new system which will have a custom board but in the meantime I am using the eInfoChips C6657 EVM.  I have two interrupt sources connected to GPIO15 and GPIO14 via the Debug Header pins 78 and 80.  Individually either GPIO will work as an interrupt as desired, but when programmed together only the first GPIO works.  In a previous thread I already discovered that by default the GPIO_soc.c file sets up for a dedicated interrupt (#10 I believe) but that is in conflict with NDK so, I changed the GPIO_soc file to use Event Combiner interrupts instead.  See below.

/* GPIO port 0 pin 14 */
{
16,
CSL_GEM_GPINT14, /* DSP corePac GPIO pin 14 interrupt event*/
INVALID_INTC_MUX_NUM,
},
/* GPIO port 0 pin 15 */
{
16,
CSL_GEM_GPINT15, /* DSP corePac GPIO pin 15 interrupt event*/
INVALID_INTC_MUX_NUM,
},

Again, this works, when programming only 1 GPIO at a time.

I traced the issue to the following code in GPIO_v0.c

/* If Hwi has not already been created, do so */
if ((portHwiCreatedBitMask & gpioPortIntBitMask) == 0U) {
   if (intCfg->intcMuxNum != INVALID_INTC_MUX_NUM)
   {
      /* Setup intc mux */
      muxInParams.arg = (uintptr_t)(portNum);
      muxInParams.muxNum = intCfg->intcMuxNum;
      muxInParams.muxInEvent = intCfg->intcMuxInEvent;
      muxInParams.muxOutEvent = intCfg->intcMuxOutEvent;
      muxInParams.muxIntcFxn = (MuxIntcFxn)(&GPIO_v0_hwiFxn);
      GPIO_osalMuxIntcSetup(&muxInParams, &muxOutParams);

      interruptRegParams.corepacConfig.isrRoutine = muxOutParams.muxIntcFxn;
      interruptRegParams.corepacConfig.arg = muxOutParams.arg;
   }
   else
   {
      interruptRegParams.corepacConfig.isrRoutine = (&GPIO_v0_hwiFxn);
      interruptRegParams.corepacConfig.arg = (uintptr_t)(portNum);
   }

The problem is the statement 

if ((portHwiCreatedBitMask & gpioPortIntBitMask) == 0U)

This is treating the GPIO as is there is only one interrupt per "port" whereas the C6657 is capable if one interrupt per pin I believe.  

I commented out the portHwiCreatedBitMask and now both GPIO can be programmed as interrupts and works as desired.

If this is thought to be desired operation by TI, please explain how to use 2 GPIO pins as interrupts at the same time.  I don't mean the same instant in time, just two interrupts functional.

  • Hi Christopher,

    My apologies for delayed response. I have analyzed your scenario. The work around that you have used is valid (for the following line),

    if ((portHwiCreatedBitMask & gpioPortIntBitMask) == 0U)

    As per the code, One hwi(hardware interrupt) allowed for each port. Datasheet shows 12 hardware interrupts can be triggered (INT4 to INT15) and these 12 hwi are mapped to 128 events (out of which 32 events are for gpio).

    And in C6657, GPIO pins are configured separately but they are all grouped under "GPIO Port 0" in code and there is no reference for "Port 0" or any other ports in documents. So, we can have 32 interrupts from 32 gpio pins (which trigger 32 events and the events are mentioned in C6657 datasheet page 105) and they are mapped under channel mapper (CIC in page 1-3).

    Implementation in your code is safer to use.

    Thanks,

    Rajarajan U

  • I would suggest a change request be submitted for future pdk releases to address this issue.

  • Hi christopher,

    There was no future release planned for this EVM PDK. Hence, I will create a FAQ based on your suggestions.

    Thanks,

    Rajarajan U