搜索
bottom↓
回复: 9

JLink IAR NXP2220 出问题了

[复制链接]

出0入0汤圆

发表于 2012-3-6 22:57:54 | 显示全部楼层 |阅读模式
The stack pointer for stack 'CSTACK' (currently 0x9120100A) is outside the stack range (0x00100000 to 0x00102000)
The stack pointer for stack 'IRQ_STACK' (currently 0x9B04502A) is outside the stack range (0x00102000 to 0x00102100)
The stack pointer for stack 'FIQ_STACK' (currently 0x09E5022B) is outside the stack range (0x00102100 to 0x00102200)

JLink  IAR  NXP2220   


为什么会有这个问题?

阿莫论坛20周年了!感谢大家的支持与爱护!!

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

 楼主| 发表于 2012-3-7 09:02:08 | 显示全部楼层
顶起!

出0入0汤圆

发表于 2012-3-7 10:14:14 | 显示全部楼层
有没有UCOS (或者其他RTOS)?

有的话,把堆栈监测插件钩去掉。

没有的话,就是堆栈溢出(或者链接脚本有问题),得去仔细分析原因了。

出0入0汤圆

 楼主| 发表于 2012-3-7 10:31:30 | 显示全部楼层
有没有ucos (或者其他rtos)?
有的话,把堆栈监测插件钩去掉。
没有的话,就是堆栈溢出(或者链接脚本有问题),得去仔细分析原因了。
-----------------------------------------------------------------------

谢谢 只有几行程序  不超过20行!没有任何OS!

出0入0汤圆

发表于 2012-3-7 13:46:12 | 显示全部楼层
是不是堆栈没有设置好?你看下项目设置->linker中的icf文件的配置

出0入0汤圆

 楼主| 发表于 2012-3-7 21:05:07 | 显示全部楼层
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x80000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x80;
define symbol __ICFEDIT_region_ROM_end__   = 0x7FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x100000;
define symbol __ICFEDIT_region_RAM_end__   = 0x1FFFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__   = 0x2000;
define symbol __ICFEDIT_size_svcstack__ = 0x100;
define symbol __ICFEDIT_size_irqstack__ = 0x100;
define symbol __ICFEDIT_size_fiqstack__ = 0x100;
define symbol __ICFEDIT_size_undstack__ = 0x100;
define symbol __ICFEDIT_size_abtstack__ = 0x100;
define symbol __ICFEDIT_size_heap__     = 0x8000;
/**** End of ICF editor section. ###ICF###*/


define memory mem with size = 4G;
define region ROM_region   = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];
define region RAM_region   = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];

define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };

initialize by copy { readwrite };
//initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
do not initialize  { section .noinit };

place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

place in ROM_region   { readonly };
place in RAM_region   { readwrite,
                        block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
                        block UND_STACK, block ABT_STACK, block HEAP };

出0入0汤圆

 楼主| 发表于 2012-3-7 21:10:12 | 显示全部楼层
Wed Mar 07, 2012 21:09:46: JLINK command: ProjectFile = D:\Software\IAR\MyPrj\SmartARM2220\Prj1\settings\first_Debug.jlink, return = 0
Wed Mar 07, 2012 21:09:46: JLINK command: device = LPC2220, return = 0
Wed Mar 07, 2012 21:09:46: DLL version: V4.28c, compiled Jul  1 2011 14:23:12
Wed Mar 07, 2012 21:09:46: Firmware: J-Link ARM V8 compiled Jul  1 2011 12:02:49
Wed Mar 07, 2012 21:09:46: JTAG speed is initially set to: 32 kHz
Wed Mar 07, 2012 21:09:46: Initial reset was performed
Wed Mar 07, 2012 21:09:46: TotalIRLen = 4, IRPrint = 0x01
Wed Mar 07, 2012 21:09:46: Found 1 JTAG device, Total IRLen = 4:
Wed Mar 07, 2012 21:09:46:  #0 Id: 0x4F1F0F0F, IRLen:  4, IRPrint: 0x1 ARM7TDMI-S Core
Wed Mar 07, 2012 21:09:46: J-Link found 1 JTAG device(s). ARM core Id: 4F1F0F0F ARM7
Wed Mar 07, 2012 21:09:46: Device at TAP0 selected
Wed Mar 07, 2012 21:09:46: ETM V1.2
Wed Mar 07, 2012 21:09:46: RTCK reaction time is approx. 252ns
Wed Mar 07, 2012 21:09:46: Auto JTAG speed: Adaptive
Wed Mar 07, 2012 21:09:46: 388 bytes downloaded (6.11 Kbytes/sec)
Wed Mar 07, 2012 21:09:46: Loaded debugee: D:\Software\IAR\MyPrj\SmartARM2220\Prj1\Debug\Exe\first.out
Wed Mar 07, 2012 21:09:46: Target reset
Wed Mar 07, 2012 21:09:46: The stack pointer for stack 'CSTACK' (currently 0x9120142B) is outside the stack range (0x00100000 to 0x00102000)
Wed Mar 07, 2012 21:09:46: The stack pointer for stack 'IRQ_STACK' (currently 0x8904502A) is outside the stack range (0x00102000 to 0x00102100)
Wed Mar 07, 2012 21:09:46: The stack pointer for stack 'FIQ_STACK' (currently 0x08E4022B) is outside the stack range (0x00102100 to 0x00102200)

出0入0汤圆

 楼主| 发表于 2012-3-7 21:14:06 | 显示全部楼层
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x80000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x80;
define symbol __ICFEDIT_region_ROM_end__   = 0x7FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x100000;
define symbol __ICFEDIT_region_RAM_end__   = 0x1FFFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__   = 0x2000;
define symbol __ICFEDIT_size_svcstack__ = 0x100;
define symbol __ICFEDIT_size_irqstack__ = 0x100;
define symbol __ICFEDIT_size_fiqstack__ = 0x100;
define symbol __ICFEDIT_size_undstack__ = 0x100;
define symbol __ICFEDIT_size_abtstack__ = 0x100;
define symbol __ICFEDIT_size_heap__     = 0x8000;
/**** End of ICF editor section. ###ICF###*/


define memory mem with size = 4G;
define region ROM_region   = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];
define region RAM_region   = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];

define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };

initialize by copy { readwrite };
//initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
do not initialize  { section .noinit };

place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

place in ROM_region   { readonly };
place in RAM_region   { readwrite,
                        block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
                        block UND_STACK, block ABT_STACK, block HEAP };

出0入0汤圆

 楼主| 发表于 2012-3-7 21:15:04 | 显示全部楼层
#include<NXP/iolpc2220.h>
void Delay(unsigned int n);

void main(void)
{
  //端口初始化
  IO0PIN_bit.P0_7=0;
  IO0DIR_bit.P0_7=1;
  
  while(1)
  {
  IO0SET_bit.P0_7=1;
  Delay(100000);
  IO0CLR_bit.P0_7=0;
  Delay(100000);
  }
}

void Delay (unsigned int n)
  {
    while(n--);
  }

出0入0汤圆

 楼主| 发表于 2012-3-7 21:19:38 | 显示全部楼层
兄弟们! 靠你们了!
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-7-23 17:14

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

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