Having trouble with memory relocation of C++ objects

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Having trouble with memory relocation of C++ objects

710件の閲覧回数
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 返答(返信)

437件の閲覧回数
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 件の賞賛

437件の閲覧回数
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.