嗨!我已经完成了我的申请,但在最后阶段我遇到了问题。我使用XC1.30和DSIC33 EP512MU810。我发现我的程序在我的应用程序的特定方面开始表现得非常怪异。在与我的代码斗争之后,我发现这是因为编译器。在某个时刻,如果我添加了更多的数据存储器(变量、数组或结构),程序在某个点上失败,但是XC1.30没有错误地编译,内存报告指示:数据存储器为62%,程序存储器为75%。程序存储器[Oracle=0x3000,长度=0x505FC]段地址长度(PC U)--------------------------Text 0x3000 0x5Da40x8C76(35958).const 0x8Da40xA0C0xF12(3858)LbMxconst 0x97 B00x1Ac0x228(642)0533 C300 58AB0615 0x135C 0x13EEC 0x1DE62(122466)。nITS)长度(字节)(DEC)------------3281)文本0x34 dB80x9876 0xe4b1(58545).Delay32 0x3e62e 0x1c 0x2a(42).Sydi.0x3E64 A0x2 0x3(3)使用的总程序存储器(字节):0x59172(364914)73% IVT存储器[原点=0x4,长度=0x1FC]段地址长度(PC单元)长度(字节)(-DEC)-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------IVT0x40x1300x1C8(456)Audio Flash存储器[Oracle=0x7FC000,长度=0x3FFA]段地址长度(PC单元)长度(字节)(DEC)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------NSBS0x1000 0 0x2(2)。BS0x1002 0 0x35C2(13762)。数据0x41818 0 0x88(648)。数据0x77 A0 0 0x194(404)。BSS 0x7934 0 0xCC(204)053903C058AB06360X7A00,0x40 A40。地址对齐间隙总长度X48(72)。BS0x7C80 0 0x82/(44)。数据0x7d2e 0 0xa2(0)。数据0x7DD0*0x1a(α)。XAE(174).0x7Aee 0 0x8e(142). BSS 0x7B7C 0 0xBC(188).数据0x7C38 0 (6).data 0x7e5a 0 0x4 (4).bss 0x7e5e 0 0x4 (4).data 0x7e62 0 0x8 (8).bss 0x7e6a 0 0xe (14).data 0x7e78 0 0x2 (2).bss 0x7e7a 0 0x2 (2).data 0x7e7c 0 0x2 (2).pbss 0x7e7e 0 0x2 (2).data 0x7e80 0 0x2 (2).pbss 0x7e82 0 0x2 (2).bss 0x7e84 0 0x2 (2).data 0x7e86 0 0x2 (2)_05B3DB4058ab0a06 0xce00 0 0x200 (512)02FIF3058AB0A07 0xD000 0 0x1000(4096)总数据存储器使用(字节):0x8088(32904)61%动态存储器UAGERIEGION地址最大长度(DEC)--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------XC1.25,它报告内存错误,因此它是一个内存问题。Buff/Deult/Studio/Ext/ 488041537 /Fiel1.O:Link错误:无法分配Chans.PbSS,大小=2字节,属性=持久构建/默认/生产/第二/ 488041537 /文件2. O:链接错误:无法分配节。大小=2字节,属性=数据构建/默认/生产/ 488041537 /文件/文件2. O:链接错误:无法分配节。PBSS,大小=2字节,属性=持久NBProject /MaFaCH默认值。MK:1263:目标“DIST/Deule/Prototh/Project”的配方。ON/OXEX/FIL3.0:FLIE3.0:链接错误:无法分配段。BSS,大小=2字节,属性=BSS使[2 ]:离开目录'c:/文件夹/Project。X'C30IUARTEP.EO:链接错误:无法分配节。数据,大小=2字节,属性=数据链接错误:无法分配数据内存项Ct/MaCuff.DEFA.MK: 84:TAKE.CONFF’FuffEdTe[ 2 ]的配方:**[Dist/Deult/Projuts/Proj.x.Proto.HEX ]错误255:**[.Bug CONF]错误2:使**[构建IMPL]错误2IF,例如,我只减少一个数组,长度只有32个字节,问题消失了,所以我在内存问题的边缘。然而,数据内存使用率仅为62%!!!!为什么XC1.30编译,但程序工作不好。XC1.25给出了这些错误,但是当从数据存储器中删除一些字节时,它说它是在62%。XC1.26也表现为XC1.30i不能依赖XC1.30,因为它编译,但我的程序可能在某个地方出错,而不是真的信任。我遗漏了什么吗?谢谢你,我希望有人能澄清一下。
以上来自于百度翻译
以下为原文
Hi everobody!.
I have got my applica
tion almost done but I am having problems at this final stage.
I am using XC1.30 and DSPIC33EP512MU810. I have found that my program has started behaving very weird in specific aspects of my application. After struggling with my code I have found out that it is due to the compiler. At some point if I add more data memory (variables, arrays, or structures) the program fails at some point, but XC1.30 compiles with no error, and the memory report indicates: data memory at 62% and program memory at 75%.
Program Memory [Origin = 0x3000, Length = 0x505fc]
section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
.text 0x3000 0x5da4 0x8c76 (35958)
.const 0x8da4 0xa0c 0xf12 (3858)
libmxconst 0x97b0 0x1ac 0x282 (642)
_0533c30058ab0615 0x995c 0x13eec 0x1de62 (122466)
.text 0x1d848 0x152da 0x1fc47 (130119)
.dinit 0x32b22 0x2296 0x33e1 (13281)
.text 0x34db8 0x9876 0xe4b1 (58545)
.init.delay32 0x3e62e 0x1c 0x2a (42)
.shared.dinit 0x3e64a 0x2 0x3 (3)
Total program memory used (bytes): 0x59172 (364914) 73%
Ivt Memory [Origin = 0x4, Length = 0x1fc]
section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
.ivt 0x4 0x130 0x1c8 (456)
Auxflash Memory [Origin = 0x7fc000, Length = 0x3ffa]
section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
Total auxflash memory used (bytes): 0 (0) <1%
Data Memory [Origin = 0x1000, Length = 0xd000]
section address alignment gaps total length (dec)
------- ------- -------------- -------------------
.nbss 0x1000 0 0x2 (2)
.bss 0x1002 0 0x35c2 (13762)
.data 0x45c4 0 0x2f54 (12116)
.bss 0x7518 0 0x288 (648)
.data 0x77a0 0 0x194 (404)
.bss 0x7934 0 0xcc (204)
_053903C058ab0636 0x7a00 0 0x40 (64)
.bss 0x7a40 0 0xae (174)
.data 0x7aee 0 0x8e (142)
.bss 0x7b7c 0 0xbc (188)
.data 0x7c38 0 0x48 (72)
.bss 0x7c80 0 0x82 (130)
.data 0x7d02 0 0x2c (44)
.bss 0x7d2e 0 0xa2 (162)
.data 0x7dd0 0 0x1a (26)
.bss 0x7dea 0 0x50 (80)
program 0x7e3a 0 0xa (10)
.bss 0x7e44 0 0xa (10)
_0510918058ab062e 0x7e4e 0 0x6 (6)
.bss 0x7e54 0 0x6 (6)
.data 0x7e5a 0 0x4 (4)
.bss 0x7e5e 0 0x4 (4)
.data 0x7e62 0 0x8 (8)
.bss 0x7e6a 0 0xe (14)
.data 0x7e78 0 0x2 (2)
.bss 0x7e7a 0 0x2 (2)
.data 0x7e7c 0 0x2 (2)
.pbss 0x7e7e 0 0x2 (2)
.data 0x7e80 0 0x2 (2)
.pbss 0x7e82 0 0x2 (2)
.bss 0x7e84 0 0x2 (2)
.data 0x7e86 0 0x2 (2)
_05B3DB4058ab0a06 0xce00 0 0x200 (512)
_02FEE30058ab0a07 0xd000 0 0x1000 (4096)
Total data memory used (bytes): 0x8088 (32904) 61%
Dynamic Memory Usage
region address maximum length (dec)
------ ------- ---------------------
heap 0 0 (0)
stack 0x7e88 0x4f78 (20344)
Maximum dynamic memory (bytes): 0x4f78 (20344)
However when I compile using XC1.25, it reports a memory error
, so it seems that is a memory problem.
build/default/production/_ext/488041537/File1.o: Link Error: Could not allocate section .pbss, size = 2 bytes, attributes = persist
build/default/production/_ext/488041537/File2.o: Link Error: Could not allocate section .data, size = 2 bytes, attributes = data
build/default/production/_ext/488041537/File2.o: Link Error: Could not allocate section .pbss, size = 2 bytes, attributes = persist
nbproject/Makefile-default.mk:1263: recipe for target 'dist/default/production/Project.X.production.hex' failed
build/default/production/_ext/2016417865/File3.o: Link Error: Could not allocate section .bss, size = 2 bytes, attributes = bss
make[2]: Leaving directory 'C:/Folder/Project.X'
c30_uartep.eo: Link Error: Could not allocate section .data, size = 2 bytes, attributes = data
Link Error: Could not allocate data memory
nbproject/Makefile-default.mk:84: recipe for target '.build-conf' failed
make[2]: *** [dist/default/production/Project.X.production.hex] Error 255
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
If, for example, I decrease an array lenght only by 32 bytes, the problem disappears, so I am on the edge of the memory problem. However the data memory usage is only 62%!!!
Why XC1.30 compiles but the program works bad. And XC1.25 gives those errors, but when removing a few bytes from the data memory it says that it is at 62%.
XC1.26 behaves also as XC1.30
I can't rely on XC1.30 at all since it compiles but my program can run wrong at some point, not really trustwhorty.
Am I missing anything??
Thanks in advance, i hope anyone may clarify somthing about it.
CM
0