cancel
Showing results for 
Search instead for 
Did you mean: 

vector table location

redkofka
Associate II
Posted on July 12, 2012 at 07:09

hi,

i search and search but i cant find where i can change Vector Table base location

in memory.map i can find

.text 0x08004000 0x718

 *(.isr_vector .isr_vector.*)

 .isr_vector 0x08004000 0x124 ..\obj\startup_stm32f10x_md_vl.o

 0x08004000 g_pfnVectors

 *(.text .text.* .gnu.linkonce.t.*)

 

in memory.ld      rom (rx) : ORIGIN = 0x08004000, LENGTH = 0x00002000

but i need to change vector table address to 0x08000000

NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x08000000);  - this isnt working .....

i am using stm32f100 and coocox ide ....
12 REPLIES 12
domen23
Associate II
Posted on July 12, 2012 at 10:21

> in memory.ld      rom (rx) : ORIGIN = 0x08004000, LENGTH = 0x00002000

Well, you've found it, change this, and linker will place the code at the different address.
redkofka
Associate II
Posted on July 13, 2012 at 06:57

ok but then my application will be on address 0x08000004 :)

but i want have application on address 0x08004004 and told it to use vector table on address 0x08000000

my bootloader starts at address 0x08000004

i want to use bootloaders vector table - i have my custom bootloader and i read that i must used bootloaders vector table in my application

redkofka
Associate II
Posted on July 13, 2012 at 07:10

ok i read more and ....

i think i was wrong - i must set VECT_TAB_OFFSET in bootloader not in aplication

so for example bootloader location is 0x08000000 length 4000

aplication location is 0x08000000 length 4000

and in bootloader code i just set in stm32f10x.c

#define VECT_TAB_OFFSET  0x4000   //0x08004000 - vect table location

am i right now ?

thanks for answer and sorry for dummy questions :-[

bikash
Associate II
Posted on July 16, 2012 at 14:54

hello friend i am also working on the bootloader.

my application address is 0x0800f000

but my .map file doesn't get updated.

My controller is STM32F100xx

Settings done in application:

1) Linker script file (.ld):

         FLASH (rx)      : ORIGIN = 0x0800F000, LENGTH = 50K

2) system_stm32f10x.c

         Line 132:  #define VECT_TAB_OFFSET  0xF000

            Do i need to make anymore changes?

thanks in advance

Posted on July 16, 2012 at 15:57

@redkofka I don't understand why you'd put the boot loader at 0x08004000, the point of the boot loader is that the CPU starts it, and then calls the application. Thus the boot loader is going to want to start at 0x08000000, and the application at 0x08004000

@bikash I don't understand why the MAP file doesn't change, it should reflect the address spaces you defined in the linker script (.ld), make sure that the linker is using the right script. Also you need to be specific about what part you are using, as having 50KB of FLASH beyond 0x0800F000 seems decidedly odd.

In both cases, in order for you to use interrupts the vector table must be set up to match where you've placed it. The application itself can do that, which is most typical, or the boot loader can set it to the application base before it jumps into the application via the Reset_Handler, or whatever method you choose to transfer control.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
vengates
Associate
Posted on June 03, 2015 at 17:18

While executing the program, I'm getting error as SIGINT received and no source found. Where I want to do the vector table relocation. Can u please attach me a sample program and what are the other configurations that has to be done along this. 

Posted on June 03, 2015 at 17:36

And you're using which STM32 exactly?

How will moving the vector table impact your current failure?

The Vector Table is generally situated using the code in, or called by, SystemInit() [system_stm32fxxx.c], as a write to SCB->VTOR.

If you are getting unexplained interrupts, you need to review what you're enabling and servicing now, and if those are being reached. If you're getting Hard Faults, then get a proper handler their which can direct you at the faulting instructions, and processor state.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
vengates
Associate
Posted on June 03, 2015 at 18:38

I'm using STM32f030c6t6 series controller.

Posted on June 03, 2015 at 20:49

I'm using STM32f030c6t6 series controller.

Ok, and you've looked at the IAP examples, got answers for the other questions?

The Cortex-M0 can't relocate the vector table, here you're going to have to copy the new table to RAM, and change the shadowing/mapping of the zero address memory from FLASH to SRAM.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..