cancel
Showing results for 
Search instead for 
Did you mean: 

stm32F0 no interrupt after vector-table relocation

Rami Rosenbaum (old)
Associate II
Posted on July 16, 2015 at 14:12

Hi,

I have an application running on the stm32F030.

It has a 'bootloader' application at 0x08000000, which successfully jumps to the 'real' application, at 0x08002000.

The jump and relocation was done according to

/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Cortex%20M0%20Vector%20relocation%20issue&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=1159

.

Till now everything was working fine - SPI, 2 UARTs, GPIOs, etc.

My problem:

I added code waiting on an external interrupt.

This code works fine when the code is linked normally (0x08000000, no relocation), but the interrupt isn't called when relocated.

I see the interrupt happening on a scope.

Thanks.

#stm32f0 #vector-table #code-relocation
16 REPLIES 16
Posted on November 04, 2015 at 13:52

It's

/* Enable the SYSCFG peripheral clock*/

RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);

/* Remap SRAM at 0x00000000 */

SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);

You need to ensure that the VectorTable address is 0x20000000, and if you're doing the copy in the boot loader, you should probably advance the SRAM base in the app to 0x200000C0 so it doesn't get over written.

You are going to have to step through the transition code with the debugger to understand what's actually happening. Make sure you don't have interrupts running (ie SysTick, etc), when you move the table, because you'll be replacing all the handlers.

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

Hi Clive,

my purpose is boot by ImageA(0x08000000) and jump to ImageB(0x08004000) to run the real code, my chip is STM32F030R8, does it possible to do this feature ? because I saw the discuss of other topic said that M0 series can not change address like M3/M4.

Thanks.

TPham.10
Associate II

Hi Rami Rosenbaum, Can you tell me how to solve that problem, my program had jump to application successed but interrupt not working? In application function I just edit FLASH_BASE from 0x8000000 to 0x8003000 (0x3000 i use for bootloader function)

thanks

This thread is from 3-years ago.

For the CM0 parts you have to copy the vector table into the from of the SRAM, and then remap the SRAM to Zero.

For the CM0+ based parts there is a SCB->VTOR so you can point to a new table.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

New thread was started here https://community.st.com/s/question/0D50X00009fGTWBSA4/jump-application-bootloader-0x8003000-interrupt-not-working

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

This is exactly what I did in my case and it worked 100%. I later changed the Bootloader address to 0x08007000. At this address there is no direct map with 0x00000000 (Vector Table). How can I do the mapping at 0x08007000?

You have to copy the vector table into RAM, and remap the RAM so 0x20000000 maps at 0x00000000

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..