Skip to content
Snippets Groups Projects
Commit 8139dfb2 authored by Micah Elizabeth Scott's avatar Micah Elizabeth Scott
Browse files

Launch application from flash

parent 7bb4704e
No related branches found
No related tags found
No related merge requests found
......@@ -96,12 +96,23 @@ static bool test_banner_echo()
static void app_launch()
{
// Relocate IVT to application flash
__disable_irq();
SCB_VTOR = (uint32_t) &appVectors[0];
// Refresh watchdog right before launching app
watchdog_refresh();
// Clear the boot token, so we don't repeatedly enter DFU mode.
boot_token = 0;
while (1) {
watchdog_refresh();
}
asm volatile (
"mov lr, %0 \n\t"
"mov sp, %1 \n\t"
"bx %2 \n\t"
: : "r" (0xFFFFFFFF),
"r" (appVectors[0]),
"r" (appVectors[1]) );
}
int main()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment