工具/软件:
你(们)好
根据函数的名称、我们假定__NVIC_SystemReset 函数确实会创建系统复位(这也与函数描述注释建议的内容一致)。
但是、在执行 sysctl->SOCLOCK.RSTCAUSE 中可用的复位原因为0x1D 时、建议执行 CPU 复位(这与检查函数实际执行的操作时所假定的一致;但不与名称建议内联、尤其是鉴于 SystemReset 实际上是另一个有效复位类型的名称)
有关参考、请参阅 TRM 中关于 RSTCAUSE 寄存器解码的以下摘录
__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) { __DSB(); /* Ensure all outstanding memory accesses included buffered write are completed before reset */ SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | SCB_AIRCR_SYSRESETREQ_Msk); __DSB(); /* Ensure completion of memory access */ for(;;) /* wait until reset */ { __NOP(); } }
上述代码确实与 TRM 中概述的步骤(第140页)相匹配。
A CPU-only reset (CPURST) which does not reset the peripherals can also be triggered in software within the Cortex-M0+ CPU by setting the SYSRESETREQ bit in the AIRCR local CPU register. See the CPU Sub System chapter for more information.
但显然不需要的程序做什么名字会建议,如这里解释
我目前在
SDK 版本2.04.00.06
这里的"错误"纯粹是语义。