打印

jtag仿真时延时函数跳不出来

[复制链接]
1832|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
linfuchi|  楼主 | 2010-5-26 09:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 linfuchi 于 2010-5-26 10:27 编辑

在KEIL Uvision中void Delay(__IO uint32_t nCount){}函数跳不出来,什么缘故?
这样调用的:Delay(0x8ffff);

#include "stm32f10x.h"
#include "stm32_eval.h"

GPIO_InitTypeDef GPIO_InitStructure;
/* Private function prototypes -----------------------------------------------*/
void RCC_Configuration(void);
void Delay(__IO uint32_t nCount);

void main(void)
{
  /* System Clocks Configuration **********************************************/
  RCC_Configuration();   
  /* Configure all unused GPIO port pins in Analog Input mode (floating input
     trigger OFF), this will reduce the power consumption and increase the device
     immunity against EMI/EMC *************************************************/
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE);//开GPIOA
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;          GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  GPIO_Init(GPIOA, &GPIO_InitStructure);
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
  
  while (1)
  {
       GPIO_SetBits(GPIOA, GPIO_Pin_6);  //GPIOC.6=1
       Delay(0x8ffff);
       GPIO_ResetBits(GPIOA, GPIO_Pin_6);    //GPIOC.6=0
       Delay(0x8ffff);

  }
}

void RCC_Configuration(void)
{   
  /* Setup the microcontroller system. Initialize the Embedded Flash Interface,  
     initialize the PLL and update the SystemFrequency variable. */
  SystemInit();
}

void Delay(__IO uint32_t nCount)
{
  for(; nCount != 0; nCount--);
}
沙发
ST_ARM| | 2010-6-17 11:58 | 只看该作者
在调用Delay(__IO uint32_t nCount)时,将输入参数的只设为比较小的值,如6,进入函数单步执行,看看问题出在哪里。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

43

主题

474

帖子

1

粉丝