Extending the Default Memory Pool via _mem_extend

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

Extending the Default Memory Pool via _mem_extend

Jump to solution
1,269 Views
miket
Contributor II

Hello,

MQX Version: 4.0

CodeWarrior Version: 10.5

Processor: MK70FN1M0VMJ12

I am attempting to extend the default memory pool for my application which based off the mk70 tower kit originally.  The actual call in my application that I am using is:

_mqx_uint ret_val = mem_extend((void *)0x71000000,5000000);

This will cause my application to not work correctly in that I receive unhandled Interrupts later in my application which should have interrupt handlers assigned.  If I only extended the memory by 3 MB (i.e. _mem_extend((void *) 0x71000000, 3000000)), everything works as it should and i do not get the unhandled ISRs.

Does anyone know why this would happen?  Any other guidance on documentation, Application Notes, etc. would be appreciated.  I am open to any means of increasing the default RAM size.  I have tried creating other system memory pools as well, but receive the same type of observation of unhandled Interrupts.

Thank you!

-Mike T

0 Kudos
Reply
1 Solution
882 Views
miket
Contributor II

I have answered this thread in another thread I started; all being symptoms of the same issue:

D4D eGUI External Memory Bitmap Images

View solution in original post

0 Kudos
Reply
2 Replies
883 Views
miket
Contributor II

I have answered this thread in another thread I started; all being symptoms of the same issue:

D4D eGUI External Memory Bitmap Images

0 Kudos
Reply
882 Views
soledad
NXP Employee
NXP Employee

Hi Michael,

Please notice _mem_extend() function works as follows:

- When you create a new task, MQX kernell uses some space in RAM for the internal task stack.

- If you run out of RAM memory you will not be able to create new tasks.

- You can use _mem_extend() to tell the MQX kernell that he can use external RAM if internl RM is not enough.

Please find attached the files of the complete example using _mem_extend() function.

In addition please edit the user_config.h in a text editor to add the followig lines:

#define MQX_USE_MEM 1 //Enable to use _mem_extend #define MQX_USE_LWMEM 0

#define MQX_USE_LWMEM_ALLOCATOR 0

Then re-build the BSP and PSP

I hope this helps,


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply