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.

MSP430F5529: msp430f5529

Part Number: MSP430F5529

我已经将数据存入了430的flash中,首地址是0x001800,现在我想读取从0x1800开始的100个数据将他们放到我定义的一个数组value中

我是这样写的

char *Flash_ptr = (char *)0x001800; 

for(i = 0; i < 100; i++)
{
value[i] = *Flash_ptr++ ;
}

但是value中数值一直是0,应该如何正确的读取?

  • 您好,我们已收到您的问题并升级到英文论坛,如有答复将尽快回复您。谢谢!

  • 您好,您的代码工程师试过了,是可以正常工作的:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    #pragma PERSISTENT(value)
    #pragma LOCATION(value, 0x1800)
    char value[] = {0,1,2,3,4,5,6,7,8,9};
    int i;
    int main(void)
    {
    WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
    char *Flash_ptr = (char *)0x001800;
    for(i = 0; i < 10; i++)
    {
    value[i] = *Flash_ptr++ ;
    }
    while(1);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 您好,我用您上面那个试了一下,ccs有这个报错。

    a data verification erro occured,file load failed.

  • 您好,您先试下以下方法:

    生成 TI (.txt) 输出,然后使用该文件对器件进行编程。 要使能 .txt 文件输出,请参阅以下内容: