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.

[参考译文] CCS/MSP430F2272:在NVM中存储批量数据

Guru**** 2540720 points


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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/571455/ccs-msp430f2272-storing-bulk-data-in-nvm

部件号:MSP430F2272

工具/软件:Code Composer Studio

我需要为应用程序存储相当大的(~4 KB)三维阵列。 这些值是常量的,但我需要对信息的读取访问权限。 我认为#define不是正确的解决方案,从技术上讲,const不适用于使用c语法的数组(如果我错了,请更正我)。 是否有我不知道的解决方案? 有什么东西只是sais "在NVM中加载它"?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    请说明为什么这样的声明不适合您的需求:

    const unsigned int array[4096]={0};

    这会将阵列放置在闪存中(请参见命令链接器文件),并可按如下方式访问:

    number = array[1024];

    #define不适合初始化数组。

    此致,
    Ryan