I asked this question on the SCB forum but got no answer I'm trying to port some projects from uVision ide to SCB. The problems began with the implementation of vector table. For examle, I have simple C++ code
#define STACK_TOP 0x20000800
typedef void (*handler_ptr)();
void ResetHandler() { while (1); }
void NMIHandler() { while (1); }
void HardFaultHandler() { while (1); }
__attribute__ ((section("vectors"))) handler_ptr const vector_table[] = {
(handler_ptr) STACK_TOP,
ResetHandler,
NMIHandler,
HardFaultHandler,
};
This code does not compile, because SCB library looking for "int main(void)" declaration. Ok, I can add this function, but then SCB ignores my vector table implementation and use own (if I call function which address in VT, I see SCB dummy handlers).
How can i rewrite SCB VT implementation by mine? Please do not offer the use of special SC3 functions names (it's not good to support with 2 IDE's) or move vector table to another memory location.
__attribute__ ((section(".isr_vector"))) void (* const g_pfnVectors[])(void)
from Luminary Micro's "startup_gcc.c - Startup code for use with GNU tools" has no effect too
Thank you.