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.

TMS320F28379D: Issue with the DELAY_US() function ILLEGAL_ISR

Part Number: TMS320F28379D

Tool/software:

Hello,

I have a problem with the DELAY_US() function, I have a program that generates interrupts every second and 2 seconds with the CpuTimer 0,1 and 2. Everything works as expected. I have added the DELAY_US function to the main loop, but no matter what value is added to the function, once the program is launched it stops without an error message. CCS refers me to F2837xD_DefaultISR.c on line 164:

interrupt void ILLEGAL_ISR(void)
{
    //
    // Insert ISR Code here
    //

    //
    // Next two lines for debug only to halt the processor here
    // Remove after inserting ISR Code
    //
    asm ("      ESTOP0");    (line 164)
    for(;;);
}

I tried to set the clock frequency to 200MHz in F2837xD_Examples but nothing happened, the problem is constant.

Do you have any leads? If you have any questions, please do not hesitate to contact me.

Thank you in advance,

Florentin 

#include "F28x_Project.h"
#include "driverlib.h"
#include "F2837xD_device.h"
#include "F2837xD_Adc_defines.h"

#include "device.h"
#include "math.h"
#include "string.h"
#include "stdlib.h"
#include "stdint.h"

#define _LAUNCHXL_F28379D

__interrupt void cpu_timer0_isr(void);
__interrupt void cpu_timer1_isr(void);
__interrupt void cpu_timer2_isr(void);
void ConfigurationADC(void);

int main(void)
{
    InitSysCtrl();
    InitGpio();

   // GPIO_SetupPinMux(65, GPIO_MUX_CPU1, 0);
   // GPIO_SetupPinOptions(65, GPIO_OUTPUT, GPIO_PUSHPULL);

    DINT;


    InitPieCtrl();

    IER = 0x0000;
    IFR = 0x0000;


    InitPieVectTable();

    EALLOW;  // This is needed to write to EALLOW protected registers
    PieVectTable.TIMER0_INT = &cpu_timer0_isr;
    PieVectTable.TIMER1_INT = &cpu_timer1_isr;
    PieVectTable.TIMER2_INT = &cpu_timer2_isr;
    EDIS;    // This is needed to disable write to EALLOW protected registers

    InitCpuTimers();   // For this example, only initialize the Cpu Timers

//
// Configure CPU-Timer 0, 1, and 2 to interrupt every second:
// 200MHz CPU Freq, 1 second Period (in uSeconds)
//
    ConfigCpuTimer(&CpuTimer0, 200, 2000000);
    ConfigCpuTimer(&CpuTimer1, 200, 1000000);
    ConfigCpuTimer(&CpuTimer2, 200, 1000000);

//
// To ensure precise timing, use write-only instructions to write to the
// entire register. Therefore, if any of the configuration bits are changed in
// ConfigCpuTimer and InitCpuTimers (in F2837xD_cputimervars.h), the below
// settings must also be updated.
//
    CpuTimer0Regs.TCR.all = 0x4000;
    CpuTimer1Regs.TCR.all = 0x4000;
    CpuTimer2Regs.TCR.all = 0x4000;

// Enable CPU int1 which is connected to CPU-Timer 0, CPU int13
// which is connected to CPU-Timer 1, and CPU int 14, which is connected
// to CPU-Timer 2:

    IER |= M_INT1;
    IER |= M_INT13;
    IER |= M_INT14;

// Enable TINT0 in the PIE: Group 1 interrupt 7
    PieCtrlRegs.PIEIER1.bit.INTx7 = 1;

// Enable global Interrupts and higher priority real-time debug events:
    EINT;  // Enable Global interrupt INTM
    ERTM;  // Enable Global realtime interrupt DBGM


    while(1)
    {
       DELAY_US(100);  


    }
}


void ConfigurationADC(void)
{
    EALLOW;
    AdcaRegs.ADCCTL2.bit.PRESCALE = 6;  //set ADDCLCK divider to 4
    AdcaRegs.ADCCTL2.bit.RESOLUTION = 0; //resolution de 12but mode, plus rapide    OU AdcSetMode(ADC_ADCA, 0, 0);
    AdcaRegs.ADCCTL2.bit.SIGNALMODE = 0; //Single-ended not differential
                                         //OU AdcSetMode(ADC_ADCA, 0, 0);   Pour RESOLUTION ET SIGNAL MODE  a la fois
    AdcaRegs.ADCCTL1.bit.INTPULSEPOS = 1; //set the pulse postion to late
    AdcaRegs.ADCCTL1.bit.ADCBSY = 1; // Power the ADC
    DELAY_US(1000);
}


__interrupt void cpu_timer0_isr(void)
{
   CpuTimer0.InterruptCount++;

   //
   // Acknowledge this interrupt to receive more interrupts from group 1
   //
   PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}

__interrupt void cpu_timer1_isr(void)
{
   CpuTimer1.InterruptCount++;
}


__interrupt void cpu_timer2_isr(void)
{
   CpuTimer2.InterruptCount++;
}