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.

[参考译文] MSP432P401R:如何查看变量是否已存在于闪存中?

Guru**** 2581345 points


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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/612406/msp432p401r-how-to-see-if-a-variable-is-already-in-flash-memory

器件型号:MSP432P401R

我一直在使用 Resource Explorer 中的闪存编程示例、但我有点困惑。

我想将 WiFi 模块的 MAC 地址存储在闪存中、这样我就不必在每次启动器件时都浪费功率打开模块。 但是、代码将始终首次在器件上运行。 如何检查 MAC 地址是否存储在闪存中? (即、这是否是首次运行代码)

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    任何未编程的闪存字节 shoud 都为0xff、因此通常只需查找并非全部为0xFF 的字节字符串即可。
    如果您希望绝对安全、请添加另一个"有效性"字节、如果存储了有效地址、则该字节不能为0xff。
    如果需要、该标志可以是某种类型的简化 CRC 或有意义字节的校验和值。