i.MX53 - Interrupt vector issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX53 - Interrupt vector issue

727 Views
tiagosilva
Contributor I

Hello,

    I am working with i.MX535 QSB from Freescale in IAR EWARM. I had used GettingStarted example from IAR EWARM, modifying the project like shown below (main.c).

    I am not able to get interrupts in IRQ_Handler address (0x18), even enabling TZIC #39. Anyone could please help me to get my LED on P7_7 blinking?

    The code is working well when pooling GPTSR_bit.OF1 bit in while(1), like suggested in the original GettingStarted project. But I need to get interrupts directly from the interrupt vector, what I can easily do on ARM7 platform for example.

Thanks,

Tiago

/** include files **/

#include <Freescale/iomcimx535.h>

#include <intrinsics.h>

#include "board.h"

/* GPT1 Tick per second*/

#define GPT_TICK_PER_SEC   4

/** private data **/

static volatile Int8U Gpt1Counter;

volatile unsigned char flag0;

/**

*

*/

__irq void IRQ_Handler(void)

{

   __DSB();

   

   if (flag0 < 0xFF)

   {

      flag0++;

   }

   

   GPTSR_bit.OF1= 1;

   

   __DSB();

   

   return;

}

/**

*

*/

int main(void)

{

   // USER LED init - GPIO_7[7]

   IOMUXC_SW_MUX_CTL_PAD_PATA_DA_1_bit.MUX_MODE = 1;

   GPIO7_DR_bit.no7   = 0;

   GPIO7_GDIR_bit.no7 = 1;

 

   // Init GPT

   Gpt1Counter = 0;

   // Select CKIL for timer clock - Low Frequency Reference Clock

   GPTCR_bit.CLKSRC = 4;

   // Init the Timer prescaler

   GPTPR_bit.PRESCALER = 0;

   // Init timer tick interval

   GPTOCR1 = CKIL/GPT_TICK_PER_SEC;

 

   //Enable Interrup on compare

   GPTIR_bit.OF1IE = 1;

   // Enable GPT1

   GPTCR_bit.EN = 1;

 

   /* Configure TZIC Interrupt Controller */

   TZIC_ENSET1_bit.INTENSET39 = 1;

   TZIC_INTSEC1_bit.SECURE39 = 1;

   TZIC_PRIOMASK_bit.MASK = 0x1F;

   TZIC_PRIORITY9_bit.PRIO39 = 0x20;

   TZIC_INTCTRL = 0x80010001;  

 

   __enable_interrupt();

 

   while (1)

   {

      if (flag0)

      {

          flag0 = 0;

         ++Gpt1Counter;

         GPIO7_DR_bit.no7 = (1 & Gpt1Counter);

      }

   }

}

0 Kudos
2 Replies

488 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

I believe that the attached example for GPIO interrupt for i.MX53QSB, can help.

Please note that this is unofficial example.


Have a great day,
Alejandro

0 Kudos

488 Views
victorsaldaña
Contributor I

Hola, Estoy buscando una forma de accesar a los GPIO de usuario (user1, user2) de la i.MX53 QSB, me podria ayudar con un ejemplo en IAR, o UBUNTU.?

Gracias

0 Kudos