cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F051K6 NVIC_SetVectorTable

ricky
Associate
Posted on June 13, 2013 at 06:26

Dears,

Do STM32F0 support NVIC_SetVectorTable command?

I would like to point the vector table as my program start from 0x08001001

NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x1000)

Thanks.

4 REPLIES 4
frankmeyer9
Associate II
Posted on June 13, 2013 at 08:14

No.

The STM32F0xx is a Cortex M0, which have a fixed vector table address.

You will need a M3 if you require this feature.

Posted on June 13, 2013 at 11:32

On the STM32F0 the method employed to change the active vector table is to map/shadow the internal SRAM at zero, and copy the new vector table there, and not using that area for variables.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
gig
Associate
Posted on September 15, 2014 at 22:12

Hi Clive,

Any could you provide any guidance on how I could do this? I want to write a bootloader and would beenefit fomr being able to do this.

Posted on September 15, 2014 at 22:33

The IAP examples might be a good place to start, but the goal is to carve out enough space for the vectors, this means bumping up the 0x20000000 starting point as provided to the linker via the scatter file, or linker script, and then memcpy()ing the vector table from the base of the new image to the base of RAM, and then remapping the RAM

/* Relocate by software the vector table to the internal SRAM at 0x20000000 ***/
 /* Copy the vector table from the Flash (mapped at the base of the application
 load address 0x08003000) to the base address of the SRAM at 0x20000000. */
 for(i = 0; i < 48; i++)
 {
 VectorTable[i] = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
 }
 /* Enable the SYSCFG peripheral clock*/
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
/* Remap SRAM at 0x00000000 */
SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);

http://www.st.com/web/en/catalog/tools/PF258152

STM32F0xx_AN4065_FW_V1.0.0\Project\STM32F0xx_IAP\binary_template Watch that they reset the peripheral, not enable the clock.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..