I have a C++ class partially defined like so in "MyClass.h":
In another file that uses my class ("Client.cpp") I have the following globals:
#pragma default_section(DATA, "seg_ddr2_data", DM)
I need all the instances to be either static or global (no dynamic memory in this particular embedded system). The default_section pragma should in theory place the instances (and the associated m_bigArray for each instance) in ddr2 rather than the default data section (dmda). It does not - the data is all getting assigned to dmda.
Things I've tried:
(1) Put #pragma default_section(DATA, "seg_ddr2_data", DM) at the start of MyClass.h. Bad move - all other files that include MyClass.h then see the pragma and attempt to put their data into ddr2.
(2) Declare m_bigArray as static and put uint32_t MyClass::m_bigArray over in MyClass.cpp (along with the pragma). Wrong - declaring a member variable static makes it a class variable (i.e. shared between all instances). I need each instance to have their own copy of m_bigArray.
(3) Put #pragma section directive right before declaration of m_bigArray. Had no effect.