Hallo,
ich möchte gern einen Bootloader schreiben, der ein weiteres Programm
starten kann (für den STM32F103).
Der Bootloader soll im Flash von 0x8000000 bis 0x800FFFF und das zweite
Programm ab 0x8010000 abgespeichert sein.
1 | __asm void jump_to_application(void)
|
2 | {
|
3 | ; program stack pointer of application
|
4 | LDR R0, =0x8010000
|
5 | LDR SP, [R0]
|
6 |
|
7 | ; extract entry point into application
|
8 | LDR R0, =0x8010004
|
9 |
|
10 | ; jump
|
11 | LDR PC, [R0]
|
12 | }
|
13 |
|
14 | int main(void)
|
15 | {
|
16 |
|
17 | stm32_Init (); /processor init
|
18 |
|
19 | jump_to_application();
|
20 |
|
21 | while(1);
|
22 |
|
23 | }
|
Zwar wird das zweite Programm ausgeführt, aber Timer / Interrupts etc.
funktionieren nicht.
Gruß
Bernd