问题有了更进一步的原因,就是我的APP在main函数设置完中断向量后即进入停机模式,现在的问题是无法 正 常唤醒,从IAP跳转至APP是成功的,因为打印正常。而我正常调试时(不使用IAP)是一切正常的。mai函数如下
int main(void)
{
SystemInit();
/* Set the Vector Table base location at 0x3000 */
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x3000);
Uart_Init(); //UART通讯的设定
Delayms(1000);
Uart_Send("STM32L152 Stylus printer is runing.\r\n");
Key_GPIO_Init();
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
while(1)
{
//应用程序
}
}
void Key_GPIO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
/* config the extiline*/
RCC_AHBPeriphClockCmd(RCC_KEY_POWER_PORT,ENABLE);
/* config the NVIC*/
NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
/* EXTI line gpio config */
GPIO_InitStructure.GPIO_Pin = KEY_POWER_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; // 上拉拉输入
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(KEY_POWER_PORT, &GPIO_InitStructure);
/* Enable SYSCFG clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
/* Connect EXTI0 Line to key1 pin */
SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource0);
/* EXTI line mode config */
EXTI_InitStructure.EXTI_Line = EXTI_Line0;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; //下降沿中断
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
}
有没有谁遇到过类似问题啊,真的百思不得其解啊。我做过STM32F103,STM32F072都是这样做的就没问题。
|