AnsweredAssumed Answered

RTOS, Extended memory, C++ and Static initializers

Question asked by Monte Variakojis on Aug 19, 2015
Latest reply on Aug 20, 2015 by Monte Variakojis

Hello Group,

 

The subject line is a mouthful, but we have an interesting problem and I need to understand what is happening.

 

We are using a K60 line CPU with extended memory with FreeRTOS.

 

The System:

  • Using Processor Expert
  • Have 512K of external memory
  • FreeRTOS heap is pointing to the extended memory using PE at 0x60000000 using scheme 4
  • We are using C/C++ (porting code from another project and it's very C++ish)

 

The problem is we suddenly cannot use certain classes in initializers (constructor or module) specifically std::string.

Ex (module initializer):

 

    #include "string"

    std::string myString = "Hello World";

    void SomeFunctions(){  }

 

Looking at the assembly where the fault is caused by add.w r3, r7, #12 where r3 = 0xffff and r7 - 0x1fffffd0

The initialization string myString causes a system fault. Now for the questions:

  • This is using std::string - is it possible something in the class has not been initialized yet?
  • What would cause such a fault and what is the best way to figure out what is causing it?
  • Since we are using FreeRTOS, what happends to the default heap defined in the CPU section of PE?

 

Hints would be greatly appreciated.

 

Cheers,

 

Monte---

Outcomes