Created
February 2, 2016 21:14
-
-
Save Harakan/659edd951cd9f6e65dec to your computer and use it in GitHub Desktop.
is that a staticly defined function by function address?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BOOTLOADER_START_ADDR 0x1fffc400 //This may be c800 | |
static uint32_t *bootloader_msp = (void *)BOOTLOADER_START_ADDR; | |
static void *(**bootloader)() = (void *)BOOTLOADER_START_ADDR + 4; | |
__set__MSP(*bootloader_msp); //set the stack pointer to the addr | |
(*bootloader)(); //Execute program at location bootloader |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//Better demo, with an actual function where it should be
define BOOTLOADER_START_ADDR 0x1fffc400 //This may be c800
static uint32_t bootloader_msp = (void *)BOOTLOADER_START_ADDR;
static void *(*bootloader)() = (void *)BOOTLOADER_START_ADDR + 4;
void jump_to_bootloader_addr(){
__set__MSP(_bootloader_msp); //set the stack pointer to the addr
(_bootloader)(); //Execute program at location bootloader
}