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.

[参考译文] TMS570LS0714:闪存存储器中的常数声明

Guru**** 2933120 points

Other Parts Discussed in Thread: TMS570LS0714

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/801069/tms570ls0714-constant-declaration-in-flash-memory

器件型号:TMS570LS0714

您好!

我使用的是 IAR EWARM 8.22和微控制器 TMS570LS0714。
对于我的项目、我需要在闪存中保存一些信息。

在链接器文件中、我要保留一个区域:
define region app_part_region = mem:[从0x00010044到0x0001004F];
放入 app_part_region{readonly section app_part_NUM};

在源文件中、我声明以下内容:
__root const uint32 App_Part_number @"app_part_NUM"= 123456;

但是、当我观察.map 文件时、会显示以下内容:

APP_PART_NUM
常量0x00010044 0x4 main.o [1]
- 0x00010048 0x4

.text ro 代码0x00010048 0x1dca system.o [3]

观察此情况后、我发现虽然给出了0x00010044到0x0001004F 之间的区域用于存储器件型号数据、但器件型号数据仅使用0x00010044到0x00010048之间的区域、而其他一些区域则使用从0x00010048开始的剩余区域。

您能否建议一个解决方案、使在链接器文件中声明的区域不应用于存储一些其他数据。

谢谢、此致、
Abrar

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

    我对 IAR 链接器配置文件不了解多少、所以我的评论仅供您参考。

    在 IAR 中、可以使用#pragma 位置将一个函数或变量放置在命名段中。 因此、您可以将器件型号放在0x10044、0x00的其他位置(0x10048、0x1004C)。 例如

    #pragma LOCATION = 0x10044
    __root const uint32_t part_num[]={0x12345678、0x00000000、0x00000000};