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.

msp430f4152 芯片中的flash问题

Other Parts Discussed in Thread: MSP430F4152

 msp430f4152中有256字节的信息存储器,地址从0x1000到0x10ff,分为四段A、B、C、D,0x1000~0x103F;0x1040~0x107F;0x1080~0x10BF;0x10C0~0x10FF。

void write_SegC(char value)
{
char *Flash_ptr; // Flash pointer
unsigned int i;

FCTL2 = FWKEY + FSSEL0 + FN1; 

Flash_ptr = (char *)0x1080;                 // Initialize Flash pointer
FCTL3 = FWKEY;                                // Clear Lock bit
FCTL1 = FWKEY + ERASE;             // Set Erase bit
*Flash_ptr = 0;                                 // Dummy write to erase Flash seg

FCTL1 = FWKEY + WRT;            // Set WRT bit for write operation

for (i = 0; i < 16; i++)
{
*Flash_ptr++ =0x88;                   // Write value to flash
}

FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY + LOCK; // Set LOCK bit
}

程序如上,前三个信息段改变一下指针的地址,数据都能写进去,但是第四个段0x10C0~0x10FF,数据一直写不进去,一直显示0XFF,求高手帮忙解决一下

  • 好奇怪。我看手册上说:

    The information memory has four 64-byte segments on the MSP430FG47x,
    MSP430F47x, MSP430F47x3/4, and MSP430F471xx devices or two
    128-byte segments on all other MSP430x4xx devices.

    msp430f4152应该只有两个128字节的信息flash段才对