共2条
1/1 1 跳转至页
LF2407,can,allocate,bbs,in,b2 LF2407编译出现的错误“can't allocate .bbs in b2”

问
我用的是cc2000 ,cmd 文件如下:
MEMORY
{
PAGE 0:
VECS origin = 0000h, length = 0040h
FLASH: origin = 100h, length = 7F00h
SARAM_P: origin = 8100h, length = 1000h
PAGE 1:
B2: origin = 0060h, length = 020h
B0: origin = 200h, length = 100h
B1: origin = 300h, length = 100h
SARAM_D: origin = 0C00h, length = 400h
}
SECTIONS
{
vectors: > VECS PAGE 0
.text: > FLASH PAGE 0
.data: > FLASH PAGE 0
.bss: > B2 PAGE 1
stack: > B1 PAGE 1
buffer: > SARAM_D PAGE 1
}
主函数如下:
#include "inc.h"
int a;
void asdfsdf(void)
{
int i;
for(i=0;i<10000;i++)
{
a++;
}
}
void main(void)
{
int i=0;
a=1;
a=SSS;
for(i=0;i<10000;i++)
{
asdfsdf();
a+=i;
a++;
}
}
编译后出现如下错误:
>> CANnot allocate .bss in B2 (page 1)
>> errors in input - wen2.out not built
Build Complete,
2 Errors, 0 Warnings.
请高手指教一二!!!不胜感激!!
答 1: re不要把。bss放在B2看看
还有project->options中路径没有设定好 答 2: .bss变量分配不成功.bss: > B2 PAGE 1
把B2 改为SARAM_D较为合适
答 3: 改了,出现新错误!!!>> CAN't allocate .stack, size 00000400 (page 1)
>> errors in input - wen2.out not built
Build Complete,
2 Errors, 0 Warnings. 答 4: 一般是存储器空间不够出上面的错误. 答 5: 在cmd 文件中加条语句,好使!!!-STACK 40 /*后加的*/
MEMORY
{
PAGE 0:
VECS : origin = 0000h, length = 003fh
FLASH: origin = 44h, length = 7fbbh
SARAM_P: origin = 8000h, length = 7ffh
PAGE 1:
B2: origin = 0060h, length = 020h
B0: origin = 200h, length = 100h
B1: origin = 300h, length = 100h
SARAM_D: origin = 0800h, length = 800h
}
SECTIONS
{
.vectors: > VECS PAGE 0
.text: > FLASH PAGE 0
.data: > FLASH PAGE 0
.bss: > SARAM_D PAGE 1
.stack: > B1 PAGE 1
.buffer: > SARAM_D PAGE 1
}
虽然好使,但是,不知为什么! 答 6: 制定stack区的大小,具体可见help->stack optionThe C/C++ compiler uses an uninitialized section, .stack, to allocate space for the run-time stack. You CAN set the size of this section at link time with the -stack option. Specify the size as a constant immediately after the option. The example below creates a stack that is 4K words in size:
lnk2000 -stack 0x1000 /* defines a 4K stack (.stack section) */
If you specify a different stack size in an input section, the input section stack size is ignored. Any symbols defined in the input section remain valid; only the stack size is different.
When the linker defines the .stack section, it also defines a global symbol, __STACK_SIZE, and assigns it a value equal to the size of the section. The default software stack size is 1K words.
MEMORY
{
PAGE 0:
VECS origin = 0000h, length = 0040h
FLASH: origin = 100h, length = 7F00h
SARAM_P: origin = 8100h, length = 1000h
PAGE 1:
B2: origin = 0060h, length = 020h
B0: origin = 200h, length = 100h
B1: origin = 300h, length = 100h
SARAM_D: origin = 0C00h, length = 400h
}
SECTIONS
{
vectors: > VECS PAGE 0
.text: > FLASH PAGE 0
.data: > FLASH PAGE 0
.bss: > B2 PAGE 1
stack: > B1 PAGE 1
buffer: > SARAM_D PAGE 1
}
主函数如下:
#include "inc.h"
int a;
void asdfsdf(void)
{
int i;
for(i=0;i<10000;i++)
{
a++;
}
}
void main(void)
{
int i=0;
a=1;
a=SSS;
for(i=0;i<10000;i++)
{
asdfsdf();
a+=i;
a++;
}
}
编译后出现如下错误:
>> CANnot allocate .bss in B2 (page 1)
>> errors in input - wen2.out not built
Build Complete,
2 Errors, 0 Warnings.
请高手指教一二!!!不胜感激!!
答 1: re不要把。bss放在B2看看
还有project->options中路径没有设定好 答 2: .bss变量分配不成功.bss: > B2 PAGE 1
把B2 改为SARAM_D较为合适
答 3: 改了,出现新错误!!!>> CAN't allocate .stack, size 00000400 (page 1)
>> errors in input - wen2.out not built
Build Complete,
2 Errors, 0 Warnings. 答 4: 一般是存储器空间不够出上面的错误. 答 5: 在cmd 文件中加条语句,好使!!!-STACK 40 /*后加的*/
MEMORY
{
PAGE 0:
VECS : origin = 0000h, length = 003fh
FLASH: origin = 44h, length = 7fbbh
SARAM_P: origin = 8000h, length = 7ffh
PAGE 1:
B2: origin = 0060h, length = 020h
B0: origin = 200h, length = 100h
B1: origin = 300h, length = 100h
SARAM_D: origin = 0800h, length = 800h
}
SECTIONS
{
.vectors: > VECS PAGE 0
.text: > FLASH PAGE 0
.data: > FLASH PAGE 0
.bss: > SARAM_D PAGE 1
.stack: > B1 PAGE 1
.buffer: > SARAM_D PAGE 1
}
虽然好使,但是,不知为什么! 答 6: 制定stack区的大小,具体可见help->stack optionThe C/C++ compiler uses an uninitialized section, .stack, to allocate space for the run-time stack. You CAN set the size of this section at link time with the -stack option. Specify the size as a constant immediately after the option. The example below creates a stack that is 4K words in size:
lnk2000 -stack 0x1000 /* defines a 4K stack (.stack section) */
If you specify a different stack size in an input section, the input section stack size is ignored. Any symbols defined in the input section remain valid; only the stack size is different.
When the linker defines the .stack section, it also defines a global symbol, __STACK_SIZE, and assigns it a value equal to the size of the section. The default software stack size is 1K words.
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【EEPW电子工程师创研计划】技术变现通道已开启~ | |
发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
【EEPW在线】E起听工程师的声音! | |
“我踩过的那些坑”主题活动——第001期 | |
高校联络员开始招募啦!有惊喜!! | |
【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
送您一块开发板,2025年“我要开发板活动”又开始了! | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
电流检测模块MAX4080S被打赏10分 | |
【我踩过的那些坑】calloc和malloc错误使用导致跑飞问题排查被打赏50分 | |
多组DCTODC电源方案被打赏50分 | |
【我踩过的那些坑】STM32cubeMX软件的使用过程中的“坑”被打赏50分 | |
新手必看!C语言精华知识:表驱动法被打赏50分 | |
【我踩过的那些坑】杜绑线问题被打赏50分 | |
【我踩过的那些坑】STM32的硬件通讯调试过程的“坑”被打赏50分 | |
【我踩过的那些坑】晶振使用的问题被打赏100分 | |
【我踩过的那些坑】电感选型错误导致的处理器连接不上被打赏50分 | |
【我踩过的那些坑】工作那些年踩过的记忆深刻的坑被打赏10分 |