2020-06-09 05:26 PM
Now, I develop DFU.
0x80000000 : DFU Project
0x8000C000 : Application Project.
I have to change VECTOR Table in Application Area.
I'm trying to find VECT_TAB_OFFSET in IDE.
But, I can't
Old solution is directly change source code in System_stmf2xx.c
I don't know best solution.
Please give good advice.
2020-06-09 05:44 PM
Isn't that where it is defined.
ST's approach is broken.
I change the addresses in the Linker Script, and then use the symbol for the vector table out of startup.s in SystemInit() to set SCB->VTOR directly to the build address. This removes the need for multiple dependencies and source files.
2020-06-09 06:39 PM
Your words mean is
" VECT_TAB_OFFSET" can't define CUBEMX. right?
2020-06-09 06:49 PM
I think he's saying that CubeMX copies the system_stm32f2xx.c file into your project directory, and it is meant to be modified by you if you need something other than the default configuration. The comments in the file itself tells you to modify it as needed:
/*!< Uncomment the following line if you need to relocate your vector Table in
Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
Not everything is going to be able to be done in CubeMX. Some stuff like HSE_VALUE can be defined elsewhere. Doesn't seem like VECT_TAB_OFFSET is set up for that.
There's also nothing stopping you from adjusting SCB->VTOR yourself within your application code.
2020-06-09 07:07 PM
Thanks for your advice.
I understand now.
2020-06-09 10:32 PM
> Old solution is directly change source code in System_stmf2xx.c
Yes, that's how broken code is supposed to be fixed.
> I don't know best solution.
Best solution is not relying on low quality code.
The g_pfnVectors array holds the vector table, but it is declared in assembly only.
extern uint32_t g_pfnVectors[];
SCB->VTOR = (uint32_t)g_pfnVectors;
2020-06-15 06:12 PM
Thanks for your advice.
I help it