中级会员
 
- 积分
- 258
- 金钱
- 258
- 注册时间
- 2012-9-17
- 在线时间
- 4 小时
|

楼主 |
发表于 2012-9-22 17:14:05
|
显示全部楼层
回复【2楼】正点原子:
都可以吧。不要在外部sram调试,那是真的 。
---------------------------------
int main(void)
{
RCC_Configuration();
GPIO_Configuration();
NVIC_cfg();
USART_Config();
for( i=0;TxBuf1!='\0';i++) //提示可以输入任意字符
{
USART_SendData(USART2,TxBuf1);
while(USART_GetFlagStatus(USART2, USART_FLAG_TC)==RESET);
}
while (1);
}
以下部分为中断函数,在stm32f10x_it.c文件中
#include "stm32f10x_it.h"
extern FlagStatus RX_status;
void USART2_IRQHandler(void)
{
RX_status = USART_GetITStatus(USART2, USART_IT_RXNE);
if(RX_status == SET)
{
USART_SendData(USART2, USART_ReceiveData(USART2));
while(USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET);
}
}
原子,您好,我是想实现:终端输入任意字符给STM32,然后STM32通过串口打印到终端
通过看资料我也认为应该是可以在0x20000000开始的SRAM中进行中断调试,使用的MDK,在Target Option中配置成在SRAM中调试,并且代码中加上NVIC_SetVectorTable(NVIC_VectTab_RAM,0x0);,结果就是不能进入中断,而Target Option中配置成在FLASH中调试,并且NVIC_SetVectorTable(NVIC_VectTab_FLASH,0x0);其他的都没变结果一切正常,您能帮我分析一下原因吗,或者说哪里容易出错需要特别注意的,谢谢!
PS:小弟菜鸟!
|
|