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.

[参考译文] MSP430FR5994:代码下载后重新编写 noinit 段

Guru**** 2390755 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/999682/msp430fr5994-noinit-section-is-rewritten-after-code-download

器件型号:MSP430FR5994

你好!

在数据集中器中、我需要将 一些数据存储在 FRAM 存储器中、这些数据 可能会根据与其他器件的无线电通信进行更新。 此数据应为非易失性数据、不应受到硬复位、下电上电或代码下载的影响。 我执行了以下操作:

代码

unsigned int __attribute__((noinit)) NodeTable[16];

链接器脚本(我将 noinit 位置更改为 HIFRAM)

  /* This section contains data that is not initialised during load
     or application reset.  */
  .noinit (NOLOAD) :
  {
    . = ALIGN(2);
    PROVIDE (__noinit_start = .);
    *(.noinit)
    . = ALIGN(2);
    PROVIDE (__noinit_end = .);
  } > HIFRAM

我正在使用 MSP430-gcc、没有 IDE、我将内存模型更改为 mlarge。 以下是相关的存储器映射部分:

.noinit 0x0000000000010002 0x20
0x0000000000010002 . = ALIGN (0x2)
[!provide] PROVIDE (__noinit_start = .)
*(.noinit)
.noinit 0x0000000000010002 0x20 build/common/nvstore.o
0x0000000000010002 NodeTable
0x0000000000010022 . = ALIGN (0x2)
[!provide] PROVIDE (__noinit_end = .)

到目前为止还不错、现在硬复位或下电上电会使我的数据保持不变、但是 MSP430Flasher 下载的代码会将存储器复位为0xFFFF。 我的 make install 命令是:

$(install)-n $(cpu_Exact)-w $(BUILDDIR)/$(target).hex -v -z [VCC]

如果有任何建议,将不胜感激。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    默认情况下、mspflaser 使用"-e ERASE_All"将所有程序存储器(FRAM)清零为0xFF。 [参考 MSPFlasher UG (SLAU654E)表1]。 您可以使用"-e NO_ERASE"或"-e ERASE_SEGM"做得更好。  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Bruce、

    就是这样、谢谢!