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.

Compiler/TM4C123GH6PGE: Interrupt Routine Jump.

Part Number: TM4C123GH6PGE

Tool/software: TI C/C++ Compiler

Hello.

There are two different states for interrupt ISR jump.

Case1 (No jump) ,   Case2 (jump OK) , Why is it different ?

Is not it all the same in two cases ?

What's the difference?

thanks.

[ Case1 ]

void
PM0IntHandler(void)
{
 	ROM_IntMasterDisable();
	GPIOIntClear(GPIO_PORTM_BASE, GPIO_PIN_0);
	UARTprintf("GPIOM Falling_Edge Interrupt\n");
	ROM_IntMasterEnable();
	
}


int
main(void)
{
	
    // Enable GPIOG  for the on-board LED. 
    // Enable GPIOM for the on-board Up Button. 
		
  SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM);

   // GPIOG Port Pin2, Ouput Seting 
  GPIOPinTypeGPIOOutput(GPIO_PORTG_BASE, GPIO_PIN_2 );
			
   // UART Func Call   		
	ConfigureUART();

   // No define System Clock 
	UARTprintf("CLOLK = %d\n",SysCtlClockGet());
	
   // GPIO PM0 Pin Input Set 	
	GPIOPinTypeGPIOInput(GPIO_PORTM_BASE, GPIO_PIN_0);

	// GPIO Pad Config Set 
	GPIOPadConfigSet(GPIO_PORTM_BASE, GPIO_PIN_3|GPIO_PIN_2|GPIO_PIN_1|GPIO_PIN_0	, 
	GPIO_STRENGTH_8MA,GPIO_PIN_TYPE_STD_WPU);
	
	// GPIOM interrupt Type Seting ( GPIO_LOW_LEVEL  or  GPIO_FALLING_EDGE )
	GPIOIntTypeSet(GPIO_PORTM_BASE, GPIO_PIN_0, GPIO_FALLING_EDGE); 
	
	// GPIOM Pin0, Interrupt handler Reigster
  //GPIOIntRegister(GPIO_PORTM_BASE, PM0IntHandler);
	
	
	// GPIOM Interrupt Enabel
	GPIOIntEnable(GPIO_PORTM_BASE, GPIO_INT_PIN_0);  
	
	IntMasterEnable();

    while(1)
    {

	
  // Turn on the LED.

	GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_2, 0x04);
	
	UARTprintf("LED On \n");
	
	SysCtlDelay((SysCtlClockGet()/3)*0.1);  //100ms Delay, (High)

	
	// Turn off the LED.
	 
	GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_2, ~(0x04));
	UARTprintf("LED Off\n");
	SysCtlDelay((SysCtlClockGet()/3)*0.05);  //50ms Delay, (Low)
	
		UARTprintf(" \n");
		
		
    }
}

 startup_rvmdk.S for  Keil 

      

       EXTERN  PM0IntHandler

; The vector table

        DCD     PM0IntHandler           ; GPIO Port M

       .

       .

       .

 

 [ Case 2]  

    // GPIOM Pin0, Interrupt handler Reigster
   GPIOIntRegister(GPIO_PORTM_BASE, PM0IntHandler);


    startup_rvmdk.S for  Keil 

   ;  EXTERN  PM0IntHandler

   ; The vector table

        DCD     IntDefaultHandler           ; GPIO Port M

         .

         .

         .

  • I don't use Keil, but both should work.

    In your Case1, you are registering your ISR address in the vector table, during compilation.
    In your Case2, you dynamically register the ISR during run-time.

    This is very similar to CCS and it works fine. So you will probably need to look for some specific Keil configuration on your project... Are you sure that the startup file is included on the compilation? Maybe try to write an invalid function name in it and see if it complains...

    Did you try to add ANY OTHER interrupt on the vector table and see if it works? Maybe a simple one like SysTick, just for test? Or do you have any other example project that works with interrupts on the vector table?

    Bruno
  • *** LIKE *** (sigh - such an "upgrade")