登录 免费注册 首页 | 行业黑名单 | 帮助
维库电子市场网
技术交流 | 电路欣赏 | 工控天地 | 数字广电 | 通信技术 | 电源技术 | 测控之家 | EMC技术 | ARM技术 | EDA技术 | PCB技术 | 嵌入式系统
驱动编程 | 集成电路 | 器件替换 | 模拟技术 | 新手园地 | 单 片 机 | DSP技术 | MCU技术 | IC 设计 | IC 产业 | CAN-bus/DeviceNe

LF2407编译出现的错误“can't allocate .bbs in b2”

作者:kinggowen 栏目:DSP技术
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.


请高手指教一二!!!不胜感激!!



2楼: >>参与讨论
lengxb
re
不要把。bss放在B2看看
还有project->options中路径没有设定好

3楼: >>参与讨论
meteo
.bss变量分配不成功
.bss:           > B2            PAGE 1
把B2 改为SARAM_D较为合适


4楼: >>参与讨论
kinggowen
改了,出现新错误!!!
>> can't allocate .stack, size 00000400 (page 1)
>> errors in input - wen2.out not built
Build Complete,
  2 Errors, 0 Warnings.

5楼: >>参与讨论
不爱说话
一般是存储器空间不够出上面的错误.
 
6楼: >>参与讨论
kinggowen
在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
}


虽然好使,但是,不知为什么!

7楼: >>参与讨论
meteo
制定stack区的大小,具体可见help->stack option
The 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.

参与讨论
昵称:
讨论内容:
 
 
相关帖子
求助:MAX260开关电容滤波器的使用
5402的MCBSP怎么这么怪?
有关程序运行时间的问题
语句下面是反汇编语句,如何去掉反汇编语句????
关于EDMA和MCBSP的问题!
免费注册为维库电子开发网会员,参与电子工程师社区讨论,点此进入


Copyright © 1998-2006 www.dzsc.com 浙ICP证030469号