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.

MSP430FR4133 FRAM 擦除保护

Other Parts Discussed in Thread: MSP430FR4133, LDC1614

芯片 MSP430FR4133 ,软件IAR FOR MSP430 V6.30.3 ,环境 WINDOWS XP

烧写器 FET430UIF。

希望 在FRAM 0xC400其始地址中保存一段数据,数据量比较大约2k,保存用户数据,information FRAM空间太小。

不希望在IAR烧写的时候擦除这段空间。参考IAR帮助文件,提到:

Example
--erase_exclude 0xC400-0xD400

To set this option, use Project>Options>Debugger>Extra Options.

使用时出错 :

Sat Nov 21, 2015 14:27:46: Could not erase device memory : (Erase) , type=0x0, address=0xd600, length=0x1ff
Sat Nov 21, 2015 14:27:51: Could not erase device memory : (Erase) , type=0x0, address=0xd600, length=0x1ff
Sat Nov 21, 2015 14:27:57: Could not erase device memory : (Erase) , type=0x0, address=0xd600, length=0x1ff
Sat Nov 21, 2015 14:28:02: Could not erase device memory : (Erase) , type=0x0, address=0xd600, length=0x1ff
Sat Nov 21, 2015 14:28:07: Could not erase device memory : (Erase) , type=0x0, address=0xd600, length=0x1ff
Sat Nov 21, 2015 14:28:13: Could not erase device memory : (Erase) , type=0x0, address=0xd600, length=0x1ff
Sat Nov 21, 2015 14:28:20: Could not erase device memory : (Erase) , type=0x0, address=0xd600, length=0x1ff
Sat Nov 21, 2015 14:28:20: Trying to initialize target failed
Sat Nov 21, 2015 14:28:22: Fatal error: Closing debug session Session aborted!
Sat Nov 21, 2015 14:28:22: Failed to load debugee: E:\IP Senser\Inductance\ldcl614code\Debug\Exe\ldc1614.d43

请问有什么方法可以确保更新程序时,这段不被擦除?谢谢!

  • 很久没用过iar了。如果你的这段数据都是一样的,建议把它合成到要烧写的文件中更方便。用ccs生成的txt文件很方便这样做

  • 其实实现的方式有很多种。例如,FRAM的芯片的代码区域和RAM区域是可以根据需要来灵活划分的。

    你可以尝试把这段常数代码划分为RAM区使用。基于FRAM的掉电不丢失特性,对于将FRAM划分为RAM来使用的区域,不会像一般RAM那样被上电初始化,并且保持数据不丢失。这个区域,只在第一次烧程序时初始化后,以后上电后都会为当时烧写的值。而且这段区域被划分为RAM使用的话,你的代码就不会被分配在这个区域,那无论你怎么更新程序,都不会影响这段区域的值。

  • 你好!

    谢谢上面两位的热心答复!

    修改xcl文件:

    // -----------------------------------------------
    // RAM memory
    //

    -Z(DATA)DATA16_I,DATA16_Z,DATA16_N,TLS16_I=2000-27FF,C400-D70F
    -Z(DATA)CODE_I
    -Z(DATA)DATA20_I,DATA20_Z,DATA20_N
    -Z(DATA)CSTACK+_STACK_SIZE#

    在RAM中增加C400-D70F这段空间。

    定义变量在改空间,发现还是被擦除为0xFF

    #pragma location=0xC400
    __no_init const uint32_t adjValue[300][4];

    如果定义为

    #pragma location=0xC400
    __no_init uint32_t adjValue[300][4];

    Error[Pe147]: declaration is incompatible with "uint32_t adjValue[300][4] @ 0xc400" (declared at line 62)

    请问还有没其他要修改部分!