Having trouble with memory relocation of C++ objects

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Having trouble with memory relocation of C++ objects

657 Views
dave408
Senior Contributor II

I've received good information in a previous post regarding moving memory around to deal with the split memory architecture in the Kinetis processors.  While I haven't yet tried to apply it to the memory allocated for an MQX task's stack, I have moved global buffers to the smaller section of RAM.  So far, that seems to work (compiles, runs, and exhibits proper behavior).  However, it only works for arrays of standard types.  If I try to move a global C++ object, it builds, but execution fails immediately and I end up in my fault handler code.

More specifically, what happens is that I get an unhandled interrupt: WDOG_EWM_IRQHandler.  If I define an empty handler for that function, then I just get another, and another, and the list of unhandled IRQ handlers grows and grows.  This is very strange.  Can anyone explain why this happens, and what, if anything, can be done to make reallocation of C++ objects work?

BTW, I am using __attribute__((section(".m_data_2"))) to move my objects to the smaller section of RAM.

2 Replies

384 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Dave,

Apologies for the delay, are you still having this issue?

It will be helpful if you could attach a project where we can reproduce this behavior.

Thanks in advance!

Best Regards,

Carlos Mendoza

Technical Support Engineer

0 Kudos

384 Views
dave408
Senior Contributor II

Hi Carlos, I was able to get this to work for C arrays only, and not for my C++ objects.  So for now, I'm only relocating my MQX task stacks and other general purpose buffers.  However, some of my colleagues are experiencing this issue with the WDOG ISR, so I'll get back to you once I have had a chance to take a look at their projects.