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.

MSP430F5438A程序量较大后,编译出现: Number out of range. Valid range is -32768 (-0x8000) to 65535 (0xFFFF).

Other Parts Discussed in Thread: MSP430F5438A

  我用IAR 430 5.50.2写MSP430F5438A的程序,工程中包含了cstartup.s43 文件

当程序量较小时,编译没有问题。当程序量大时就提示如下错误,但是我把cstartup.s43文件从工程中去掉后编译正常。

工程中添加cstartup.s43的主要原因是把可恶的看门狗关闭。

 

请问下面的错误如何解决????????谢谢

   IAR Universal Linker V5.3.2.26
     Copyright 1987-2012 IAR Systems AB.
Error[e18]: Range error, 
 Number out of range. Valid range is -32768 (-0x8000) to 65535 (0xFFFF).
 File: C:\Documents and Settings\Administrator\桌面\96\System\cstartup.s43, Line: 275 
 Source:         MOV.W   #(SFB DATA20_ID), CW1
 
  Where $ = ?cstart_init_copy20 + 0x6  [0x5C20]
            in module "?cstart" (C:\Documents and Settings\Administrator\桌面\96\Project\Debug\Obj\cstartup.r43),
            offset 0x6 in segment part 18, segment CSTART
  What: 0 + SFB(DATA20_ID) [0x1774A]
  Allowed range: 0xFFFF8000 - 0xFFFF
  Operand: #no label found# [0x1774a]
           in module ?cstart (C:\Documents and Settings\Administrator\桌面\96\Project\Debug\Obj\cstartup.r43),
           Offset 0x0 in segment part 9, segment DATA20_ID
Error while running Linker
 
Total number of errors: 1
Total number of warnings: 29

  • 应该是设置问题

    试一下以下设置

  • 还是不行。

    我用IAR 430 6.10 编译这个工程,还是同样的报错,错误和5.50报的一样。

    cstartup文件我在别的工程(代码量很小,且没有使用__data16 __data20)中包含就没有问题,不管选择small,medium还是large都不报错,编译正常。

    报错的工程,ROM使用量为120多KB,好像是代码多了,只要包含这个启动文件就报那个错。

     

         IAR Universal Linker V5.3.2.26
         Copyright 1987-2012 IAR Systems AB.
    Error[e16]: Segment DATA16_C (size: 0xa211 align: 0) is too long for segment definition. At least 0xb61 more bytes needed. The 
    problem occurred while processing the segment placement command 
    "-Z(CONST)DATA16_C,DATA16_ID,TLS16_ID,DIFUNCT,CHECKSUM=5C00-FF7F", where at the moment of placement the 
    available memory ranges were "CODE:68d0-ff7f"
       Reserved ranges relevant to this placement:
       5c00-5c2d            CSTART
       5c2e-68cf            ISR_CODE
       68d0-ff7f            DATA16_C
    Error while running Linker
     
    Total number of errors: 1
    Total number of warnings: 29

  • 你好,

    你可以在TI已经建好的工程上把你的.C函数copy进去试一下嘛?

    我没有遇到过类似的问题。

    你也可以把你的工程贴出来,我们试试。

  • 1、这个我都试过了,和工程没有关系。只要代码量大了,包含那个启动文件,就会报这样的错误。

    2、工程不方便贴出来啊

    2012年就有人遇到这个问题了。在最后一楼,和我的报错一样。

    http://bbs.csdn.net/topics/340227092

  •  我也是这个问题,解决了吗