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.

[参考译文] AM2634:在 hwip 属性中循环时代码将执行

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1622450/am2634-code-is-going-to-while-loop-in-hwip-attributes

器件型号: AM2634

你(们)好

任何人都能解释为什么我的代码有时会移到 while 循环吗?  

它显示 hwip 或 undef 或 svchandler ,每次代码移动到不同的 while 循环。  

我想知道为什么会发生这种情况以及如何解决它,是否有任何规定来暂时禁用这些属性。 下面的共享函数将提供有关属性的一些信息。

 

//<Func 在.S 文件中调用
void _attribute__((interrupt(“undef")“)、section(“.text.hwi")“)) HwiP_RESERVED_HANDLER (void)

  易失性 uint32_t 环路= 1;
  while (loop!=0U)
  {
    ///<等待
  }
}

//<Func 在.S 文件中调用
void _attribute__((interrupt(“undef")“)、section(“.text.hwi")“)) HwiP_Undefined_handler (void)

  易失性 uint32_t 环路= 1;
  while (loop!=0U)
  {
    ///<等待
  }
}

//<Func 在.S 文件中调用
void __attribute__((interrupt(“SWI")“)、section(“.text.hwi")“)) HwiP_svc_handler (void)

  易失性 uint32_t 环路= 1;
  while (loop!=0U)
  {
    ///<等待
  }

}

//<Func 在.S 文件中调用
void _attribute__((interrupt(“abort")“)、section(“.text.hwi")“)) HwiP_prefetch_abort_handler (void)

  易失性 uint32_t 环路= 1;
  while (loop!=0U)
  {
    ///<等待
  }
}

//<Func 在.S 文件中调用
void _attribute__((interrupt(“abort")“)、section(“.text.hwi")“)、weak) HwiP_DATA_ABORT_HANDLER_c (void)

  易失性 uint32_t 环路= 1;
 while (loop!=0U)
  {
    ///<等待
  }
}