0

I am trying to get the OSEK-Alarm mechanism to run on an arm7 (lpc2292). When simulating my Demo application withing the uVision5 IDE everything works fine. But executing the code on the target plattform it seems like the Interrupt only occures once. Unfortunately I cant attach a serial interface to that plattform for debugging...

This function gets called from a toplevel Interrupthandler as I need to embed this functionality within context switching assembly code. As it can be seen the interruptflag will be reset on every Timer Interrupt which is configured to trigger on counter match with match Register 0;

void handleNonVectoredInterrupt()
{
  UINT32 src = VICRawIntr;
  if(src & ( 1 << TIMER0 ) ) 
  { 
    if( T0IR & 1 )              
    { 
      tickCounter(&systemCounter);    
      T0IR = 1;
    }
  }
}

As I said this code works perfectly within the simulation which confuses me even more. This is my Code how I initialize the counter as well as the Interrupts:

enabling the Interrupt in the VIC:

VICIntEnable |= (1 << TIMER0);

Setting up the counter:

void initializeHardwareCounter(UINT32 ticktime_ns)       // ticktime 10^6 ns
{
  T0PR    = (SYS_CLOCK / (2 * ticktime_ns / 1000)) - 1;  // SysClk = 36MHz 
  T0MCR  |= (1 << 0) | (1 << 1);                         // Match MR0 and reset
  T0TC    = 0xFFFFFFFF;                                  // reset counter  
  T0TCR  |= (1 << 0);                                    // enable as counter
  T0MR0   = 0;                                           // match value
}

Has anybody experienced similar behaviour and has any idea where I can expect the issue?

Thanks in advance

  • Your target platform should have at least some usable pins to hook up an oscilloscope, or LEDs. Use these to follow the control flow, by toggling different pins at some interesting places in your code. -- And read the documentation of the LPC2292 once more in depth. – the busybee Jun 17 '20 at 14:21
  • Yes I have some LEDs a can use, I already did that; unfortunatly no GPIOs For example every 100 Interrupt entries Toggle one LED. Result is that the Interrupt only executes once, as if im not clearing the Interrupt flag.. – UltraGeralt Jun 17 '20 at 15:58

0 Answers0