Code: Select all
ram_startup : ALIGN(16) SUBALIGN(16)
{
__ram_vector_table_start__ = .;
KEEP(*(ram_vectors))
} > ram AT > flash
Note that you must have "> ram AT > flash" NOT "> ram" as I had in my previous post.
Then, in my chconf.h, I have:
Code: Select all
extern uint32_t __ram_vector_table_start__;
#define CORTEX_VTOR_INIT __ram_vector_table_start__
Then all seems to work correctly. If I look at my map file, I can see:
Code: Select all
0x0000000020000800 __ram_vector_table_start__ = .
*(ram_vectors)
ram_vectors 0x0000000020000800 0x200 build/obj/VectorTable.o
__ram_vector_table_start__ build/obj/chcore_v7m.o
The nice thing about this approach is that if I change the stack sizes in the linker script, SCB_VTOR still gets correctly initialized with the right value.
I'm going to test it to make sure, but I think this looks pretty good. Any thoughts?
Thanks,
Luke