From 2c8058e6575f4e0238a98140d8ddcb5afb11f44c Mon Sep 17 00:00:00 2001
From: ethan <tzj0429@163.com>
Date: Tue, 13 Sep 2022 20:23:06 +0800
Subject: [PATCH] 上传cantp的库

---
 Application/source/fbl_ap.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/Application/source/fbl_ap.c b/Application/source/fbl_ap.c
index 784deb3..d148ac8 100644
--- a/Application/source/fbl_ap.c
+++ b/Application/source/fbl_ap.c
@@ -2,8 +2,8 @@
 #include "fbl_def.h"
 #include "xl_nvic.h"
 #include <string.h>
-__IO uint8_t ProgramRequest[8] __attribute__((section(".noinit_bootReqFlag_ram")));
-__IO uint32_t VectorTable[99] __attribute__((section(".RAMVectorTable")));
+__IO uint8_t ProgramRequest[8] __attribute__((section(".noinit_bootReqFlag")));
+// __IO uint32_t VectorTable[99] __attribute__((section(".RAMVectorTable")));
 
 void FblSetFblProgramRequestFlag(void)
 {
@@ -40,17 +40,11 @@
 {
     void (*pAppFun)(void);
     uint32_t JumpAddr;
-    JumpAddr = (void (*)(void))(*((uint32_t *)((APPLSTART_OFFSET + (uint32_t)4))));
-    pAppFun = (void (*)(void))JumpAddr;
+    JumpAddr = (*((__IO uint32_t *)((APPLSTART_OFFSET + (uint32_t)4))));
+    pAppFun = (void (*)(void))(JumpAddr);
 
     __set_MSP(*(__IO uint32_t *)APPLSTART_OFFSET);
-    /* Copy application vector table to RAM */
-    (void)memcpy((void *)VectorTable, (void *)APPLSTART_OFFSET, sizeof(VectorTable));
-
-    __asm volatile("cpsid i"); // disable all interrupt
     Ostick_ReInit();
-    /* Relocate vector table in SRAM at the adress 0x20000000 */
-    NVIC_SetVectorTable(NVIC_VectTab_RAM, 0); // set vector table at start of ram  	((uint32_t)0x20000000)
-
-    (*pAppFun)(); // jump
+    NVIC_SetVectorTable(NVIC_VectTab_FLASH, APPLSTART_OFFSET);
+    pAppFun(); // jump
 }

--
Gitblit v1.8.0