智能车制作

 找回密码
 注册

扫一扫,访问微社区

查看: 9933|回复: 15
打印 上一主题 下一主题

Link Error : L1102: Out of allocation space in segment RAM at address 0x340E

[复制链接]

15

主题

83

帖子

0

精华

高级会员

Rank: 4

积分
594
威望
390
贡献
88
兑换币
37
注册时间
2012-7-28
在线时间
58 小时
跳转到指定楼层
1#
发表于 2012-10-30 22:35:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我在摄像头二值化时Image_Binaryzation(m);一加就有问题

Link Error   : L1102: Out of allocation space in segment RAM at address 0x340E


Link Error   : Link failed


有人懂这是什么意思吗?不会是代码溢出吧

31

主题

619

帖子

0

精华

跨届大侠

大神经常病

Rank: 10Rank: 10Rank: 10

积分
8900

论坛元老奖章在线王奖章活跃会员奖章优秀会员奖章

威望
4214
贡献
2736
兑换币
2252
注册时间
2012-2-15
在线时间
975 小时
2#
发表于 2012-10-30 23:00:06 | 只看该作者
RAM不够啊
回复 支持 反对

使用道具 举报

15

主题

83

帖子

0

精华

高级会员

Rank: 4

积分
594
威望
390
贡献
88
兑换币
37
注册时间
2012-7-28
在线时间
58 小时
3#
 楼主| 发表于 2012-11-1 19:55:16 | 只看该作者
哦,谢谢,后来我改为采集90列就ok啦
回复 支持 反对

使用道具 举报

15

主题

83

帖子

0

精华

高级会员

Rank: 4

积分
594
威望
390
贡献
88
兑换币
37
注册时间
2012-7-28
在线时间
58 小时
4#
 楼主| 发表于 2012-11-1 19:58:47 | 只看该作者
gy810986741 发表于 2012-10-30 23:00
RAM不够啊

再问你一个问题,为什么我用串口调的7620的图像采集发送的数据总是显示9D,9F,而不是0或者1呢?下面是一段代码,你帮我看看,是不是行消隐的时间用的不对,搞了好久啦,不知道怎么弄?
#include <hidef.h>      /* common defines and macros */
#include "derivative.h"      /* derivative-specific definitions */
#include "mc9s12g128.h"
//用OV7620采集
#define ROW        40        //数字摄像头所采集的二维数组行数
#define COLUMN     90        //数字摄像头所采集的二维数组列数
#define ROW_START  17       //数字摄像头二维数组行开始行值
#define ROW_MAX    200       //数字摄像头所采集的二维数组行最大值
#define THRESHOLD  0x20      //图像阈值,根据所采集图像亮度值大小的实际情况
#define  BLACK 0
#define  WHITE 1
                            //调整(OV7620所采集的亮度值大小为0--255)

unsigned char Buffer[ROW][COLUMN]={0};       //所采集的图像二维数组
unsigned char Image_Center[ROW]={0};        //所采集的图像中心线
unsigned char Buffer1[ROW][COLUMN]={0};
unsigned char SampleFlag=0;       //奇偶场标记
unsigned int  m=0;                 //换行变量

unsigned int  Line;               //行中断计数变量
unsigned int  hang;               

unsigned int  Get_Image[]={   
                         17,19,21,23,25,28,31,34,37,40,43,46,49,53,57,
                         61,65,69,73,77,81,85,89,94,99,105,111,117,123,
                         129,135,141,147,153,159,166,173,180,187
                 
                         };     //定每场采哪几行。
void Image_Binaryzation(unsigned int row);                          
/*************************************************************
**********************PLL函数初始化****************************
***************************************************************/
void SetBusCLK_nM(byte nM)
{   
    MMCCTL1=0X00;   
    PKGCR  =0X06;   
    DIRECT =0x00;
    IVBR   =0xFF;   
    ECLKCTL=0xC0;   
    CPMUPROT   =0x26;   //停止保护时钟配置寄存器
    CPMUCLKS_PSTP=0;    //
    CPMUCLKS_PLLSEL=1;  //应用PLL      
    //CPMUSYNR   =nM-1;   //设置分频因子  
    CPMUSYNR   =0x40|(nM-1); //设置分频因子
    CPMUREFDIV =0x80|0x00;   //pllclock=2*(1+SYNR)= MHz;
    CPMUPOSTDIV=0x00;   // Set the post divider register      
    CPMUPOSTDIV=0x00;   // Set the post divider register  
    CPMUPLL    =0x10;   // Set the PLL frequency modulation  
    while(CPMUFLG_LOCK == 0); /* Wait until the PLL is within the desired tolerance of the target frequency */
    CPMUPROT=0x00;            /* Enable protection of clock configuration registers */
}

/*************************************************************/
/*                      行场中断初始化函数                   */
/*************************************************************/
void TIM_Init(void)
{
  TIOS = 0x00;              //外部输入捕捉0,1通道
  TCTL4 = 0x09;             //通道0 上升沿触发,通道1下降沿触发
  TSCR1 = 0x80;             //使能
  TIE = 0x03;               //通道 0,1 中断使能
  TFLG1 = 0xFF;             //清中断标志位
}
/*************************************************************/
/*                      IO口初始化函数                       */
/*************************************************************/
void IO_Init(void)
{
         DDRA = 0X00;             //端口A配置成输入
}
/****************************** *******************************/
/*                     延时函数                              */
/*************************************************************/
void delays(long m)
{
  while(m--);

}
/*************************************************************/
/*                       串口0初始化函数                     */
/*************************************************************/
void SCI_Init()
{
  SCI0BD = 312 ;              //19200bps     Baud Rate=BusClock/(16*SCIBD)
  SCI0CR1 = 0;              //正常8 位模式,无奇偶校验
  SCI0CR2 = 0X2C;              //发送允许  接受中断允许
}

/*************************************************************/
/*                        串口0发送函数                      */
/*************************************************************/
void SCI_Write(unsigned char SendChar)
{
                                         
  while (!(SCI0SR1&0x80));
  SCI0DRH = 0;
  SCI0DRL = SendChar;
}
/**************************************************
** 函数名称: Image_Binaryzation
** 功能描述: 图像数据二值化
** 输 入: row
** 输 出: 无
** 说明:
***************************************************/
void Image_Binaryzation(unsigned int row)  //二值化程序
{
  unsigned char *p_Image;
  unsigned char *q_Image;
    q_Image=&Buffer1[row][0];
  for(p_Image=&Buffer[row][0];p_Image<=&Buffer[row][COLUMN-1];p_Image++)      
    {
      *(q_Image++)=*p_Image;
    }
}

/*************************************************************/
/*                     图像二值化,串口发送给电脑               */
/*************************************************************/
void Process(void)
{
  uchar i,j;
  for(i=0; i<ROW; i++)
  {
   
    for(j=0; j<COLUMN; j++)
    {
      if(Buffer1[j]>THRESHOLD)
        SCI_Write('1');
      else
        SCI_Write('0');
    }
    SCI_Write(0x0D); //回车符
    SCI_Write(0X0A);//换行符
  }
}
void main(void) {
  /* put your own code here */

  SetBusCLK_nM(48);
  TIM_Init();
  IO_Init();
  SCI_Init();

EnableInterrupts;

  for(;;) {
  Process();
  
  }
}
/*************************************************************/
/*                        行中断处理函数                     */
/*************************************************************/
#pragma CODE_SEG __NEAR_SEG NON_BANKED
void interrupt 8    PT0_Interrupt()
{
   
   TFLG1_C0F=1;    //行中断标志位清除,以便于下次行中断进行
   Line++;         //行中断计数变量
   
   if ( SampleFlag == 0 || Line<ROW_START || Line>ROW_MAX )
   {
      return;     //不是要采集图像的有效行,返回                              
    }
   
       if( Line == Get_Image[hang])
  {
   
   delays(12);
   
         
        Buffer[m][0]=PORTA;_asm();Buffer[m][1]=PORTA;_asm();Buffer[m][2]=PORTA;_asm();Buffer[m][3]=PORTA;_asm();Buffer[m][4]=PORTA;_asm();
        Buffer[m][5]=PORTA;_asm();Buffer[m][6]=PORTA;_asm();Buffer[m][7]=PORTA;_asm();Buffer[m][8]=PORTA;_asm();Buffer[m][9]=PORTA;_asm();
        Buffer[m][10]=PORTA;_asm();Buffer[m][11]=PORTA;_asm();Buffer[m][12]=PORTA;_asm();Buffer[m][13]=PORTA;_asm();Buffer[m][14]=PORTA;_asm();
        Buffer[m][15]=PORTA;_asm();Buffer[m][16]=PORTA;_asm();Buffer[m][17]=PORTA;_asm();Buffer[m][18]=PORTA;_asm();Buffer[m][19]=PORTA;_asm();
        Buffer[m][20]=PORTA;_asm();Buffer[m][21]=PORTA;_asm();Buffer[m][22]=PORTA;_asm();Buffer[m][23]=PORTA;_asm();Buffer[m][24]=PORTA;_asm();
        Buffer[m][25]=PORTA;_asm();Buffer[m][26]=PORTA;_asm();Buffer[m][27]=PORTA;_asm();Buffer[m][28]=PORTA;_asm();Buffer[m][29]=PORTA;_asm();
        Buffer[m][30]=PORTA;_asm();Buffer[m][31]=PORTA;_asm();Buffer[m][32]=PORTA;_asm();Buffer[m][33]=PORTA;_asm();Buffer[m][34]=PORTA;_asm();
        Buffer[m][35]=PORTA;_asm();Buffer[m][36]=PORTA;_asm();Buffer[m][37]=PORTA;_asm();Buffer[m][38]=PORTA;_asm();Buffer[m][39]=PORTA;_asm();
        Buffer[m][40]=PORTA;_asm();Buffer[m][41]=PORTA;_asm();Buffer[m][42]=PORTA;_asm();Buffer[m][43]=PORTA;_asm();Buffer[m][44]=PORTA;_asm();
        Buffer[m][45]=PORTA;_asm();Buffer[m][46]=PORTA;_asm();Buffer[m][47]=PORTA;_asm();Buffer[m][48]=PORTA;_asm();Buffer[m][49]=PORTA;_asm();
        Buffer[m][50]=PORTA;_asm();Buffer[m][51]=PORTA;_asm();Buffer[m][52]=PORTA;_asm();Buffer[m][53]=PORTA;_asm();Buffer[m][54]=PORTA;_asm();
        Buffer[m][55]=PORTA;_asm();Buffer[m][56]=PORTA;_asm();Buffer[m][57]=PORTA;_asm();Buffer[m][58]=PORTA;_asm();Buffer[m][59]=PORTA;_asm();
        Buffer[m][60]=PORTA;_asm();Buffer[m][61]=PORTA;_asm();Buffer[m][62]=PORTA;_asm();Buffer[m][63]=PORTA;_asm();Buffer[m][64]=PORTA;_asm();
        Buffer[m][65]=PORTA;_asm();Buffer[m][66]=PORTA;_asm();Buffer[m][67]=PORTA;_asm();Buffer[m][68]=PORTA;_asm();Buffer[m][69]=PORTA;_asm();
        Buffer[m][70]=PORTA;_asm();Buffer[m][71]=PORTA;_asm();Buffer[m][72]=PORTA;_asm();Buffer[m][73]=PORTA;_asm();Buffer[m][74]=PORTA;_asm();
        Buffer[m][75]=PORTA;_asm();Buffer[m][76]=PORTA;_asm();Buffer[m][77]=PORTA;_asm();Buffer[m][78]=PORTA;_asm();Buffer[m][79]=PORTA;_asm();
        Buffer[m][80]=PORTA;_asm();Buffer[m][81]=PORTA;_asm();Buffer[m][82]=PORTA;_asm();Buffer[m][83]=PORTA;_asm();Buffer[m][84]=PORTA;_asm();
        Buffer[m][85]=PORTA;_asm();Buffer[m][86]=PORTA;_asm();Buffer[m][87]=PORTA;_asm();Buffer[m][88]=PORTA;_asm();Buffer[m][89]=PORTA;_asm();
   //     Buffer[m][90]=PORTA;_asm();Buffer[m][91]=PORTA;_asm();Buffer[m][92]=PORTA;_asm();Buffer[m][93]=PORTA;_asm();Buffer[m][94]=PORTA;_asm();
   //     Buffer[m][95]=PORTA;_asm();Buffer[m][96]=PORTA;_asm();Buffer[m][97]=PORTA;_asm();Buffer[m][98]=PORTA;_asm();Buffer[m][99]=PORTA;_asm();
   //     Buffer[m][100]=PORTA;_asm();Buffer[m][101]=PORTA;_asm();Buffer[m][102]=PORTA;_asm();Buffer[m][103]=PORTA;_asm();Buffer[m][104]=PORTA;_asm();
   //     Buffer[m][105]=PORTA;_asm();Buffer[m][106]=PORTA;_asm();Buffer[m][107]=PORTA;_asm();Buffer[m][108]=PORTA;_asm();Buffer[m][109]=PORTA;_asm();
   //     Buffer[m][110]=PORTA;_asm();Buffer[m][111]=PORTA;_asm();Buffer[m][112]=PORTA;_asm();Buffer[m][113]=PORTA;_asm();Buffer[m][114]=PORTA;_asm();
   //     Buffer[m][115]=PORTA;_asm();Buffer[m][116]=PORTA;_asm();Buffer[m][117]=PORTA;_asm();Buffer[m][118]=PORTA;_asm();Buffer[m][119]=PORTA;_asm();
   //     Buffer[m][120]=PORTA;
     // Image_Binaryzation(m);
      hang++;               
      m++;
      
   }
   Image_Binaryzation(m);
}
/*************************************************************/
/*                        场中断处理函数                     */
/*************************************************************/
#pragma CODE_SEG __NEAR_SEG NON_BANKED
void interrupt 9 PT1_Interrupt()
{
             TFLG1_C1F = 1;              //场中断清楚,以便于下次的场中断的正常进行
             TFLG1_C0F = 1;              //行中断清除,以便于开始采集图像数据
             m = 0;                      //行中间变量清零,以便于开始从把采集的图像放到数组的第一行
             Line = 0;                   //行中断临时变量清零
             hang = 0;                   //行临时变量清除
             SampleFlag =~ SampleFlag;   //场中断标记取反,这样只采集奇数场的图像
}
回复 支持 反对

使用道具 举报

31

主题

619

帖子

0

精华

跨届大侠

大神经常病

Rank: 10Rank: 10Rank: 10

积分
8900

论坛元老奖章在线王奖章活跃会员奖章优秀会员奖章

威望
4214
贡献
2736
兑换币
2252
注册时间
2012-2-15
在线时间
975 小时
5#
发表于 2012-11-1 22:06:10 | 只看该作者
Roy罗先森 发表于 2012-11-1 19:58
再问你一个问题,为什么我用串口调的7620的图像采集发送的数据总是显示9D,9F,而不是0或者1呢?下面是一 ...

你是不是点了十六进制显示?改成二进制
回复 支持 反对

使用道具 举报

15

主题

83

帖子

0

精华

高级会员

Rank: 4

积分
594
威望
390
贡献
88
兑换币
37
注册时间
2012-7-28
在线时间
58 小时
6#
 楼主| 发表于 2012-11-1 22:19:45 | 只看该作者
我是上一个星期开始搞飞思卡尔的,原来是这样,懂啦,但我用的串口调试助手上只有16进制显示,没有二进制显示,你用的是什么调试助手,发给我一份吧,谢谢啦295863196@qq.com
回复 支持 反对

使用道具 举报

15

主题

83

帖子

0

精华

高级会员

Rank: 4

积分
594
威望
390
贡献
88
兑换币
37
注册时间
2012-7-28
在线时间
58 小时
7#
 楼主| 发表于 2012-11-1 22:21:53 | 只看该作者
我用的串口调试助手控制面板上只有十六进制显示没有二进制显示,你用的是什么串口调试助手,发给我一份吧,谢谢啦295863196@qq.com
回复 支持 反对

使用道具 举报

47

主题

788

帖子

1

精华

跨届大侠

Rank: 10Rank: 10Rank: 10

积分
6116
威望
3442
贡献
1406
兑换币
1753
注册时间
2012-2-3
在线时间
634 小时
毕业学校
浙江工业大学
8#
发表于 2013-5-19 16:36:44 | 只看该作者
兄弟,你是不是用冷火的?
回复 支持 反对

使用道具 举报

39

主题

850

帖子

0

精华

跨届大侠

同学,今晚去你宿舍偷高压锅。

Rank: 10Rank: 10Rank: 10

积分
8530

活跃会员奖章优秀会员奖章在线王奖章论坛元老奖章

QQ
威望
3783
贡献
2239
兑换币
2331
注册时间
2012-7-26
在线时间
1255 小时
9#
发表于 2013-5-19 17:13:59 | 只看该作者
RAM爆了,修改内存分配吧。
回复 支持 反对

使用道具 举报

24

主题

1175

帖子

0

精华

常驻嘉宾

Rank: 8Rank: 8

积分
5379
威望
2669
贡献
1706
兑换币
1811
注册时间
2012-10-29
在线时间
502 小时
10#
发表于 2013-5-29 11:05:08 | 只看该作者
⊙Lin⊙ 发表于 2013-5-19 17:13
RAM爆了,修改内存分配吧。

这个要怎么改啊?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关于我们|联系我们|小黑屋|智能车制作 ( 黑ICP备2022002344号

GMT+8, 2024-6-18 22:09 , Processed in 0.055601 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表