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.

RTOS/TMS320F28075: EALLOW/EDIS management in Tasks and interrupts

Part Number: TMS320F28075

Tool/software: TI-RTOS

Hi,

I'm using SYS/BIOS and I need to use EALLOW/EDIS in Hwi interrupt.

My concern is that EALLOW/EDIS sequence in Hwi interrupt can interfere with EALLOW/EDIS in Tasks (lower priority).

For instance, suppose this is the code in Task1:

    EALLOW;

    EPwm2Regs.TBCTL.bit.FREE_SOFT = 2;
    EPwm2Regs.TBCTL.bit.HSPCLKDIV = 0;
    EPwm2Regs.TBPRD = (PWM_CLOCK_FREQUENCY / VGATE_PWM_FREQUENCY) - 1;
    EPwm2Regs.CMPA.bit.CMPA = (EPwm2Regs.TBPRD >> 1);
    EPwm2Regs.AQCTLA.bit.CAU = 2;
    EPwm2Regs.AQCTLA.bit.PRD = 1;
    EPwm2Regs.DBCTL.bit.POLSEL = 2;
    EPwm2Regs.DBCTL.bit.OUT_MODE = 3;
    EPwm2Regs.DBRED.bit.DBRED = PWM_CLOCK_FREQUENCY / (1000000000/VGATE_PWM_DEAD_TIME);
    EPwm2Regs.DBFED.bit.DBFED = EPwm2Regs.DBRED.bit.DBRED;
    EPwm2Regs.TBCTL.bit.CTRMODE = 0;

    GpioCtrlRegs.GPAMUX1.bit.GPIO2 = 1;
    GpioCtrlRegs.GPAMUX1.bit.GPIO3 = 1;

    EDIS;

and this is the code in Hwi interrupt DmaFunction:

EALLOW;

DmaRegs.CONTROL.bit.RUN = 1;

EDIS;

If DmaFunction pre-empts Task1 just after the line

"    EPwm2Regs.AQCTLA.bit.PRD = 1;"

the EDIS instruction in DmaFunction disables the register access. So the other lines in Task1 has no effect!

I've seen that there are functions like Hwi_disable, Hwi_restore, Swi_disable, ecc. to avoid a similar problem with DINT/EINT.

Are there any functions like EALLOW_disable or EALLOW_restore (or something similar) to manage EALLOW bit safely in SYS/BIOS?

Thank you.

Best regards,

Demis