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.
我已经将数据存入了430的flash中,首地址是0x001800,现在我想读取从0x1800开始的100个数据将他们放到我定义的一个数组value中
我是这样写的
char *Flash_ptr = (char *)0x001800;
for(i = 0; i < 100; i++)
{
value[i] = *Flash_ptr++ ;
}
但是value中数值一直是0,应该如何正确的读取?
您好,您的代码工程师试过了,是可以正常工作的:
#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); }