//
// Return control to the boot loader. This is a call to the SVC
// handler in the boot loader.
//
(*((void (*)(void))(*(unsigned long *)0x2c)))();
这个是E:StellarisWare-6852oardsdk-lm3s9b96-ili9325oot_demo1这个工程里面的,函数全部如下:
//*****************************************************************************
//
// Passes control to the bootloader and initiates a remote software update.
//
// This function passes control to the bootloader and initiates an update of
// the main application firmware image via UART0, Ethernet or USB depending
// upon the specific boot loader binary in use.
//
//
eturn Never returns.
//
//*****************************************************************************
void
JumpToBootLoader(void)
{
//
// We must make sure we turn off SysTick and its interrupt before entering
// the boot loader!
//
SysTickIntDisable();
SysTickDisable();
//
// Disable all processor interrupts. Instead of disabling them
// one at a time, a direct write to NVIC is done to disable all
// peripheral interrupts.
//
HWREG(NVIC_DIS0) = 0xffffffff;
HWREG(NVIC_DIS1) = 0xffffffff;
//
// Return control to the boot loader. This is a call to the SVC
// handler in the boot loader.
//
(*((void (*)(void))(*(unsigned long *)0x2c)))();
}
函数的意义应该是跳转到升级程序里面去,但是目前困惑是为啥升级函数的地址是0x2C而不是其他?在MDK里面能够看见链接后函数的绝对地址吗?怎么看?谢谢!
ps:我在我的程序里面调用这个函数(有bootloader的),直接崩溃。
此帖出自
小平头技术问答
谢谢楼上回复。
我看见了,应该是在这个地方:
if :def:_FLASH_PATCH_COMPATIBLE
dcd UpdateHandler + 0x1000 ; Offset 2C: SVCall handler
else
dcd UpdateHandler ; Offset 2C: SVCall handler
endif
但是很奇怪,我的bootloader里面都有这个函数的,那为啥会出现硬件错误的故障?楼上能否提供点思路,谢谢?
ps,bootloader和app是分开的工程,不过我觉得在app里面直接调用的是地址,应该不会有问题才对。
一周热门 更多>