cancel
Showing results for 
Search instead for 
Did you mean: 

how to jump to sys mem bootl from app

infoinfo991
Associate III
Posted on August 14, 2013 at 06:43

You know the bootloader that is invoked when you use BOOT1 and BOOT0 pins? In the address space, it's called ''system memory'', right? On my STM32F205RG, it's located at 0x1FFF0000

So... I've made a function like this

&sharpdefine BOOTLOADER_ADDR 0x1FFF0000

typedef void (*pFunction)(void);

static pFunction Jump_To_Application;

static uint32_t JumpAddress;

static inline void jump_to_bootloader()

{

JumpAddress = *(__IO uint32_t*) (BOOTLOADER_ADDR);

Jump_To_Application = (pFunction) JumpAddress;

/* Initialize user application's Stack Pointer */

__set_MSP(*(__IO uint32_t*) BOOTLOADER_ADDR);

Jump_To_Application();

}

but long story short, it doesn't work... even if the BOOT pins are still setup so that it should activate

is there a way to actually activate it from within my own application? 

#activation-internal-bootloader #boot #boot-loader
6 REPLIES 6
Posted on August 14, 2013 at 14:19

is there a way to actually activate it from within my own application? 

Well it's certainly possible, although you might want to do it with near boot conditions rather than after SystemInit() has run.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jpeacock2399
Associate II
Posted on August 14, 2013 at 15:51

The BOOT pins control what section of memory space is mapped to 0x0000 0000 at reset.  Your problem may be that the system loader in ROM expects to be running at address 0x0000 0000 instead of the physical address.

The start of the loader should be the vector table, to set the stack and reset vector.  mapping the image to 0x0000 0000 will place the vector table at the right place to start.  In your case the vector table for the bootloader is in the wrong spot.

  Jack Peacock
infoinfo991
Associate III
Posted on August 14, 2013 at 16:57

OH it's a remapping and not just a jump, must've missed that in the docs, oops, that explains everything, and I assumed that they used polling for everything to avoid problems with the ISR vectors

So... I need to use SYSCFG_MEMRMP , and then jump to 0x00? I'll try that out then.

Thank you

jpeacock2399
Associate II
Posted on August 15, 2013 at 00:09

The first entry in the vector table tells you where to set the MSP stack pointer.  The second word is the address you start at.  It's an address, not an instruction so you need to use indirect.

  Jack Peacock
Posted on August 15, 2013 at 00:26

JumpAddress = *(__IO uint32_t*) (BOOTLOADER_ADDR + 4); // PC @ +4

If things crash you can always step in with the debugger to see where
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
infoinfo991
Associate III
Posted on August 23, 2013 at 09:32

I just found this video 

http://www.youtube.com/watch?v=cvKC-4tCRgw

copying that made everything work

thanks everyone