سلام توی بوت لودر برای جامپ به ادرس 8000 که شروع برناممه از دو برنامه زیر استفاده میکنم ولی جامپ نمیکنه
کسی میتونه بگه ایرادش چیه و یا یه کدی بزاره که درست جامپ کنه؟
مرسی
کد:
__asm void boot_jump( uint32_t address ){
LDR SP, [R0] ;Load new stack pointer address
LDR PC, [R0, #4] ;Load new program counter address
}
void execute_user_code(void)
{
/* Change the Vector Table to the USER_FLASH_START
in case the user application uses interrupts */
SCB->VTOR = USER_FLASH_START & 0x1FFFFF80;
boot_jump(USER_FLASH_START);
}
کد:
typedef void __attribute__((noreturn)) (*exec)();
uint32_t *start ;
SCB->VTOR = USER_FLASH_START;
// set stack pointer to start address of second binary. The start address of a new binary contains the address of the stack pointer
__set_MSP(*(uint32_t*) USER_FLASH_START);
// jump to the new binary
start = (uint32_t*) (USER_FLASH_START + 4); // address of the reset vector for the new binary
((exec)(*start))();