MPLAB链接错误:无法分配部分(C30 C编译器) [英] MpLab Link Error: Could Not Allocate Section (C30 Compiler)

查看:2622
本文介绍了MPLAB链接错误:无法分配部分(C30 C编译器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经把code两拼在一起(在最初的这个问题在这里)。

I have put the two pieces of code together (originally described in This Question Here).

我现在刚经历了从MPLAB这个错误(Microchip的MPLAB C30)

I have now just experienced this error from MpLab (Microchip MPLAB C30)

 Link Error: Could not allocate section .nbss, size = 20004 bytes, attributes = bss near 

奇怪的事情,我找了该消息,该消息甚至子串,在编译器手册(Microchip的出版DS51284F),并没有发现什么。

Strangest thing, I looked for that message, even sub-strings of that message, in the Compiler manual (Microchip publication DS51284F) and found nothing.

我甚至找了一个字分配并发现它只有三四次,从来没有与一个错误消息。

I even looked for the single word allocate and found it only three or four times, never with an error message.

在此之前把这两code套在一起,我在为0x8000定义的段我使用的内存的大块我们将使用数据的的事情-X移动这的到的的事情-Y

Prior to putting these two pieces of code together, I had a segment defined at 0x8000 which I was using for the "big chunk" of memory we are going to use to move data from Thing-X over to Thing-Y

我缩水,我在为0x8000已确定了下来,以1字节孤立的数据区,而我仍然得到这个错误。

I shrunk that data area which I had defined at 0x8000 down to 1 solitary byte, and I'm still getting this error.

我没有看到这条消息从Microchip的编译器手动DS51284F记录。有没有人之前解决了这个?

I do not see this message documented in the compiler manual DS51284F from Microchip. Has anyone ever resolved this before ?

是否有连接器不同的手册?

Is there a different manual for the linker ?

有没有一种方法,我可以得到一个记忆地图上看到我的记忆区域?

Is there a way that I can get a memory map to see where my memory areas are ?

推荐答案

该错误表明没有足够的内存留在了未初始化变量(近BSS或简称NBSS)Near数据空间。

The error indicates that there is not enough memory left in the near data space for the un-initialized variables (near bss or in short nbss).

您可以使用这些建议,以减少数据内存使用:
1)使用编译器优化,-O3或者-Os。

You can use these recommendations to reduce the data memory usage : 1) Use Compiler Optimizations, -O3 or -Os.

2)选择大数据模型:
- 默认的-msmall-data
- 大(> 8KB)-mlarge数据
- 小(小于8KB =)-msmall数据
默认的数据模型是小

2) Select the Large Data Model under Compiler build options: - default -msmall-data - large (>8KB) -mlarge-data - small (<=8KB) -msmall-data The default data model is small.

3)声明一些远空间的变量。这将释放在不久的RAM空间的空间。

3) Declare some of your variables in far space. This will free up the space in the near ram space.

4)降低的大小或功能的参数数目,为实例,而不是通过值传递的结构的指针传递给代替同一

4) Reduce the size or number of function parameters, for instance rather than passing a structure by value pass a pointer to the same instead.

5)的存储类的某些局部变量更改为静态或使它们全球性的。

5) Change the storage class of some of your local variables to static or make them global.

6)如果可能的话再利用局部变量和参数。

6) Where possible reuse local variables and parameters.

7)使用它并不比他们所需要的是更大的类型,比如计数器变量在for循环有100多个对象只需要像一个char一样大。

7) Use types which are no bigger than what they need to be, for instance the counter variable in for loop over 100 objects need only be as large as a char.

8)将你的一些初始化的数据/阵列到code空间。 -mconst-IN - code

8) Place some of your initialized data / arrays into code space. -mconst-in-code

这篇关于MPLAB链接错误:无法分配部分(C30 C编译器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆