ZHCZ028E October 2022 – July 2025 TMS320F2800132 , TMS320F2800133 , TMS320F2800135 , TMS320F2800137
受影响的版本:0、A、B、C
某些用于嵌套中断的代码序列允许 CPU 和 PIE 进入不一致状态,从而触发不必要的中断。进入该状态所需的条件为:
是否触发不必要的中断,取决于系统中其他中断的配置和时序。在大多数应用中,预计这种事件很罕见或根本不存在。如果发生这种情况,不必要的中断将是嵌套中断的 PIE 组中的第一个中断、并将在嵌套中断重新启用 CPU 中断(EINT 或 asm ("CLRC INTM"))后触发。
权变措施:在 PIEACK 写入和 CPU 中断使能之间添加一个 NOP(无操作)。以下显示了示例代码。
//Bad interrupt nesting code
PieCtrlRegs.PIEACK.all = 0xFFFF; //Enable nesting in the PIE
EINT; //Enable nesting in the CPU
//Good interrupt nesting code
PieCtrlRegs.PIEACK.all = 0xFFFF; //Enable nesting in the PIE
asm(" NOP"); //Wait for PIEACK to exit the pipeline
EINT; //Enable nesting in the CPU