[STM32F1] IAR环境下DEBUG模式显示2个ERROR何解

[复制链接]
2906|12
 楼主| mars1479 发表于 2017-3-3 15:16 | 显示全部楼层 |阅读模式
IAR, BUG, ST, se, BLE
Fri Mar 03, 2017 15:03:17: Fatal error: Hardware breakpoints not available at addr 0x20000538.   Session aborted!

Fri Mar 03, 2017 15:03:18: Unable to set SVC Semihosting breakpoint

还有就是在哪里设置CSTACK的大小,有时候显示CSTACK超出了设置的范围。
yklstudent 发表于 2017-3-3 15:21 | 显示全部楼层
有个ICF格式文件,里面就有你想要的;
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08003000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x08003000;
define symbol __ICFEDIT_region_ROM_end__   = 0x0801FFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__   = 0x20003FFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x800;
define symbol __ICFEDIT_size_heap__   = 0x800;
/**** 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 HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };

initialize by copy { readwrite };
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 HEAP };

export symbol __ICFEDIT_region_RAM_start__;
export symbol __ICFEDIT_region_RAM_end__;
 楼主| mars1479 发表于 2017-3-3 15:58 | 显示全部楼层
yklstudent 发表于 2017-3-3 15:21
有个ICF格式文件,里面就有你想要的;
/*###ICF### Section handled by ICF editor, don't touch! ****/
/* ...

糊涂了,多谢多谢,以前的配置文件。
 楼主| mars1479 发表于 2017-3-3 16:52 | 显示全部楼层
yklstudent 发表于 2017-3-3 15:21
有个ICF格式文件,里面就有你想要的;
/*###ICF### Section handled by ICF editor, don't touch! ****/
/* ...

改了下,不报CSTACK大小的问题了,但DEBUG程序还是不跑。

Fri Mar 03, 2017 16:47:33: Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.

有这个问题,不知道是什么原因。

直接RELEASE模式没有任何错误,烧FLASH也没问题,但程序也是没跑。问题出在哪里呢?
usysm 发表于 2017-3-3 17:10 | 显示全部楼层
这个应该不是设置CSTACK的问题
usysm 发表于 2017-3-3 17:10 | 显示全部楼层
看看设置的断点是不是不能读取的。
zoomdy 发表于 2017-3-3 21:29 | 显示全部楼层
可能你设的断点太多了,硬件断点数量是有限的,一般有6个断点或更少。
zoomdy 发表于 2017-3-3 21:33 | 显示全部楼层
Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.

可能是复位向量最低位不为1,Cortex-M要求所有的函数地址最低位为1
  1. Reset_Handler | 0x01
要这样,但是我知道GCC和MDK是会自动将函数地址最低位设置为1的,不知道IAR是不是这样
soodesyt 发表于 2017-3-5 20:47 | 显示全部楼层
CSTACK在哪里设置
soodesyt 发表于 2017-3-5 20:48 | 显示全部楼层
yklstudent 发表于 2017-3-3 15:21
有个ICF格式文件,里面就有你想要的;
/*###ICF### Section handled by ICF editor, don't touch! ****/
/* ...

这个是哪个配置的文件?
yklstudent 发表于 2017-3-5 22:23 | 显示全部楼层
你工程芯片FLASH/RAM配置的文件,编译的时候会用到;
IAR下有FLASH和RAM两个版本,你用过IAR就应该会知道
 楼主| mars1479 发表于 2017-3-6 09:46 | 显示全部楼层
本帖最后由 mars1479 于 2017-3-6 09:48 编辑
zoomdy 发表于 2017-3-3 21:33
可能是复位向量最低位不为1,Cortex-M要求所有的函数地址最低位为1
要这样,但是我知道GCC和MDK是会自动将 ...

你这个最低位置1是在哪里操作的?主函数里面自己主动置1吗?

Rangar 发表于 2017-3-8 21:37 | 显示全部楼层
硬件断点数量是有限的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

19

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部