OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 8716|回复: 5

正点原子 mini板 EXTI问题求助

[复制链接]

2

主题

7

帖子

0

精华

新手上路

积分
35
金钱
35
注册时间
2014-4-26
在线时间
0 小时
发表于 2015-1-18 13:31:34 | 显示全部楼层 |阅读模式
5金钱
Set JLink Project File to "F:\正点原子\4,程序源码\2,标准例程-V3.5库函数版本\实验5 外部中断实验\USER\JLinkSettings.ini"* JLink Info: Device "STM32F103RB" selected (128 KB flash, 20 KB RAM).

Target info:
------------
Device: STM32F103RB
VTarget = 3.313V
State of Pins: TCK: 0, TDI: 1, TDO: 0, TMS: 1, TRES: 1, TRST: 1
Hardware-Breakpoints: 6
Software-Breakpoints: 8192
Watchpoints:          4
JTAG speed: 4000 kHz

 



 
Load "..\\OBJ\\EXIT.axf" 
**JLink Warning: CPU could not be halted
***JLink Error: Can not read register 15 (R15) while CPU is running
***JLink Error: Can not read register 16 (XPSR) while CPU is running
**JLink Warning: CPU could not be halted
***JLink Error: Could not start CPU core. (ErrorCode: -1)
***JLink Error: Can not read register 0 (R0) while CPU is running
***JLink Error: Can not read register 1 (R1) while CPU is running
***JLink Error: Can not read register 2 (R2) while CPU is running
***JLink Error: Can not read register 3 (R3) while CPU is running
***JLink Error: Can not read register 4 (R4) while CPU is running
***JLink Error: Can not read register 5 (R5) while CPU is running
***JLink Error: Can not read register 6 (R6) while CPU is running
***JLink Error: Can not read register 7 (R7) while CPU is running
***JLink Error: Can not read register 8 (R8) while CPU is running
***JLink Error: Can not read register 9 (R9) while CPU is running
***JLink Error: Can not read register 10 (R10) while CPU is running
***JLink Error: Can not read register 11 (R11) while CPU is running
***JLink Error: Can not read register 12 (R12) while CPU is running
***JLink Error: Can not read register 13 (R13) while CPU is running
***JLink Error: Can not read register 14 (R14) while CPU is running
***JLink Error: Can not read register 15 (R15) while CPU is running
***JLink Error: Can not read register 16 (XPSR) while CPU is running
***JLink Error: Can not read register 17 (MSP) while CPU is running
***JLink Error: Can not read register 18 (PSP) while CPU is running
***JLink Error: Can not read register 20 (CFBP) while CPU is running

              代码如下:

 
[mw_shl_code=c,true] GPIO_InitTypeDef GPIO_InitStructure; //初始化KEY0-->GPIOA.13,KEY1-->GPIOA.15 上拉输入 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOE,ENABLE);//使能PORTA,PORTE时钟 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2|GPIO_Pin_5|GPIO_Pin_4;//PE2~4 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; //设置成上拉输入 GPIO_Init(GPIOC, &GPIO_InitStructure);//初始化GPIOE2,3,4 // GPIO_SetBits( GPIOC, GPIO_Pin_4); RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE); //使能复用功能时钟 //GPIOE.2 中断线以及中断初始化配置 下降沿触发 GPIO_EXTILineConfig(GPIO_PortSourceGPIOC,GPIO_PinSource4); EXTI_InitStructure.EXTI_Line=EXTI_Line4; //KEY2 EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; EXTI_InitStructure.EXTI_LineCmd = ENABLE; EXTI_Init(&EXTI_InitStructure); //根据EXTI_InitStruct中指定的参数初始化外设EXTI寄存器 NVIC_InitStructure.NVIC_IRQChannel = EXTI4_IRQn; //使能按键KEY0所在的外部中断通道 NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01; //抢占优先级2 NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x00; //子优先级0 NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //使能外部中断通道 NVIC_Init(&NVIC_InitStructure); //根据NVIC_InitStruct中指定的参数初始化外设NVIC寄存器 EXTI_ClearITPendingBit( EXTI_Line4);
[mw_shl_code=c,true]void EXTI4_IRQHandler(void) { // delay_ms(10);//消抖 // GPIO_SetBits( GPIOC, GPIO_Pin_4); // if(KEY0==0) //按键KEY0 { LED0=!LED0; // LED1=!LED1; } EXTI_ClearITPendingBit(EXTI_Line4); //清除LINE4上的中断标志位 } [/mw_shl_code]

[/mw_shl_code]




最佳答案

凡事都要认真。用心。
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2015-1-18 13:31:35 | 显示全部楼层
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复

使用道具 举报

39

主题

2026

帖子

1

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
2020
金钱
2020
注册时间
2013-5-1
在线时间
87 小时
发表于 2015-1-18 13:42:44 | 显示全部楼层
是不是和JTAG的引脚冲突
博观而约取,厚积而薄发。
回复

使用道具 举报

2

主题

7

帖子

0

精华

新手上路

积分
35
金钱
35
注册时间
2014-4-26
在线时间
0 小时
 楼主| 发表于 2015-1-18 13:47:39 | 显示全部楼层
回复【2楼】745021926:
---------------------------------
没有啊,其他程序可以调试,我看了引脚,我用的是板子上的PC4!,有没有其他情况啊?谢谢
凡事都要认真。用心。
回复

使用道具 举报

39

主题

2026

帖子

1

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
2020
金钱
2020
注册时间
2013-5-1
在线时间
87 小时
发表于 2015-1-18 13:53:09 | 显示全部楼层
回复【3楼】snailone008:
---------------------------------
这个程序其他地方没用到JTAG的脚吧?程序中有没有禁止JTAG
博观而约取,厚积而薄发。
回复

使用道具 举报

2

主题

7

帖子

0

精华

新手上路

积分
35
金钱
35
注册时间
2014-4-26
在线时间
0 小时
 楼主| 发表于 2015-1-19 13:41:28 | 显示全部楼层
我用的是战舰的代码,做的EXTI实验,后来看了Mini的exti,发现代码文档里有注释,说EXTI再用SW调试时,有问题!。
凡事都要认真。用心。
回复

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-8-8 18:19

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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