WXK
2025-05-23 8415b6bc61925a1a234fe393d8375d3828756931
dualboots_Gai_youhua/keil/customboot/include/drivers/menu.c
@@ -203,17 +203,19 @@
            flash_write_nbytes(FLASH_ID0,APP_CONFIG_IAPFLAG_MAP,(uint8_t*)&tmp,2);
//            SPIFlash_Erase(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP,2, SPI_FLASH_SECTOR_ERASE_MODE_4K);  MK8000修改
//            SPIFlash_Write(SPI_FLASH_ID_0, APP_CONFIG_IAPFLAG_MAP, (HIDO_UINT8*)&tmp, sizeof(tmp)); 
                        delay_ms(100);
                              //LOG_INFO(TRACE_MODULE_APP,"升级失败重启\r\n\n");
                              NVIC_SystemReset();
//           if (((*(__IO uint32_t*)APP_CONFIG_APPLICATION_ADDRESS) & 0x2FFE0000 ) == 0x20000000)先注释掉即一成功就跳转
//            { 
               /* Jump to user application */
               //Serial0PutString("跳转APP\r\n");
               memcpy((void *)SRAM_BASE, (void *)APP_CONFIG_APPLICATION_ADDRESS, APP_CONFIG_APPLICATION_SIZE);
             // setup new msp
               __set_MSP(*(uint32_t *)SRAM_BASE);
               //Serial0PutString("跳转APP后\r\n");
               typedef void (*p_entry_t)(void);
               ((p_entry_t) (*(uint32_t *)(SRAM_BASE + 4) + SRAM_BASE))();
//               memcpy((void *)SRAM_BASE, (void *)APP_CONFIG_APPLICATION_ADDRESS, APP_CONFIG_APPLICATION_SIZE);
//             // setup new msp
//               __set_MSP(*(uint32_t *)SRAM_BASE);
//               //Serial0PutString("跳转APP后\r\n");
//               typedef void (*p_entry_t)(void);
//               ((p_entry_t) (*(uint32_t *)(SRAM_BASE + 4) + SRAM_BASE))();
               
            //JumpAddress = *(__IO uint32_t*) (SRAM_BASE + 4);