how to jump to sys mem bootl from app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-08-13 9:43 PM
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 0x1FFF0000typedef 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 activateis there a way to actually activate it from within my own application? #activation-internal-bootloader #boot #boot-loader- Labels:
-
Bootloader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-08-14 5:19 AM
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.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-08-14 6:51 AM
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- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-08-14 7:57 AM
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- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-08-14 3:09 PM
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- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-08-14 3:26 PM
JumpAddress = *(__IO uint32_t*) (BOOTLOADER_ADDR + 4); // PC @ +4
If things crash you can always step in with the debugger to see whereUp vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-08-23 12:32 AM
I just found this video
copying that made everything workthanks everyone