AnsweredAssumed Answered

stm32f103 IAP App not running with EXTI_Init enabled

Question asked by chan.anson.002 on Jun 5, 2014
Latest reply on Jun 9, 2014 by chan.anson.002
hi, all
I'm working on a IAP function with stm32f103cb.
Partition(IROM1 configuration):
part           base    size
bootloader:0x8000000      0xF800
user app:  0x800F800     0x10000

bootloader: receive user app image from uart and write to P2, jump to P2 when finishing.

#define APPLICATION_ADDRESS  (0x80000000+0xF800)
uint8_t jump_flag = 0;
int main(void)
    if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
      /* Jump to user application */
      JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);
      Jump_To_Application = (pFunction) JumpAddress;
      /* Initialize user application's Stack Pointer */
      __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);

user app: LED binking

void NVIC_Configuration(void)
    NVIC_InitTypeDef NVIC_InitStructure;
    EXTI_InitTypeDef EXTI_InitStructure;
    NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;
        NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
    NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
    GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource0);
    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;          
int main(void)
//    NVIC_Configuration();
    uprintf("LED blinking!");
        GPIOC->ODR ^= GPIO_Pin_13;

the user app runs well if NVIC_Configuration() or EXTI_Init(&EXTI_InitStructure); is commented.
but when uncommented it doesn't work.
It's hard to debug this part. I'm confused if I missed anything.
Any thoughts? Many thanks.