无法跳入arduino引导加载程序 [英] cannot jump into arduino boot loader
问题描述
我想从应用程序跳转到引导加载程序(我通过蓝牙加载并有一个应用程序命令跳转到引导加载程序).
I want to jump from my application to the bootloader ( I load via bluetooth and have an application command to jump to the boot loader).
以下工作:
void* bl = (void *) 0x3c00;
goto *bl;
或
asm volatile { jmp BOOTL ::}
asm volatile { .org 0x3c00
BOOTL: }
(但代码大小增加到0x3c00)
(but code size grows to 0x3c00)
但是,最明显的选择
asm volatile { jmp 0x3c00 ::}
不会(似乎甚至不会产生代码}
does not (seems it does not even produce code }
知道为什么吗?
推荐答案
0x3C00是16位字地址.
0x3C00 is a 16-bit word address.
如果使用goto,请在GCC中使用0x7800. GCC使用字节地址(0x3C00 * 2 = 0x7800).
Use 0x7800 in GCC if you are using goto. GCC uses byte address (0x3C00 * 2 = 0x7800).
示例:
void *bl = (void *) 0x7800;
goto *bl;
将创建以下汇编语言(请参阅* .lss输出文件):
will create the following assembly language (see *.lss output file):
c4:0c 94 00 3c jmp 0x7800; 0x7800< __ stack + 0x6d01>
c4: 0c 94 00 3c jmp 0x7800 ; 0x7800 <__stack+0x6d01>
这篇关于无法跳入arduino引导加载程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!