We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I am using this function to branch to application wo problems on GNU tools:
static void boot_jump(uint32_t lAddress) { __asm( "LDR SP, [R0]\n" "LDR PC, [R0, #4]\n" ); }
But compiling in MDK-ARM reports: bootloader.c(45): error: #20: identifier "SP" is undefined
How to solve this or what method must be used in MDK-ARM to do the same? I could not find any bootloader example in the Keil pack that comes for STM32F micro.
Sorry correct code is:
static void boot_jump(uint32_t address) { typedef void (*pFunction)(void); pFunction jumpToApplication = (pFunction) *(__IO uint32_t*)(address + 4); /* Initialize user application's Stack Pointer */ __set_MSP(*(__IO uint32_t*) address); jumpToApplication(); }