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.

[参考译文] MSP430FR5969-SP:需要有关在 FRAM 中存储常量的帮助

Guru**** 2538955 points
Other Parts Discussed in Thread: MSP430FR5969

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/990821/msp430fr5969-sp-need-help-storing-a-constant-in-fram

器件型号:MSP430FR5969-SP
主题中讨论的其他器件:MSP430FR5969

您好、专家

我的客户有以下初始问题:

我对 FRAM 的“INFOA”一节中存储常量有其他疑问。

  1. 我们可以使用 FRAM 的哪个区域来存储常量?
  2. 我们是否可以使用“INFOA”一节来实现这一目的? 如果是、如何? 如果不是、我们可以将其存储在哪里、如何存储?

我回答了这些 e2e 线程链接、这些链接看起来很有希望:

https://e2e.ti.com/support/microcontrollers/msp430/f/msp-low-power-microcontroller-forum/981193/msp-exp430fr2355-regarding-fram-store-in-msp430fr2355/3627070?tisearch=e2e-sitesearch&keymatch=msp430%20fram%20storing%20constants#3627070

 https://e2e.ti.com/support/microcontrollers/msp430/f/msp-low-power-microcontroller-forum/953555/msp430fr5994-unable-to-modify-persistent-data-stored-in-fram?tisearch=e2e-sitesearch&keymatch=msp430%25252520fram%25252520storing%25252520constants#

 https://e2e.ti.com/support/microcontrollers/msp430/f/msp-low-power-microcontroller-forum/986907/msp430fr2355-how-to-read-write-in-fram?tisearch=e2e-sitesearch&keymatch=msp430%252525252525252520fram%252525252525252520storing%252525252525252520constants#

听起来好像他还在工作、他的最新评论和问题如下:

我通读了链接的示例,尝试了一些与评估板的型号“MSP430FR5969”不相同但没有成功的方法。

下面是我的代码:

//////////////////////

#include

#include

#include

#include

#include "driverlib.h"

 

uint8_t val = 0x0;

pragma PERSISTENT (A)

#pragma LOCATION (A、0x1980)

unsigned char a = 0x25;

int main (void){

 

 

   WDT_A_HOLD (WDT_A_base);

   Val = 0x55;

   a = val;

 

   printf ("val =0x%x\n"、val);

   printf (" a =0x%x\n"、a);

   返回(0);

//////////////////////

示例的输出为

Val = 0x55

A =0x25

///

我希望看到输出:

Val = 0x55

A =0x55

 

是否有人可以提供建议的代码让他去?

谢谢!

Jim B

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

    要使信息存储器可写、您需要重新配置 MPU。

    从"Show Build Settings->CCS General->MPU [tab]"开始。 然后

    1) 1)设置按钮"手动指定段"

    2) 2)在"Info Memory"旁边选中"W"框。

    3) 3)对于"段1"至"段3"、选中"X"复选框。 (这是为了允许您的代码到达那里。 我不知道为什么这不会自动发生。)

    4) 4)对于"段1"到"段3"、取消选中任何"W"框。 (这是为了保护您的代码不被意外覆盖。)

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

    您可以以此为例

    pragma RETAIN (BSL_PASSWORD)
    pragma 位置(BSL_PASSWORD、0xFFE0)
    const unsigned char BSL_password[30]={
    0xFF、0xFF、0xFF、0xFF、0xFF、 0xFF、0xFF、0xFF、\
    0xFF、0xFF、0xFF、0xFF、0xFF、 0xFF、0xFF、0xFF、\
    0xFF、0xFF、0xFF、0xFF、0xFF、 0xFF、0xFF、0xFF、\
    0xFF、0xFF、0xFF、0xFF、0xFF、 0xFF //将阵列末尾的两个字节保留在引导代码的起始地址、以确保密码为32字节
    };