int main(void) { /* Setup STM32 system (clock, PLL and Flash configuration) */ SystemInit();
/*Init Spi*/ SPI_Flash_Init();
/*USART Init*/ Usart_init();
RunRead(STATEADDRESS,0,100,(u8 *)State.InArray);//读SPI Flash if((State.InState.UpdateApption0 + State.InState.UpdateApption1 + State.InState.UpdateApption2 + State.InState.UpdateApption3 + State.InState.UpdateApption4) > 3)//检查更新标志位,是否需要更新 { UpDateApplication(); } else//跳转到应用程序区 { /* Test if user code is programmed starting from address "ApplicationAddress" */ if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000) { /* Jump to user application */ JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4); Jump_To_Application = (pFunction) JumpAddress; /* Initialize user application's Stack Pointer */ __set_MSP(*(__IO uint32_t*) ApplicationAddress); Jump_To_Application(); } } /* Infinite loop */ while (1) { } }
程序执行到这句: /* Test if user code is programmed starting from address "ApplicationAddress" */ if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000) 判断结果为假,下面就得不到执行。。