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.

CCS/TMS570LS1224: How to implement “prefetchEntry” ?

Part Number: TMS570LS1224

Tool/software: Code Composer Studio

At present, because the MPU protection is triggered, the program enters prefetchEntry, but I want to do some software reset operation after entering prefetchEntry. How to implement prefetchEntry?

  • Hi bj,

    You can issue the SW reset in prefetch ISR.
    1. change the sys_intvec.asm:
    .ref _prefetch_entry

    prefetchEntry
    b _prefetch_entry

    2. add one function in your sys_main.c or other place
    void _prefetch_entry(void);
    #pragma CODE_STATE(_prefetch_entry, 32)
    #pragma INTERRUPT(_c_int00, PABT)

    void _prefetch_entry(void)
    {
    //software reset
    systemREG1->SYSECR = (0x10) << 14;
    while(1);
    }
  • Thank you very much for your reply. I tested your code is ok, but can you explain to me what the following two codes actually do?

    #pragma CODE_STATE(_prefetch_entry, 32)
    #pragma INTERRUPT(_c_int00, PABT)

  • Hi BJ,

    You can ask the compiler to compile your function in 32-bit mode (ARM mode) or 16-bit mode (thumb mode) using

    #pragma CODE_STATE(func, 16 or 32)


    The INTERRUPT pragma enables you to handle interrupts directly with C code. The pragma specifies that the function is an interrupt. The type of interrupt is specified by the pragma; the IRQ interrupt type is assumed if none is given.

    #pragma INTERRUPT ( func, interrupt_type )

    There are 7 Interrupt types:

    DABT Data abort
    FIQ Fast interrupt request
    IRQ Interrupt request
    PABT Prefetch abort
    RESET System reset
    SWI Software interrupt
    UDEF Undefined instruction