cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F051 Vector Reclocation

stst9189
Associate II
Posted on April 10, 2015 at 17:25

Hello,

I am planning a both a secondary boot loader and the need for my main application to handle interrupts from RAM during Writing/ Erasing flash.

I think both of these will benefit from relocating the vectors to RAM. I have read up a lot on the subject but the data sheet is not clear.

I am using Keil MDK and I have worked through all the issues I think with this.

I am planning on using this code to switch the Vectors:

    // Enable the SYSCFG peripheral clock

    // RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE);

    RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;

    

    // Remap SRAM at 0x00000000

    //SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM)

    SYSCFG->CFGR1 = SYSCFG_CFGR1_MEM_MODE_1 | SYSCFG_CFGR1_MEM_MODE_0;

The question I have is what does this actually do?

Is the whole of the 8K ram relocated and what about above this space can the flash still be used???

Where in the data sheet is this information.

Maybe

AN4065

and the data sheet can be be updated with better information.

Thanks

FordP

#bootloader-vector-relocate
2 REPLIES 2
Posted on April 10, 2015 at 18:10

Like the BOOTx pins it SHADOWs the specific memories (RAM, FLASH, ROM) at address ZERO in the processors address space.

The memories still exist at their defined locations, 0x20000000, 0x08000000, 0x1FF??????

You copy your vector table into the base area of RAM (0x20000000) which you have carved out for that process. You'd do this by bumping up the base RAM address the linker uses, and shrink the space the same amount. Typically you'd do this in the target/linker pane, scatter file or linker script.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
stst9189
Associate II
Posted on April 13, 2015 at 11:04

Thanks Clive,

A very helpful reply.

It is clear now.

FordP