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.

How to access EPI in task and interrupt?

Other Parts Discussed in Thread: TM4C129XNCZAD

I use TM4C129XNCZAD and TI-RTOS,  When I access EPI in task and interrupt, the code is : (*((volatile unsigned short *)(0x60000000+addr)))

CCS print the information listed below in console:

se: 0x2000dff8.
Hwi stack size: 0x400.
R0 = 0x00000000  R8  = 0x000167f4
R1 = 0x00000010  R9  = 0x000167f8
R2 = 0x00001800  R10 = 0x00000000
R3 = 0x00000001  R11 = 0x00000000
R4 = 0x00000001  R12 = 0x2000de00
R5 = 0x00000005  SP(R13) = 0x2000e2c8
R6 = 0x000163a8  LR(R14) = 0x000125df
R7 = 0x000167fc  PC(R15) = 0x00000000
PSR = 0x60000060
ICSR = 0x00423003
MMFSR = 0x00
BFSR = 0x00
UFSR = 0x0002
HFSR = 0x40000000
DFSR = 0x0000000b
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
Terminating execution...

 

  • Hello Jian,

    It looks like there is a Fault for INVSTAT being set. The Access itself does not seem correct to me. If instead you replace it with HWREG to the EPI address space then what?

    Regards
    Amit
  • Hello Amit,

             Thanks for your answer.  I have found the code in hw_types.h:

    #define HWREG(x)                                                              \
            (*((volatile uint32_t *)(x)))
    #define HWREGH(x)                                                             \
            (*((volatile uint16_t *)(x)))

       It seems no different from my code.

    Can I access EPI directly in TI-RTOS?

    Thanks.

    Best Regards. 

  • Hello Jian

    EPI is not pre-configured. You would need to setup the IO's and the EPI configuration in the TI-RTOS setup to be able to access it.As an example the TivaWare has SDRAM with EPI code in examples/peripheral/epi that you may want to refer to. Also what is that you are trying to interface over EPI?

    Regard
    Amit
  • Hello Amit,

           I have configure the EPI. I just wonder how to set up the P4 P5 interrupt. Is the code below right? Thanks!

    Hwi_Struct callbackPortP4Hwi;
    const GPIO_Callbacks TM4C129X_gpioPortP4Callbacks = {
        GPIO_PORTP_BASE, INT_GPIOP4, &callbackPortP4Hwi,
        {NULL, NULL, NULL, NULL, isr_int, NULL, NULL, NULL}
    };
    Hwi_Struct callbackPortP5Hwi;
    const GPIO_Callbacks TM4C129X_gpioPortP5Callbacks = {
        GPIO_PORTP_BASE, INT_GPIOP5, &callbackPortP5Hwi,
        {NULL, NULL, NULL, NULL, NULL, isr_sync0, NULL, NULL}
    };

        GPIO_setupCallbacks(&TM4C129X_gpioPortP4Callbacks);
        GPIO_enableInt(TM4C129X_ECAT_ISR, GPIO_INT_FALLING);
        GPIO_setupCallbacks(&TM4C129X_gpioPortP5Callbacks);
        GPIO_enableInt(TM4C129X_ECAT_SYNC0, GPIO_INT_FALLING);

  • Hello Amit,

           I have configure the EPI. I just wonder how to set up the P4 P5 interrupt. Is the code below right? Thanks!

    Hwi_Struct callbackPortP4Hwi;
    const GPIO_Callbacks TM4C129X_gpioPortP4Callbacks = {
        GPIO_PORTP_BASE, INT_GPIOP4, &callbackPortP4Hwi,
        {NULL, NULL, NULL, NULL, isr_int, NULL, NULL, NULL}
    };
    Hwi_Struct callbackPortP5Hwi;
    const GPIO_Callbacks TM4C129X_gpioPortP5Callbacks = {
        GPIO_PORTP_BASE, INT_GPIOP5, &callbackPortP5Hwi,
        {NULL, NULL, NULL, NULL, NULL, isr_sync0, NULL, NULL}
    };

        GPIO_setupCallbacks(&TM4C129X_gpioPortP4Callbacks);
        GPIO_enableInt(TM4C129X_ECAT_ISR, GPIO_INT_FALLING);
        GPIO_setupCallbacks(&TM4C129X_gpioPortP5Callbacks);
        GPIO_enableInt(TM4C129X_ECAT_SYNC0, GPIO_INT_FALLING);

     

  • Hello Amit,

           I use another way to  set up the P4 P5 interrupt. But it is not success, but the interrupts ditn't happened, thanks!

    cfg script:

    var hwi0Params = new Hwi.Params();
    hwi0Params.instance.name = "hwi0";
    Program.global.hwi0 = Hwi.create(84, "&isr_int", hwi0Params);
    var hwi1Params = new Hwi.Params();
    hwi1Params.instance.name = "hwi1";
    Program.global.hwi1 = Hwi.create(85, "&isr_sync0", hwi1Params);

    c code:

     GPIOPinTypeGPIOInput(GPIO_PORTP_BASE, GPIO_PIN_4 | GPIO_PIN_5);
     GPIOIntTypeSet(GPIO_PORTP_BASE, GPIO_PIN_4 | GPIO_PIN_5, GPIO_FALLING_EDGE);
     GPIOIntEnable(GPIO_PORTP_BASE, GPIO_PIN_4 | GPIO_PIN_5);
     IntEnable(INT_GPIOP4);
     IntEnable(INT_GPIOP5);

     IntMasterEnable();

    void isr_int()
    {
     GPIOIntClear(GPIO_PORTP_BASE,GPIO_INT_PIN_4);
    }
    void isr_sync0()
    {
     GPIOIntClear(GPIO_PORTP_BASE,GPIO_INT_PIN_5);
    }