Tool/software:
Hi,
I found very little information about the compiler generated "__sti__" functions.
I have some sections of code, which are loaded into RAM before main() (binit table).
If I have a global constructor which is also loaded into the RAM section, the program crashes, because the linker does not copy the __sti__ functions into RAM before calling the constructor.
I try to simplify the structure of the code:
main.cpp -> running from flash
#include "ram_funcs.h"
static MyClass myInst = MyClass();
int main()
{
...
}
ram_funcs.h
class MyClass
{
MyClass();
}
ram_funcs.cpp -> running from RAM (LOAD=FLASH RUN=RAM)
MyClass::MyClass()
{
...
}
The linker puts the object from "ram_funcs.cpp" into the binit table, but not the __sti__ function.