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.

[参考译文] CCS/MSP430F6779:CAN#39;t make 工程、因为链接器上的存储器设置必须重叠。

Guru**** 2589280 points
Other Parts Discussed in Thread: MSP430F5438A

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/871330/ccs-msp430f6779-can-t-make-project-because-memory-setting-on-linker-must-be-overlap

器件型号:MSP430F6779
主题中讨论的其他器件:MSP430F5438A

工具/软件:Code Composer Studio

因为我必须 使某个地址与该代码重叠  

-Z (代码) ZAREA=1000-100F
-Z (代码) ZAREA_CODE=1014-17FF
-Z (代码) BSL0=1010-11FF
-Z (代码) BSL1=1200-13FF
-Z (代码) BSL2=1400-15FF
-Z (代码) BSL3=1600-17FF 

我可以在 IAR 上运行它。 但是 CCS 已经设置了不应重叠地址。

因此、我以旧线程的形式尝试了解决方案  

示例  

BSL0_L:origin = 0x1010,length = 0x0004
BSL0_H:origin = 0x1014,length = 0x01EC
BSL1:origin = 0x1200,length = 0x0200
BSL2:origin = 0x1400,length = 0x0200
BSL3:origin = 0x1600,length =0x01F0
BSLSIG :origin = 0x17F0、length = 0x000C
JTAGLOCK_KEY :origin = 0x17FC,length = 0x0004 
.text :{}> BSL0_L | BSL0_H | BSL1 | BSL2 | BSL3 | BSLSIG | JTAGLOCK_KEY
.text:_ISR:{}> BSL0_L | BSL0_H | BSL1 | BSL2 | BSL3 | BSLSIG | JTAGLOCK_KEY
.cinit :{}> BSL0_L | BSL0_H | BSL1 | BSL2 | BSL3 | BSLSIG | JTAGLOCK_KEY
.const :{}> BSL0_L | BSL0_H | BSL1 | BSL2 | BSL3 | BSLSIG | JTAGLOCK_KEY 

或使用内存页  

第1页:
闪存 :origin = 0x1014,length = 0x07EC 

和  

.text :{}>闪存 

链接器失败、请解决问题或建议解决方法

最恰当的考虑

伊蒂法特:)

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

    一个解决方案:

     使用 LOCATION pragma

    CCS v5.x 附带代码生成工具(CGT)版本 v4.x  、该版本还支持 LOCATION pragma、例如 IAR EWB 中的 pragma。 但是、CGT v4.x 不支持将数据放置在指定地址中的 AT 符号(@)用法。

      CGT v4.x 支持的 LOCATION pragma 语法如下:

    #pragma LOCATION (x、address);
    int x; 
    #pragma LOCATION =地址
    int x; 

    第二个洗浴:

    在  链接器命令文件中使用 DATA_SECTION pragma 和定义的存储器段

    CCS 的较旧 CCS v4.x 版本附带较旧的 CGT 版本 v3.x、该版本不支持  LOCATION pragma、因此  可以使用 DATA_SECTION pragma。 较旧 CGT v3.x 版本的 DATA_SECTION pragma 与  IAR EWB 中的 constseg pragma 几乎相同。

    对于上面的示例、默认链接器命令文件 lnk_msp430f5438a.cmd 包含 INFOD 段的以下定义:

    内存
    {
    …………
    
    INFOA  :origin = 0x1980、length = 0x0080
    信息  :origin = 0x1900,length = 0x0080
    信息系统  :origin = 0x1880、length = 0x0080
    信息系统  :origin = 0x1800,length = 0x0080
    
    }
    
    
    部分
    {
    …………
    
    infoA :{}>infoA /* MSP430信息闪存段*/
    infoB :{}>infoB
    infoC :{}>infc.oC
    infoD :{}> infod
    
    }
    
    存储器部分可在代码中与  DATA_SECTION pragma 搭配使用、如下所示: 
    #include 
     
    #pragma DATA_SECTION (port_bit、".infoD")
    const unsigned char port_bit = BIT0;
     
    void main (void)
    {
    WDTCTL = WDTPW + WDTHOLD;//禁用看门狗
    P1DIR = PORT_BIT; //将 P1.x 设置为输出
     
    while (1)
    {
    P1OUT ^= PORT_BIT; //切换 P1.0
    __delay_cycles (100000 );
    }