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.

[参考译文] TMS320F28069:F28069运行时间和加电行为在各种芯片之间不一致

Guru**** 2562560 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips

器件型号:TMS320F28069

大家好、  

我们正在开始制造一个使用 F28069U 作为中央 DSP 的控制板、我们已经完成了对原型的测试、然后开始主要生产、 我们制造了12个器件、只是为了了解它们的行为、我们对此感到非常惊讶、几乎所有12个电路板都显示了加电过程中的不一致性、问题的详细信息如下所示:

我们的系统可以随时以任何频率打开(如每2秒或更长时间打开/关闭),现在我们的代码在这些板上运行, 我们随机尝试打开和关闭它们、大多数情况下代码在加电后立即启动、如果代码未冻结、板上会有一个 LED 闪烁(我们当然检查了所有其他功能)、 但是、假设10次中有2次、DSP 不会启动、它们会保持冻结、LED 也会保持关闭、直到我们必须再次循环通电。  
在电源回收后、它们大多开始重新工作、但有时需要多次电源回收、直到 DSP 能够再次启动...

到目前为止、这种行为从未在具有完全相同电路和组件的原型中出现(12个板是其克隆)!

考虑到这一大难题、我们开始调查导致问题的原因、我首先检查电压、启动时的瞬变等、但一切似乎都很好、一旦 DSP 被冻结、电源瞬变中就没有电流下降或异常行为。 (XRS 始终保持高电平,我认为这似乎表明没有欠压或其他与电源相关的问题,...)

之后、我要检查代码、我找到了一个非常奇怪的东西、那就是 DSP 在生产中在以下函数中失败:

void enable_interrupts()
{

      EALLOW;
      PieVectTable.ADCINT1 = &ADCINT1_isr; /* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER1.bit.INTx1 = 1;   /* Enable interrupt ADCINT1*/
      IER |= M_INT1;
      EALLOW;
      PieVectTable.EQEP1_INT = &EQEP1_INT_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER5.bit.INTx1 = 1;   /* Enable interrupt EQEP1_INT*/
      IER |= M_INT5;
      EALLOW;
      PieVectTable.SCIRXINTA = &SCIRXINTA_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER9.bit.INTx1 = 1;   /* Enable interrupt SCIRXINTA*/
      IER |= M_INT9;
      EALLOW;
      PieVectTable.ECAP1_INT = &ECAP1_INT_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER4.bit.INTx1 = 1;   /* Enable interrupt ECAP1_INT*/
      IER |= M_INT4;
      EALLOW;
      PieVectTable.ECAP2_INT = &ECAP2_INT_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER4.bit.INTx2 = 1;   /* Enable interrupt ECAP2_INT*/
      IER |= M_INT4;
      EALLOW;
      PieVectTable.ECAP3_INT = &ECAP3_INT_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER4.bit.INTx3 = 1;   /* Enable interrupt ECAP3_INT*/
      IER |= M_INT4;
      EALLOW;
      PieVectTable.ECAN0INTA = &ECAN0INTA_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER9.bit.INTx5 = 1;   /* Enable interrupt ECAN0INTA*/
      IER |= M_INT9;

//  EALLOW;
//  PieVectTable.ADCINT1 = &ADCINT1_isr; /* Hook interrupt to the ISR*/
//  PieVectTable.EQEP1_INT = &EQEP1_INT_isr;/* Hook interrupt to the ISR*/
//  PieVectTable.SCIRXINTA = &SCIRXINTA_isr;/* Hook interrupt to the ISR*/
//  PieVectTable.ECAP1_INT = &ECAP1_INT_isr;/* Hook interrupt to the ISR*/
//  PieVectTable.ECAP2_INT = &ECAP2_INT_isr;/* Hook interrupt to the ISR*/
//  PieVectTable.ECAP3_INT = &ECAP3_INT_isr;/* Hook interrupt to the ISR*/
//  PieVectTable.ECAN0INTA = &ECAN0INTA_isr;/* Hook interrupt to the ISR*/
//  EDIS;
//
//  PieCtrlRegs.PIEIER1.bit.INTx1 = 1;   /* Enable interrupt ADCINT1*/
//  IER |= M_INT1;
//  PieCtrlRegs.PIEIER5.bit.INTx1 = 1;   /* Enable interrupt EQEP1_INT*/
//  IER |= M_INT5;
//  PieCtrlRegs.PIEIER9.bit.INTx1 = 1;   /* Enable interrupt SCIRXINTA*/
//  IER |= M_INT9;
//  PieCtrlRegs.PIEIER4.bit.INTx1 = 1;   /* Enable interrupt ECAP1_INT*/
//  IER |= M_INT4;
//  PieCtrlRegs.PIEIER4.bit.INTx2 = 1;   /* Enable interrupt ECAP2_INT*/
//  IER |= M_INT4;
//  PieCtrlRegs.PIEIER4.bit.INTx3 = 1;   /* Enable interrupt ECAP3_INT*/
//  IER |= M_INT4;
//  PieCtrlRegs.PIEIER9.bit.INTx5 = 1;   /* Enable interrupt ECAN0INTA*/
//  IER |= M_INT9;

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

}

准确的故障点是当代码将 ECAP1与 ISR 挂钩时:  

EALLOW;
PieVectTable.ECAP1_INT =&ECAP1_INT_ISR;/*将中断钩到 ISR*/
EDIS;

在故障 DSP 中的这段代码之后、系统进入停止或冻结模式(偶尔也不总是)、我通过启用另一个 GPIO 找到了这一点、我在这里跟踪了问题、因为我的代码现在通过引导加载程序从闪存运行 (为 DFUprog 编写的 USB 引导加载)、现在我将介绍一些其他重要观察结果:

  1. 我们的控制卡没有本地安装的 JTAG、因此每当 DSP 冻结时、在我连接 JTAG 后、它们就会恢复正常运行!! LED 开始闪烁、看起来一切都很棒、而且只要 JTAG 在电路中、代码就永远不会失败...

  2. 我尝试使用我们的看门狗、重点是看门狗、每当发生故障时、都会不断复位板、但在我完全回收功率之前、它永远无法将其恢复到正常运行状态(我们使用的是软件看门狗、而不是 NMI)

  3. 在电路板上、我们没有从外部上拉 GPIO 34或 TDO。 (我检查过、即使是外部上拉电阻也没有区别、似乎问题不在于引导模式选择...)
  4. 为了消除引导加载程序的影响、我将其删除、并使代码成为独立代码、只是为了确保引导加载程序不会导致问题、并且在没有引导加载程序的情况下、代码偶尔会在同一个位置停止、而不是始终停止(我希望始终如此)

  5. 我在这里为您附上了我们系统的链接器命令文件。

下面是刻在 F28069U 故障和工作状态上的序列号:

F28069UPNT - G4A - 08AFXHW - G4有故障
工作: F28069UPNT - G4A - 99C4EXW - G4

我找不到方法来跟踪这些芯片的生产日期、但在我看来、由于一些猜测、故障芯片的版本较旧、如第3部分中所述、它以零开始...

那么、现在的问题是:

这是硬件问题还是软件问题、以及如何解决?  

提前感谢
John

e2e.ti.com/.../c28069_5F00_CLA_5F00_BL.zip

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    只是一个更新:

    今天、我将其中一个电路板上的 DSP 更改为新的 DSP、并且启动问题仍然存在(如上所述、偶尔出现启动故障)。

    谢谢
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips "]而准确的故障点是代码将 ECAP1与 ISR 挂钩时为: 

    尊敬的 John:

    在 PIE 中连接并启用中断之前、eCAP ISR 是否已从闪存复制到 RAM?

    我的思路是、可能需要设置一些有时不按计划进行的事情。  我想 在"不起作用"的情况下、在全部设置完成之前、可能会检测到 eCAP 事件(在设置期间通过 GPIO 上的一些干扰)。  在这种情况下、ISR 将在 PIE 中启用后立即执行。  因此、系统需要在这种情况发生之前准备就绪。 实验可能会在 PIE 中启用之前清除任何挂起的 eCAP 中断。   

    -洛里

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Lori、  

    我相信是的,因为主函数的第一件事是通过 C2000_flash_init()函数将闪存的内容复制到 RAM 中,如下所示:

    void c2000_flash_init(void)
    {
      #if MW_RUNTIME_FLASHLOAD
      // Copy InitFlash function code and Flash setup code to RAM
      memcpy(& RamfuncsRunStart,&RamfuncsLoadStart, (Uint32)(&RamfuncsLoadEnd-&RamfuncsLoadStart));
      #ifdef CLA_BLOCK_INCLUDED
        memcpy(&Cla1funcsRunStart, &Cla1funcsLoadStart, (Uint32)&Cla1funcsLoadSize);
        memcpy(&Cla1mathTablesRunStart, &Cla1mathTablesLoadStart, (Uint32)&Cla1mathTablesLoadSize);
      #endif
      // Call Flash Initialization to setup flash waitstates
      // This function must reside in RAM
      InitFlash();
      #endif
    }

    main 中的代码如下所示:

    int main(void)
    {
      float modelBaseRate = 0.001;
      float systemClock = 90;
    
      /* Initialize variables */
      stopRequested = false;
      runModel = false;
    
      CsmUnlock();
    
      c2000_flash_init();
      init_board();
      initialize(); //initialize global variables, activation of USB clock
      configureADCINT1();
      enableADCInterrupt1();
      enable_interrupts(); //here ECAP gets activated
      initWatchdog();
      globalInterruptEnable();
      while (runModel) {
        stopRequested = !(
                          rtmGetErrorStatus(V001_M) == (NULL));
      }
    
      /* Disable rt_OneStep() here */
    
      /* Terminate model */
      terminate();
      globalInterruptDisable();
      return 0;
    }

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3837359 #3837359"]一个实验可能会在 PIE 中启用任何挂起的 eCAP 中断之前将其清除。   [/报价]

    那么、在本例中、您意味着我延迟 ECAP 中断或其他中断的激活? 如何知道 ECAP 中断正在挂起?

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3837369 #3837369"]我认为是的,因为主函数中的第一件事是通过 c2000_flash_init ()将闪存的内容复制到 RAM。

    好的、 我的冲头可能无效。  我还看到 globalInterruptEnable()被稍后调用 -直到该位置才会产生实际中断。

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3837369 #3837369]\n 那么、在这种情况下、您是指我延迟 ECAP 中断激活还是其他中断的激活? 如何知道 ECAP 中断正在挂起?[/quot]

    此时(在系统真正开始运行之前)、您可以清除 PIEIFR 寄存器和 CPU 的 IFR 寄存器。  这将清除任何挂起的中断。

    注意:在运行时、您通常不会这样做、因为它可能会导致丢失的中断。   但是、也许值得尝试一下、看看它是否会改变行为并提供一些线索。  

    我将重新阅读所有信息、并有几个问题-

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3836965 #3836965"]今天我将其中一个主板上的 DSP 更改为新的 DSP,并且启动问题仍然存在[/quot]

    问题出在主板上还是出在设备上?  即

    • 新器件是否是已知的"正常工作"DSP? 它是否在 A 板上工作、而不是在 P 板上工作(问题出在 P 板上)。   

    如果问题是电路板或器件、这将有助于缩小范围。   

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips ]为了消除引导加载程序的影响、我删除了它、并使代码独立、只是为了确保引导加载程序不会导致问题、 同样、如果没有引导加载程序、代码偶尔会在同一个位置停止、而不是始终停止(我希望始终如此)[/quot]

    如果代码没有在同一个位置停止、那么它可能与那个 eCAP ISR 无关。  我以前没收到过这个。  

    我开始更加注重电路板问题、而不是代码问题。  

    总结和一些问题:

    1. 未在所有电路板上看到问题。
      1. 如果闪存映像完全相同、则会降低链接器命令文件出现问题的可能性。
    2. 问题是间歇性的。   
    3. 失败签名会有所不同-即 CPU 在不同的位置停止执行。
    4. 看门狗  
    5. 连接 JTAG 后问题消失。  
    6. 电路板上电/断电后出现问题。
      1. 请根据数据表要求仔细检查设计的电源定序
      2. 如果您在断电/上电之间等待更长时间、行为是否不同?  
    7. 什么是引导模式?
      1. 您提到 TDO 和 GPIO34为高电平、所以 您使用的是 Get 模式?  
      2. 您提到 TDO/GPIO34上的外部上拉电阻器不会改变行为。   
    8. 是否存在任何温度相关性-即根据环境温度、行为是否会变得越来越好?
    9. 故障器件是否感觉"热"或比正常工作的器件更暖?  
    10. 问题出在特定的器件还是特定的电路板上?   
      1. 您提到了潜在的序列号绑定
    11. 请仔细检查器件勘误表、以了解可能适用于特定设计的任何问题。
    12. 您提到了检查时钟和电源。  
      1. 在发现问题之前、请仔细检查以确保没有功率下降。   
      2. 根据数据表检查加电排序   
    13. TRSTn 是否具有外部2.2k Ω(或更低)电阻器?
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    你好 ,  
    在您昨天的想法之后、"在全部完成设置之前、可能会检测到 eCAP 事件(在设置期间通过 GPIO 上的一些干扰)"、并且由于我们的 eCAP 确实连接到 GPIO 以感应霍尔传感器信号、我继续执行以下操作: 将除 ADC 中断之外的所有中断放在 while 循环的前面、如下 所示 Interrupt_Activation_AUX ()函数:

    int main(void)
    {
      float modelBaseRate = 0.001;
      float systemClock = 90;
    
      /* Initialize variables */
      stopRequested = false;
      runModel = false;
    
      CsmUnlock();
    
      c2000_flash_init();
      init_board();
    
      bootloaderInit();
      rtmSetErrorStatus(V001_M, 0);
      initialize();
      configureADCINT1();
      enableADCInterrupt1();
      enable_interrupts();
      initWatchdog();
      globalInterruptEnable();
    
      Interrupt_Activation_AUX();
    
      while (runModel) {
        stopRequested = !(
                          rtmGetErrorStatus(V001_M) == (NULL));
      }

     Interrupt_Activation_AUX()具有以下形式:

    void Interrupt_Activation_AUX()
    {
    
      DINT;
      IER &= 0xC001;
      IFR &= 0xC001; //clearing pending interrupts except ADC,...
      EALLOW;
      PieVectTable.EQEP1_INT = &EQEP1_INT_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER5.bit.INTx1 = 1;   /* Enable interrupt EQEP1_INT*/
      IER |= M_INT5;
      EALLOW;
      PieVectTable.SCIRXINTA = &SCIRXINTA_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER9.bit.INTx1 = 1;   /* Enable interrupt SCIRXINTA*/
      IER |= M_INT9;
      EALLOW;
      PieVectTable.ECAP1_INT = &ECAP1_INT_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER4.bit.INTx1 = 1;   /* Enable interrupt ECAP1_INT*/
      IER |= M_INT4;
      EALLOW;
      PieVectTable.ECAP2_INT = &ECAP2_INT_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER4.bit.INTx2 = 1;   /* Enable interrupt ECAP2_INT*/
      IER |= M_INT4;
      EALLOW;
      PieVectTable.ECAP3_INT = &ECAP3_INT_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER4.bit.INTx3 = 1;   /* Enable interrupt ECAP3_INT*/
      IER |= M_INT4;
      EALLOW;
      PieVectTable.ECAN0INTA = &ECAN0INTA_isr;/* Hook interrupt to the ISR*/
      EDIS;
      PieCtrlRegs.PIEIER9.bit.INTx5 = 1;   /* Enable interrupt ECAN0INTA*/
      IER |= M_INT9;
    
      EINT;
    }

    这样做后、我看到问题基本上消失了、只要 ADC 中断被施加到"全速"状态、一切看起来都正常、但为了解释我所谓的"全速"、我应该说、我们的 ADC 中断与 ePWM1输出同步、 我们的系统 在 ePWM1上的频率可以介于7到90kHz 之间。

    一旦 PWM 频率远高于40kHz、我在启动时没有发现任何问题、但当我们进一步将其降低到20kHz 等值时、我会看到 ADC 中断偶尔会冻结(之前的问题在启动时再次出现、它会冻结)。

    在我们的环境中、我们可以达到的来自 ADC1的最大采样率大约为35微秒或接近30kHz (我们的运行时采样率)、所有代码都放置在 ADC1中断中。

    我可以说、ADC 中断冻结、因为它不会触发内部的看门狗、这是我们唯一复位看门狗的地方、看门狗会继续复位 DSP (发生故障后、DSP 永远不会恢复并保持自身复位)。

    因此、在我看来、ADC 中断在某种程度上失败(可能溢出或 STH)、并且它永远不会恢复。

    最奇怪的是、看门狗复位后问题不会消失、ADC 似乎不会自行重新初始化。

    我尝试在 main()函数的初始化部分中添加以下代码,以在复位后清除 ADC1中的溢出标志,但它没有帮助:

      if (AdcRegs.ADCINTOVF.all != 0){
          AdcRegs.ADCINTFLGCLR.all = 0x1FF;
          AdcRegs.ADCINTOVFCLR.all = 0x1FF;
      }

    要回答上述问题:

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3837662 #3837662]\n 如果您在断电/上电之间等待更长时间、则行为会有所不同?  [/报价]

    是的、它肯定表现出更好的行为、比如3秒的等待确实没有问题。

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3837662 #3837662"]什么是引导模式?

    它从闪存引导

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3837662 #3837662"]是否存在任何温度依赖性-即根据环境温度、行为是否会变得越来越好或越来越差?

    不清楚或测量(我觉得它是独立的)

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3837662 #3837662")问题出在特定的器件或特定的电路板上吗?  [/报价]

    几乎我们在所有板上都看到了这一点。

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3837662 #3837662"]仔细检查以确保在发现问题之前没有断电。   [/报价]

    如之前所述、电源稳定。

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3837662 #3837662"] TRSTn 是否具有外部2.2k 欧姆(或更低)电阻器?[/quot]

    是的、它在 XRS 引脚上有一个2.2k 连接至3.3V 的电压、并且有一个0.1uF 的电容。

    我将等待您的想法。
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    John、

    是否涉及任何中断嵌套?

     PIE 中是否为每个中断安装了 ISR?  在我们的示例 SW 中、我们有用于初始化整个 PIE 矢量表的代码-即使它们未在系统中使用。  它可以帮助捕捉 CPU 进入杂草。   

    是否确实在连接 JTAG 的情况下从未发生此问题?   

    我还要求一位同事查看案例、看看他们是否有其他关于检查内容的建议。  

    -洛里

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3838799 #3838799"]是否涉及任何中断嵌套?

    我不确定这一点、我们当然会给 ADC1分配一个非抢先式中断、下面是 ADC1中断的初始化函数:

    interrupt void ADCINT1_isr(void)
    {
      volatile unsigned int PIEIER1_stack_save = PieCtrlRegs.PIEIER1.all;
      PieCtrlRegs.PIEIER1.all &= ~1;
                                  /*disable group1 lower/equal priority interrupts*/
      asm(" RPT #5 || NOP");               /*wait 5 cycles        */
      IFR &= ~1;      /*eventually disable lower/equal priority pending interrupts*/
      PieCtrlRegs.PIEACK.all = 1;
                       /*ACK to allow other interrupts from the same group to fire*/
      IER |= 1;
      EINT;                                /*global interrupt enable*/
      isr_int1pie1_task_fcn();
      DINT;
      /* disable global interrupts during context switch, CPU will enable global interrupts after exiting ISR    */
      PieCtrlRegs.PIEIER1.all = PIEIER1_stack_save;
                                       /*restore PIEIER register that was modified*/
      EALLOW;
      AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
      EDIS;
      PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
                                         /* Acknowledge to receive more interrupts*/
    }

    configureADCINT1 (void)类似于:

    void configureADCINT1(void)
    {
    	EALLOW;
    	PieVectTable.ADCINT1 = &SEQ1INT_isr;     /* Hook interrupt to the ISR*/
    	EDIS;
    
    	PieCtrlRegs.PIEIER1.bit.INTx1 = 1;   /* Enable interrupt ADCINT1 */
    	IER |= M_INT1;
    }

     SEQ1INT_ISR()类似于:

    interrupt void SEQ1INT_isr(void)
    {
        volatile unsigned int PIEIER1_stack_save = PieCtrlRegs.PIEIER1.all;
        PieCtrlRegs.PIEIER1.all &= ~PIEMASK0;      /* disable group1 lower/equal priority interrupts */
        asm(" RPT #5 || NOP");               /* wait 5 cycles */
        IFR &= ~IFRMASK;                           /* eventually disable lower/equal priority pending interrupts */
        PieCtrlRegs.PIEACK.all = IFRMASK;          /* ACK to allow other interrupts from the same group to fire */
        IER |= 1;
        EINT;                                /* global interrupt enable */
        DINT;                                /* disable global interrupts during context switch, CPU will enable global interrupts after exiting ISR */
      AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
      PieCtrlRegs.PIEIER1.all = PIEIER1_stack_save;/*restore PIEIER register that was modified */
    
    }

    enableADCInterrupt1()如下所示:

    void enableADCInterrupt1(void)
    {
    	asm(" SETC INTM"); /* Disable Interrupt Global Enable Bit - set it to 1 */
    	PieCtrlRegs.PIEIER1.all |= 1; /* Enable PIER bit for ADCINT1 */
    	asm(" CLRC INTM"); /* Enable Interrupt Global Enable Bit - set it to 0 */
    }

    ADC 中断初始化调用的顺序为:

    1- configureADCINT1()=>调用 SEQ1INT_ISR()

    2- enableADCInterrupt1()

    3- enable_interrupts ()=>启用 ADC 中断及其 ISR

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3838799 #3838799") PIE 中是否为每个中断安装了 ISR?  在我们的示例 SW 中、我们有用于初始化整个 PIE 矢量表的代码-即使它们未在系统中使用。  它可以帮助捕捉 CPU 进入杂草。[/quot]

    如果你是指 CPU 中的每个可能的中断、我应该说不、我相信只有使用过的中断被初始化、其余中断没有、如果我能找到这个示例、我将检查这个示例(我希望在 C2000示例中...)

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3838799 #3838799")是否确实连接了 JTAG,但问题永远不会发生?   [/报价]

    是的、连接 JTAG 后、即使在 CPU 冻结的情况下、问题也不会发生、只要我连接 JTAG、CPU 就会恢复正常运行 (即使复位 Micro 也不会使其恢复正常运行、并且它仍然会冻结或不断被看门狗复位)

     我将等待您对这些 ADC 中断初始化的看法。

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    John、

    代码是嵌套中断-这由 ADC ISR 开始时的代码完成-它启用在 ADC ISR 运行时要处理的较低优先级中断。

    我之所以问这一点、是因为有一些相当严格的中断嵌套指南、如果不遵循这些指南、可能会导致问题。  由于您看到的行为与中断速率有关、因此这是一个要遵循的路径、可以查看它是否产生任何结果。  

    请参阅

    特别是以下注意事项:

    我想知道是否可以在 ISR 外部调用 void enableADCInterrupt1 (void)代码。  

    为每个中断添加一个中断处理程序可以在 发生此问题时帮助捕捉此问题、并且还可以防止 PC 进入到工作环境中。  特别是、即使 未启用或未使用中断、也可以触发每个组中的中断1 (即 INTx.1)。   它可以是所有未使用的矢量指向的一个实际 ISR。  这就是我们的示例在默认 ISR 设置例程中所做的操作。  

    此致

    Lori

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Lori、  

    跟进您的建议:

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3839235 #3839235">为每个中断添加中断处理程序有助于在 发生中断时捕捉此问题、同时防止 PC 进入到杂草中。  特别是、即使 未启用或未使用中断、也可以触发每个组中的中断1 (即 INTx.1)。   它可以是所有未使用的矢量指向的一个实际 ISR。  这就是我们的示例在默认 ISR 设置例程中所做的操作。  [/报价]

    我为所有未使用的中断添加了一个 ISR、并且我看到我没有捕获任何中断(我通过激活将一些活动中断连接到陷阱来检查函数、我看到它捕获了这些中断)、中断陷阱 如下所示:

    interrupt void ILLEGAL_isr(void)
    {
        GpioDataRegs.GPBSET.bit.GPIO39 = 1;
    
        //IFR &= 0x0000; //disable all interrupts
        //PieCtrlRegs.PIEACK.all = 0x0FFF;
    
        /* Acknowledge to receive more interrupts*/
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP2;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP4;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP5;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP6;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP7;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP8;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP9;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP10;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP11;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP12;
    
        return;
    }
    
    void hook_illegal_interrupts()
    {
        //DELAY_US(3000);                      // wait 3ms for the board to stabilize
        /* Disable and clear all CPU interrupts */
        //DINT;
        //IER &= 0xC001;
        //IFR &= 0xC001;
        EALLOW;
    //INTx.1 group
        PieVectTable.EPWM1_TZINT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM1_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.SPIRXINTA = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.DINTCH1 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.I2CINT1A = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.CLA1_INT1 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.XINT3 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
    
    //INTx.2 group
        PieVectTable.ADCINT2 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM2_TZINT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM2_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EQEP2_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.SPITXINTA = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.DINTCH2 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.I2CINT2A = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.SCITXINTA = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.ADCINT2 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.CLA1_INT2 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
    
    //INTx.3 group
        PieVectTable.EPWM3_TZINT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM3_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.SPIRXINTB = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.DINTCH3 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.SCIRXINTB = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.ADCINT3 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.CLA1_INT3 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
    
    //INTx.4 group
        PieVectTable.XINT1 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM4_TZINT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM4_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.HRCAP3_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.SPITXINTB = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.DINTCH4 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.SCITXINTB = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.ADCINT4 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.CLA1_INT4 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
    
    //INTx.5 group
        PieVectTable.XINT2 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM5_TZINT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM5_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.HRCAP4_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.MRINTA = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.DINTCH5 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.ADCINT5 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.CLA1_INT5 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
    
    //INTx.6 group
        PieVectTable.ADCINT9 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM6_TZINT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM6_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.MXINTA = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.DINTCH6 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.ECAN1INTA = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.ADCINT6 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.CLA1_INT6 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
    
    //INTx.7 group
        PieVectTable.TINT0 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM7_TZINT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM7_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.HRCAP1_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.ADCINT7 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.CLA1_INT7 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.LVF = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
    
    //INTx.8 group
        PieVectTable.WAKEINT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM8_TZINT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.EPWM8_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.HRCAP2_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        //PieVectTable.USB0_INT = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.ADCINT8 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.CLA1_INT8 = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
        PieVectTable.LUF = &ILLEGAL_isr; /* Hook interrupt to the ISR*/
    
        EDIS;
    }

    因此、现在我知道我没有任何非法或未初始化的中断会导致问题、我将重点放在嵌套问题上、例如、如果我按如下方式更改 ADC 中断 ISR、 问题将会消失、但其他中断将不起作用、因为 ADC 中断是非抢先式中断、具有我认为最高优先级的中断:

    interrupt void ADCINT1_isr(void)
    {
      volatile unsigned int PIEIER1_stack_save = PieCtrlRegs.PIEIER1.all;
      volatile unsigned int PIEIER4_stack_save = PieCtrlRegs.PIEIER4.all;
      volatile unsigned int PIEIER5_stack_save = PieCtrlRegs.PIEIER5.all;
      volatile unsigned int PIEIER9_stack_save = PieCtrlRegs.PIEIER9.all;
      PieCtrlRegs.PIEIER1.all &= ~1;
                                  /*disable group1 lower/equal priority interrupts*/
      PieCtrlRegs.PIEIER4.all &= ~7;
                                  /*disable group4 lower/equal priority interrupts*/
      PieCtrlRegs.PIEIER5.all &= ~1;
                                  /*disable group5 lower/equal priority interrupts*/
      PieCtrlRegs.PIEIER9.all &= ~17;
                                  /*disable group9 lower/equal priority interrupts*/
      asm(" RPT #5 || NOP");               /*wait 5 cycles        */
      IFR &= ~281;    /*eventually disable lower/equal priority pending interrupts*/
      PieCtrlRegs.PIEACK.all = 281;
                       /*ACK to allow other interrupts from the same group to fire*/
      IER |= 1;
      EINT;                                /*global interrupt enable*/
      isr_int1pie1_task_fcn();
      DINT;
      /* disable global interrupts during context switch, CPU will enable global interrupts after exiting ISR    */
      PieCtrlRegs.PIEIER1.all = PIEIER1_stack_save;
                                       /*restore PIEIER register that was modified*/
      PieCtrlRegs.PIEIER4.all = PIEIER4_stack_save;
                                       /*restore PIEIER register that was modified*/
      PieCtrlRegs.PIEIER5.all = PIEIER5_stack_save;
                                       /*restore PIEIER register that was modified*/
      PieCtrlRegs.PIEIER9.all = PIEIER9_stack_save;
                                       /*restore PIEIER register that was modified*/
      EALLOW;
      AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
      EDIS;
      PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
                                         /* Acknowledge to receive more interrupts*/
    }

    所以、现在人们强烈猜测嵌套会导致问题、但我无法修复问题、使用嵌套 ADC ISR 就像上一篇文章中所示、但对于您的建议的这一部分、我没有得到您的意思是什么?

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3839235 #3839235">我想知道是否可以在 ISR 外部调用代码 void enableADCInterrupt1 (void)。  [/报价]

    此函数已在 ISR 外部....

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3839235 #3839235">此处的信息: https://software-dl.ti.com/C2000/docs/c28x_interrupt_nesting/html/index.html

    基于此、用户绝不应在 同一组的 ISR 外部接触 PIEIERx 寄存器、但使用 enableADCInterrupt1 (void)更改 PIEIER1、这似乎与指南建议的内容相矛盾、但现在如何激活 ISR 本身内部的中断?  

    我的意思是、我们不应该先激活中断、然后再对其进行处理? 现在、该过程似乎逆转了。。。

    因此、我在这部分迷路了、我们非常感谢您的帮助。

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    John、

     在嵌套 ISR 信息链接中、有以下注意事项:

    不要在该组的 ISR 之外修改 PIEIER 寄存器。 例如、PIEIER1只能在组1的 ISR 内进行修改。 同样、仅应在组2 ISR 内修改 PIEIER2。

    参考您的上一篇文章- ADC ISR 位于 PIE 组1 (TRM 中参考 PIE 中断矢量表3-5)中、但代码也正在修改其他组 PIEIER 寄存器(组4、组5、组9)。  这违反了警告。  

    我在您之前的代码中看不到这一点、因此我认为 我的评论引起了一些困惑。  


    PieCtrlRegs.PIEIER4.ALL &=~7;
    /*禁用组4低/相等优先级中断*/
    PieCtrlRegs.PIEIER5.ALL &=~1;
    /*禁用组5低/相等优先级中断*/
    PieCtrlRegs.PIEIER9.ALL &=~17;
    /*禁用组9低/相等优先级中断*/

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3840062 #3840062"]
    我想知道是否可以在 ISR 外部调用 void enableADCInterrupt1 (void)代码。  

    此函数已在 ISR 外部....

    [/报价]

    该函数修改 PIEIER1。  它可以在初始化期间(在中断开始之前)调用、也可以作为嵌套方案的一部分从组1中断调用。 如果在运行时从组5 ISR 或随机函数的中间调用它、则会违反警告。  

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3840062 #3840062">基于此、用户绝不应在 同一组的 ISR 外部触摸 PIEIERx 寄存器、而应使用 enableADCInterrupt1 (void)更改 PIEIER1、这似乎与指南建议的内容相矛盾、 但是、现在如何激活 ISR 本身内部的中断?  [/报价]

    初始系统设置-在中断启动之前- PIEIER 寄存器可自由配置。  一旦中断开始、只能在组 x ISR 内修改 PIEIERx 寄存器。   

    原因:当 CPU 为组 x 中的 ISR 提供服务时、PIE 将暂停组 x 中的其他中断、直到 PIEACK 由 CPU 完成。  在此期间、可以修改 PIEIERx、因为不会有额外的组 x 中断传递到 CPU 的 IFR x   

    如果(在同一组 x 中断中)而不是 PIEIERy 被修改、并且 PIEACK 没有挂起 CPU 的组 y 中断、则可能会出现 TRM 中所述的竞态条件。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Lori、

    [引用 userid="3469" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3840403 #38404040403]\n 该函数修改 PIEIER1。  它可以在初始化期间(在中断开始之前)调用、也可以作为嵌套方案的一部分从组1中断调用。 如果在运行时从组5 ISR 或随机函数的中间调用它、则会违反警告。  [/报价]

    将此函数放在中断激活之前没有任何帮助、顺便说一下、我将代码恢复为旧版本、ADC ISR 现在就像这样:

    interrupt void ADCINT1_isr(void)
    {
    
        volatile unsigned int PIEIER1_stack_save = PieCtrlRegs.PIEIER1.all;
        PieCtrlRegs.PIEIER1.all &= ~1;
        /*disable group1 lower/equal priority interrupts*/
        asm(" RPT #5 || NOP");
        /*wait 5 cycles        */
        IFR &= ~1; /*eventually disable lower/equal priority pending interrupts*/
        PieCtrlRegs.PIEACK.all = 1;
        /*ACK to allow other interrupts from the same group to fire*/
        IER |= 1;
        EINT;
        /*global interrupt enable*/
        isr_int1pie1_task_fcn();
        DINT;
        /* disable global interrupts during context switch, CPU will enable global interrupts after exiting ISR    */
        PieCtrlRegs.PIEIER1.all = PIEIER1_stack_save;
        /*restore PIEIER register that was modified*/
        EALLOW;
        AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
        EDIS;
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
        /* Acknowledge to receive more interrupts*/
    }

    显然、问题在于嵌套、但我不知道如何跟踪问题...

    我们高度赞赏您对这方面的任何想法。

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    John、

    上面代码中的序列与嵌套指南中的序列不匹配。  例如、PIEACK 和 EINT 之间没有 NOP。。。

    您可以使用完全相同的序列尝试吗?   

    // // C28x ISR Code // // Enable nested interrupts // // interrupt
    void EPWM1_TZINT_ISR(void)
    {
            uint16_t TempPIEIER;
            TempPIEIER = PieCtrlRegs.PIEIER2.all; // Save PIEIER register for later
            IER |= 0x002;                         // Set global priority by adjusting IER
            IER &= 0x002;
            PieCtrlRegs.PIEIER2.all &= 0x0002;    // Set group priority by adjusting PIEIER2 to allow INT2.2 to interrupt current ISR
            PieCtrlRegs.PIEACK.all = 0xFFFF;      // Enable PIE interrupts
            asm("       NOP");                    // Wait one cycle
            EINT;                                 // Clear INTM to enable interrupts
            //
            // Insert ISR Code here.......
            // for now just insert a delay
            //
            for(i = 1; i <= 10; i++) {}
            //
            // Restore registers saved:
            //
            DINT;
            PieCtrlRegs.PIEIER2.all = TempPIEIER;
    }

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Lori、  

    如果使用完全相同的过程、您意味着以下函数、很遗憾、我应该说它不起作用、并且根本不会触发 ADC ISR ...

    interrupt void ADCINT1_isr(void)
    {
        volatile unsigned int PIEIER1_stack_save = PieCtrlRegs.PIEIER1.all;
        IER |= 0x001;                         // Set global priority by adjusting IER
        IER &= 0x001;
        PieCtrlRegs.PIEIER1.all &= 0x0001;    // Set group priority by adjusting PIEIER1 to allow INT1.1 to interrupt current ISR
        PieCtrlRegs.PIEACK.all = 0xFFFF;      // Enable PIE interrupts
        asm("       NOP");                    // Wait one cycle
        EINT;                                 // Clear INTM to enable interrupts
        isr_int1pie1_task_fcn();
        DINT;
        PieCtrlRegs.PIEIER1.all = PIEIER1_stack_save;
    
    }

    在这种情况下、您是否认为 SEQ1INT_ISR (void)在将 ADC ISR 连接到中断之前发挥了任何作用?

    interrupt void SEQ1INT_isr(void)
    {
        volatile unsigned int PIEIER1_stack_save = PieCtrlRegs.PIEIER1.all;
        PieCtrlRegs.PIEIER1.all &= ~PIEMASK0;      /* disable group1 lower/equal priority interrupts */
        asm(" RPT #5 || NOP");               /* wait 5 cycles */
        IFR &= ~IFRMASK;                           /* eventually disable lower/equal priority pending interrupts */
        PieCtrlRegs.PIEACK.all = IFRMASK;          /* ACK to allow other interrupts from the same group to fire */
        IER |= 1;
        EINT;                                /* global interrupt enable */
        DINT;                                /* disable global interrupts during context switch, CPU will enable global interrupts after exiting ISR */
      AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
      PieCtrlRegs.PIEIER1.all = PIEIER1_stack_save;/*restore PIEIER register that was modified */
    
    }

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3840615 #3840615"]如果使用完全相同的过程,则意味着以下函数,但不幸的是,我应该说它不起作用,ADC ISR 根本不会触发...

    尊敬的 John:

    按顺序,我指的是步骤的顺序和步骤的顺序,即(1)存储 PIEIER (2)修改 IER (3)清除 PIEACK (4)等待一个周期.... 等等  加载到寄存器 中的实际值取决于系统本身以及要嵌套哪些中断。   我粘贴的函数只是一个示例。

    下面概述了这些步骤:  

    https://software-dl.ti.com/C2000/docs/c28x_interrupt_nesting/html/index.html#adding-simple-software-prioritization-nesting

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3840615 #3840615"]它不起作用,ADC ISR 根本不会触发...

    我不知道为什么会这样。  我想如果它在系统初始化中仍然以相同的方式启用、它至少应该启动一次。  

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3840615 #3840615"]在本例中、您是否认为 SEQ1INT_ISR (void)在将 ADC ISR 连接到中断之前正在发挥任何作用?

    任何允许中断嵌套的中断服务例程都应遵循相同的步骤序列、以便在例程期间为其他中断提供服务。  即(1)存储 PIEIER (2)修改 IER (修改 IER)... 等等

    希望这有助于澄清。  

    谢谢

    Lori

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Lori、  

    因此、根据我们的讨论和指南、我尝试使用完全相同的过程来更改 ADC ISR、以符合上面提到的中断嵌套、如下所示、我在应用更改之前和之后放置 ISR 例程、以便您可以比较它们、 现在、ADC ISR 会持续触发、但有时启动冻结的问题仍然存在(当我连接一个外部模块(例如连接到编码器和 ECAP 输入的编码器)时、问题会变得更加严重...)

    之前的 ADC ISR

      interrupt void ADCINT1_isr(void)
    {
      volatile unsigned int PIEIER1_stack_save = PieCtrlRegs.PIEIER1.all;
      PieCtrlRegs.PIEIER1.all &= ~1;
                                  /*disable group1 lower/equal priority interrupts*/
      asm(" RPT #5 || NOP");               /*wait 5 cycles        */
      IFR &= ~1;      /*eventually disable lower/equal priority pending interrupts*/
      PieCtrlRegs.PIEACK.all = 1;
                       /*ACK to allow other interrupts from the same group to fire*/
      IER |= 1;
      EINT;                                /*global interrupt enable*/
      isr_int1pie1_task_fcn();
      DINT;
      /* disable global interrupts during context switch, CPU will enable global interrupts after exiting ISR    */
      PieCtrlRegs.PIEIER1.all = PIEIER1_stack_save;
                                       /*restore PIEIER register that was modified*/
      EALLOW;
      AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
      EDIS;
      PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
                                         /* Acknowledge to receive more interrupts*/
    }
                                         

    之后的 ADC ISR (按照提供的标准程序完成):

    interrupt void ADCINT1_isr(void)
    {
    /**********************Standard ISR for  Nesting*********************************/
        volatile unsigned int PIEIER1_stack_save = PieCtrlRegs.PIEIER1.all;
        IER &= ~1;
        PieCtrlRegs.PIEIER1.all &= ~1; /*disable group1 lower/equal priority interrupts*/
        PieCtrlRegs.PIEACK.all = 1; /*ACK to allow other interrupts from the same group to fire*/
        asm("           NOP");
        EINT;
        isr_int1pie1_task_fcn();
        DINT;
        PieCtrlRegs.PIEIER1.all = PIEIER1_stack_save; /*restore PIEIER register that was modified*/
        EALLOW;
        AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;
        EDIS;
    }

    所以现在代码的功能在这些 ISR 之间是相同的,但它们都显示在启动时偶尔出现故障....

    那么、您对此有什么想法吗?

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    感谢 John 的更新。  

    您是否还检查了代码中是否有任何非初始化(a)部分的 PIEIERx 修改-在同一组 x 的中断服务例程中启动任何中断(b)之前 ?

    谢谢

    Lori

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Lori、  

    在连接 ADC ISR 并将其激活后、会连接其他中断、然后更改其 PIEIERx、除了此部分、代码中不会接触 PIEIERx。

    void enable_interrupts()
    {
        EALLOW;
        PieVectTable.ADCINT1 = &ADCINT1_isr; /* Hook interrupt to the ISR*/
        EDIS;
        PieCtrlRegs.PIEIER1.bit.INTx1 = 1; /* Enable interrupt ADCINT1*/
        IER |= M_INT1;
        EALLOW;
        PieVectTable.EQEP1_INT = &EQEP1_INT_isr;/* Hook interrupt to the ISR*/
        EDIS;
        PieCtrlRegs.PIEIER5.bit.INTx1 = 1; /* Enable interrupt EQEP1_INT*/
        IER |= M_INT5;
        EALLOW;
        PieVectTable.SCIRXINTA = &SCIRXINTA_isr;/* Hook interrupt to the ISR*/
        EDIS;
        PieCtrlRegs.PIEIER9.bit.INTx1 = 1; /* Enable interrupt SCIRXINTA*/
        IER |= M_INT9;
        EALLOW;
        PieVectTable.ECAP1_INT = &ECAP1_INT_isr;/* Hook interrupt to the ISR*/
        EDIS;
        PieCtrlRegs.PIEIER4.bit.INTx1 = 1; /* Enable interrupt ECAP1_INT*/
        IER |= M_INT4;
        EALLOW;
        PieVectTable.ECAP2_INT = &ECAP2_INT_isr;/* Hook interrupt to the ISR*/
        EDIS;
        PieCtrlRegs.PIEIER4.bit.INTx2 = 1; /* Enable interrupt ECAP2_INT*/
        IER |= M_INT4;
        EALLOW;
        PieVectTable.ECAP3_INT = &ECAP3_INT_isr;/* Hook interrupt to the ISR*/
        EDIS;
        PieCtrlRegs.PIEIER4.bit.INTx3 = 1; /* Enable interrupt ECAP3_INT*/
        IER |= M_INT4;
        EALLOW;
        PieVectTable.ECAN0INTA = &ECAN0INTA_isr;/* Hook interrupt to the ISR*/
        EDIS;
        PieCtrlRegs.PIEIER9.bit.INTx5 = 1; /* Enable interrupt ECAN0INTA*/
        IER |= M_INT9;
    
        /* Enable global Interrupts and higher priority real-time debug events:*/
        EINT;
        /* Enable Global interrupt INTM*/
        ERTM;
        /* Enable Global realtime interrupt DBGM*/
    }
     

    因此、如果在 ADC ISR 激活后在该例程中切换 PIEIERx、则不允许在何处为其他用于激活其他中断的组初始化这些 PIEIERx?

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    John、

    我没有看到 ENABLE_INTERRUPTS ()代码有什么问题。  关键是您只启用 PIEIER 寄存器中的中断。   

    当 PIEIER 被修改时、竞争条件发生、这样一些中断被从启用切换到禁用。   CPU 可能会尝试为中断提供服务、PIE 显示"未启用中断-因此我将为您提供组中的第一个 ISR 矢量"。  您 还可以使用 ISR 设置来解决这种情况。  

    我必须对接下来的建议进行更多的思考。   如果不是以前、我将在周一结束时再回来。

    Lori

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    需要通过下拉电阻器将-TRST 连接到 GND (不是3.3V)。 您是否愿意离线共享原理图?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Haresh、  

    感谢您的回答、我的此器件板具有如下简单连接:

    因此、所有 JTAG 引脚都在没有任何上拉或下拉的情况下输出、JTAG 板是分离的、它具有标准 TI 设计提供的所有上拉和下拉电阻。

    因此、该板一旦独立运行、所有引脚都保持断开状态、正如我之前所说的、启动大部分都正常、有时在代码中的一些中断激活后、它在运行时失败...

    那么、您认为问题是 TRST 上的下拉电阻? 如果是这种情况、代码如何像80%的时间一样安全启动、并且在经过大量初始化之后的运行时间内、在另外20%的时间内失败、等等?

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您确实需要在引导模式选择引脚上使用 PU 电阻器。 这些引脚具有内部 PU、但它们很弱。 加电期间这些引脚上的任何噪声都可能会使器件进入某些其他引导模式。  

    同样、-TRST 引脚也具有弱内部下拉电阻。 强烈建议使用外部2.2K PD 来补充这一点。  

    根据噪声情况、您的电路板可能会也可能不会正确加电(没有我建议的外部电阻器)。 这些电阻器必须始终连接到器件引脚

    要确定硬件和软件之间的问题、请尝试以下实验:将一个简单的 GPIO 切换代码编程到闪存中、并查看每次的调光器是否正常。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Haresh、  

    好的、我找到了时间来执行您的指令。
    因此、通过从外部上拉 GPIO34和 TDO 的引导模式引脚、同时通过使用提到的2K 电阻器下拉 TRST、我可以看到引导加载程序始终无法启动 (其他配置也会根据数据表中的表进行测试)

    正如我先前所说:

    1 -我使用 DFU-prog 和 C2000中为其制作的引导加载程序作为带 USB 的引导加载程序

    2-我的代码在执行主代码时总是失败,并且在引导加载阶段不会冻结(正如我所解释的,完全删除引导加载程序并使代码独立运行,我仍然看到问题)

    3 -如前所述、代码在运行时激活 ECAP 中断后立即失败  

    4 -在删除中断嵌套后、故障消失了、并且我一直有安全启动、但嵌套是必须的、我们通过捕获不良中断等尝试了所有其他方法。

    那么、您对此有何看法? 链接器命令文件是否可能出现问题?

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3851872 #3851872"]通过从外部上拉 GPIO34和 TDO 的引导模式引脚、同时通过使用提到的2K 电阻器下拉 TRST、我可以看到引导加载程序始终无法启动

    因此、即使 PU 和 PD 电阻器永久连接到电路板、问题仍然存在?

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3851872 #3851872"]执行主代码后,我的代码总是失败,并且在启动加载阶段不会冻结[/quot]

    我假设您的引导加载程序始终首先执行和执行、然后是主代码。 您的观察结果几乎肯定会指出软件问题。

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3851872 #3851872"]如前所述,代码在运行时中激活 ECAP 中断后立即失败[/quot]

    在您的设计中、是否有任何引脚在 MCU 完全上电之前被驱动?

    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3851872 #3851872"]删除中断嵌套后,故障消失[/quot]

    同样、这也表明了 S/W 中的一个问题、我们在这方面的帮助能力非常有限(因为我们无法了解您的应用代码中的所有细微差别)

    我让您尝试刷写一个简单的 GPIO 切换代码。 该实验的结果是什么?

    您能否在上电和断电期间共享以下信号的波形?

    • 情况 A:3.3V、1.8V、-XRS、-TRST
    • 情况 B:3.3V、-XRS、两个引导模式选择引脚  

    您能否尝试使用外部电源为电路板上电(绕过板载电源电路)?

    您能否与我们私下分享您的原理图?  如果是、则需要发起友谊请求。 我们需要查看整个原理图(至少每个到 MCU 的连接)。 一个小片段没有用处。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="10172" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3852285 #3852285"]因此、即使 PU 和 PD 电阻器永久连接到电路板、问题仍然存在?

    是的

    [引用 userid="10172" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3852285 #3852285)]我假设引导加载程序始终首先执行、然后是主代码。 您的观察结果几乎肯定会指出软件问题。[/QUERP]

    是的、即使通过删除 boo 加载程序并使代码独立运行、我也会看到这一点。

    [引用 userid="10172" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3852285 #3852285"]在您的设计中,是否有任何引脚在 MCU 完全上电之前被驱动?[/quot]

    我无法肯定地说、还有其他 IC 连接到 MCU、因此它们可能会更快加电...

    [引用 userid="10172" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3852285 #3852285">我要求您尝试刷写一个简单的 GPIO 切换代码。 该实验的结果是什么?[/引述]

    正如我说过的、这必须起作用、因为移除了中断嵌套、所以当我优先处理中断时、会发生一些事情、并且 ADC 中断是非抢占式发生。 我可以想象 GPIO 切换也会起作用...

    对于其余的测试、我需要时间来提供信号、但我很快就会这么做。

    [引用 userid="10172" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3852285 #3852285)]您能否与我们私下分享您的原理图?  如果是、则需要发起友谊请求。[/QUERT]

    当然、我会将其发送给您。

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    John、

    软件方面需要检查的东西。  编译器定义了两种类型的中断-高优先级(HPI)和低优先级(LPI)。  请检查是否任何已启用嵌套的中断未定义为高优先级中断。  

    您可以在代码库中搜索术语 HPI。  高优先级中断将具有  编译器用户指南 www.ti.com/lit/spru514中此屏幕截图所示的规范之一。  定义为 HPI 的中断具有更快的上下文保存、但不允许嵌套。  

    我怀疑这是问题、因为它也应该在连接 CCS 的情况下表现出来。  但值得检查。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Lori、  

    谢谢、是的、我检查了我们的代码中的任何地方、使用了提到的 HPI 或 LPI 分配、因此这似乎不是问题。

    此致
    John

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="473388" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3852372 #3852372"]我无法确定是否有其他 IC 连接到 MCU、因此它们的加电速度可能更快...[/quot]

    如果在 MCU 完全上电之前驱动 MCU 引脚、则可能会出现问题。 请在加电前/加电期间检查所有 MCU 引脚、以确保情况并非如此。

    [引用 userid="10172" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1037743/tms320f28069-inconsistency-in-f28069-run-time-and-power-up-behavior-among-various-chips/3852285 #3852285"]

    您能否在上电和断电期间共享以下信号的波形?

    • 情况 A:3.3V、1.8V、-XRS、-TRST
    • 情况 B:3.3V、-XRS、两个引导模式选择引脚  
    [/报价]

    仍在等待波形。