Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

TM4C1290NCPDT: ISR using the SMBUS implementation from TI

$
0
0

Part Number: TM4C1290NCPDT

Hi all

I am using the TI SMBUS implementation on a custom board wth a TM4C1290NCPDT. We chose this part due to its large number of I2C controllers. The code runs a FreeRTOS system, and each I2C controller gets its own FreeRTOS task. 

I am using the interrupt driven I2C controller, with my ISR which looks like this

// SMBUs specific handler for I2C
void
SMBusMasterIntHandler1(void)
{
  BaseType_t xHigherPriorityTaskWoken = pdFALSE;

  //
  // Process the interrupt.
  //
  eStatus1 = SMBusMasterIntProcess(&g_sMaster1);
  // handle errors in the returning function
  portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}

With a copy for each interrupt handler. 

The call to SMBusMasterIntProcess, which is a function from the TI library, I think is maybe not the right way to go. It handles the SMBUS/I2C state machine and it’s a long piece of code (hundreds of lines.) It appears that on occasion the code crashes in the interrupt handler, and I am wondering/worried if the interrupt handler is ‘too long’. I was under the impression that the interrupt handler should be as short as possible and this appears to violate this maxim. Unfortunately when the code gets in this state (not quite crashing but getting stuck) the debugger is of no use (I’m using SEGGER JLINK and it appears to get very confused about freeRTOS sometimes, even though I’m using the FreeRTOS plug in.)

So, my question is, is there anything obviously wrong about my interrupt handler? Should I be doing something else here?  Any words of wisdom ?

Thanks for any guidance

Peter


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>