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.

EVM430-FR6043: 请教,例程中使用__persistent标识,它的作用是什么?

Part Number: EVM430-FR6043

__persistent 的作用,含义?

__persistent USS_SW_Library_configuration gUssSWConfig = {
.systemConfig = &ussSystemConfig,
.meterConfig = &ussMeterConfig,
.measurementConfig = &ussMeasurementConfig,
.pllConfiguration = &ussPLLConfig,
.captureConfig = &ussCaptureConfig,
.triggerConfig = &ussTriggerConfig,
.interruptConfig = &ussInterruptConfig,
.algorithmsConfig = &ussAlgConfig,
};

  • PERSISTENT 会导致变量不会被 C 启动例程初始化,而是在首次将应用代码加载到目标器件中时被调试工 具链初始化。

    因此,在某些情况下(例如循环通电之后)这些变量不会初始化,因为它们已被彻底排除在 C 启动初始化过程之外。将变量声明为 PERSISTENT 会将它们分配到 .TI.persistent 连接器存储器段 中。

    具体您可以看一下

    https://www.ti.com/lit/ug/slau132y/slau132y.pdf 

    5.11.22 The NOINIT and PERSISTENT Pragmas