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 configure EPI for f28m36 with TI-RTOS

Other Parts Discussed in Thread: SYSBIOS

Hello

I use F28M36xx Control Card and Code Composer version 6.1.0.00104.

I want to use the EPI interface in HB8 mode. The control suite example for EPI is running.

In next step i try to use EPI with TI-RTOS. I tried to modify the TI-RTOS Demo example for EPI:

But It does not work. Where could be the problem?

Regards and waiting for Your response.

ti.sysbios.family.arm.m3.Hwi: line 1087: E_hardFault: FORCED
ti.sysbios.family.arm.m3.Hwi: line 1164: E_busFault: IMPRECISERR: Delayed Bus Fault, exact addr unknown, address: e000ed38
Exception occurred in background thread at PC = 0x0024788a.
Core 0: Exception occurred in ThreadType_Main.
Main name: main(), handle: 0x0.
Main stack base: 0x200010fc.
Main stack size: 0x400.
R0 = 0x400d0000  R8  = 0x00000000
R1 = 0x00000012  R9  = 0x00000000
R2 = 0x00000000  R10 = 0x00000000
R3 = 0x000000f0  R11 = 0x00000000
R4 = 0x00000000  R12 = 0x2000138c
R5 = 0x00000000  SP(R13) = 0x20001478
R6 = 0x00000000  LR(R14) = 0x0024788b
R7 = 0x200014f8  PC(R15) = 0x0024788a
PSR = 0x21000000
ICSR = 0x00400803
MMFSR = 0x00
BFSR = 0x04
UFSR = 0x0000
HFSR = 0x40000000
DFSR = 0x00000000
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
Terminating execution...

void SetEPIControl(void)
{

    //
    // GPIO Port C pins
    //
    
    HWREG(GPIO_PORTC_BASE + GPIO_O_PCTL) = GPIO_PCTL_PC4_EPI0S2 |
                                           GPIO_PCTL_PC5_EPI0S3 |
                                           GPIO_PCTL_PC6_EPI0S4 |
                                           GPIO_PCTL_PC7_EPI0S5;

    //
    // GPIO Port D pins.
    //
    HWREG(GPIO_PORTD_BASE + GPIO_O_PCTL) = GPIO_PCTL_PD2_EPI0S20 |
                                           GPIO_PCTL_PD3_EPI0S21;

    //
    // GPIO Port E pins
    //
    HWREG(GPIO_PORTE_BASE + GPIO_O_PCTL) = GPIO_PCTL_PE0_EPI0S8 |
                                           GPIO_PCTL_PE1_EPI0S9;


    //
    // GPIO Port F pins
    //
    HWREG(GPIO_PORTF_BASE + GPIO_O_PCTL) = GPIO_PCTL_PF4_EPI0S12 |
                                           GPIO_PCTL_PF5_EPI0S15;

    //
    // GPIO Port G pins
    //
    HWREG(GPIO_PORTG_BASE + GPIO_O_PCTL) = GPIO_PCTL_PG0_EPI0S13 |
                                           GPIO_PCTL_PG1_EPI0S14;


    //
    // GPIO Port H pins
    //
    HWREG(GPIO_PORTH_BASE + GPIO_O_PCTL) = GPIO_PCTL_PH0_EPI0S6 |
                                           GPIO_PCTL_PH1_EPI0S7 |
                                           GPIO_PCTL_PH2_EPI0S1 |
                                           GPIO_PCTL_PH3_EPI0S0 |
                                           GPIO_PCTL_PH4_EPI0S10 |
                                           GPIO_PCTL_PH5_EPI0S11;

    //
    // GPIO Port J pins
    //
    HWREG(GPIO_PORTJ_BASE + GPIO_O_PCTL) = GPIO_PCTL_PJ0_EPI0S16 |
                                           GPIO_PCTL_PJ1_EPI0S17 |
                                           GPIO_PCTL_PJ2_EPI0S18 |
                                           GPIO_PCTL_PJ3_EPI0S19 |
                                           GPIO_PCTL_PJ4_EPI0S28 |
                                           GPIO_PCTL_PJ5_EPI0S29 |
                                           GPIO_PCTL_PJ6_EPI0S30;

    // Enable Clock for EPI & GPIO Ports

    // Configure the GPIO setting for the EPI pins.
    //SetPortControl();


    GPIODirModeSet(GPIO_PORTC_BASE,
                    (GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7),
                   GPIO_DIR_MODE_HW);

    GPIOPadConfigSet(GPIO_PORTC_BASE,
                    (GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7),
                     GPIO_PIN_TYPE_STD_WPU);

    GPIODirModeSet(GPIO_PORTD_BASE,
                   (GPIO_PIN_2 | GPIO_PIN_3),
                   GPIO_DIR_MODE_HW);

    GPIOPadConfigSet(GPIO_PORTD_BASE,
                     (GPIO_PIN_2 | GPIO_PIN_3),
                     GPIO_PIN_TYPE_STD_WPU);

    GPIODirModeSet(GPIO_PORTE_BASE,
                   (GPIO_PIN_0 | GPIO_PIN_1),
                   GPIO_DIR_MODE_HW);

    GPIOPadConfigSet(GPIO_PORTE_BASE,
                     (GPIO_PIN_0 | GPIO_PIN_1),
                     GPIO_PIN_TYPE_STD_WPU);

    GPIODirModeSet(GPIO_PORTF_BASE,
                   (GPIO_PIN_4 | GPIO_PIN_5),
                   GPIO_DIR_MODE_HW);

    GPIOPadConfigSet(GPIO_PORTF_BASE,
                     (GPIO_PIN_4 | GPIO_PIN_5),
                     GPIO_PIN_TYPE_STD_WPU);

    GPIODirModeSet(GPIO_PORTG_BASE,
                   (GPIO_PIN_0 | GPIO_PIN_1),
                   GPIO_DIR_MODE_HW);

    GPIOPadConfigSet(GPIO_PORTG_BASE,
                     (GPIO_PIN_0 | GPIO_PIN_1),
                     GPIO_PIN_TYPE_STD_WPU);

    GPIODirModeSet(GPIO_PORTH_BASE,
                   (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7),
                   GPIO_DIR_MODE_HW);

    GPIOPadConfigSet(GPIO_PORTH_BASE,
                     (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
                     GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7),
                     GPIO_PIN_TYPE_STD_WPU);

    GPIODirModeSet(GPIO_PORTJ_BASE,
                   (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6),
                   GPIO_DIR_MODE_HW);

    GPIOPadConfigSet(GPIO_PORTJ_BASE,
                     (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
                     GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6),
                     GPIO_PIN_TYPE_STD_WPU);




    // Set 8 Bit HostBus mode.
   EPIModeSet(EPI0_BASE, EPI_MODE_HB8);

    EPIDividerSet(EPI0_BASE, 0x1);

    // Address & Data are not muxed (ADNOMUX = 0x1).
    EPIConfigHB8Set(EPI0_BASE, (EPI_HB8_MODE_ADDEMUX | EPI_HB8_WRWAIT_0 | EPI_HB8_RDWAIT_0), 0);

    EPIAddressMapSet(EPI0_BASE, (EPI_ADDR_RAM_SIZE_64KB | EPI_ADDR_RAM_BASE_6) );

}

  • Hi Buzel,

    I am not familiar with the EPI module but looking at the code you shared, I think it should work under TI-RTOS. From the available info its hard to tell why the app crashed. You will need to debug a little to figure out what is causing the crash. My recommendation would be to read the LR register from the exception dump and put a breakpoint few instructions before the address pointed to by LR. After the breakpoint is hit, single step through the code to determine what caused the problem.

    Best,
    Ashish
  • Have you had any luck getting this to work? I have a failure on EPIDividerSet(EPI0_BASE,1).