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.

MSP430FR5989: Failed to write data to address 0x10000 in FRAM

Part Number: MSP430FR5989

I use CCS to build a project. The running space of the program is between 0x4400 and 0xFFFF. I want to write 1100 bytes of data to the address of 0x10000. I use the function "__data20_write_char" writes 20 bytes at a time. When I finish writing, use the function "__data20_ read_char" When reading char, it is found that there are random check errors in several bytes in the middle area. Here is my code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int ota_write(unsigned long offset,const unsigned char *pdata,unsigned int size)
{
unsigned int i=0;
for(i=0;i<size;i++)
{
__data20_write_char(offset+0x10000+i,pdata[i]);
}
for(i=0;i<size;i++)
{
if(__data20_read_char(offset+0x10000+i)!=pdata[i])
{
DBG_LOG("CHK ERR"); //Several random byte check failures
return -1;
}
}
return 0;
}
static unsigned char test_buf[20]={0};
void test_fram()
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


Please help me analyze what the problem is.

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    int ota_write(unsigned long offset,const unsigned char *pdata,unsigned int size)
    {
    unsigned int i=0;
    for(i=0;i<size;i++)
    {
    __data20_write_char(offset+0x10000+i,pdata[i]);
    }
    for(i=0;i<size;i++)
    {
    if(__data20_read_char(offset+0x10000+i)!=pdata[i])
    {
    DBG_LOG("CHK ERR"); //Several random byte check failures
    return -1;
    }
    }
    return 0;
    }
    static unsigned char test_buf[20]={0};
    void test_fram()
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    code fixed

**Attention** This is a public forum