Use of RAM beyond 64KB in K60 controller with MQX 4.2.0

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

Use of RAM beyond 64KB in K60 controller with MQX 4.2.0

Jump to solution
1,264 Views
dineshsonagra
Contributor III

Dear Friends,

We are developing new application using K60 controller (internal RAM 128KB) and MQX 4.2.0. The software development tool is CodeWarrior Basic edition. Accordingly, Codewarior config file is also set for 128KB RAM (ram (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00020000  /* SRAM - RW data */ ).

While development, till RAM usage below 64KB, things were all right and system is working OK..

Now as we have expanded our software features, it is requiring RAM beyond 64KB.

We have tried to create the segment in RAM as below.

MEMORY
{
vectorrom  (RX): ORIGIN = 0x00000000, LENGTH = 0x00000400
cfmprotrom  (R): ORIGIN = 0x00000400, LENGTH = 0x00000020
rom        (RX): ORIGIN = 0x00000420, LENGTH = 0x0007FBE0  /* Code + Const data */

  my_ram        (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00010000  /* SRAM - RW data */

ram (RW): ORIGIN = 0x20000000, LENGTH = 0x0000FA00  /* SRAM - RW data */

/* kernel space starts after RAM variables (Location of MQX Kernel data + MQX heap) */
end_of_kd  (RW): ORIGIN = 0x2000FFF0, LENGTH = 0x00000000

/* Boot stack reused by MQX Kernel data */
bstack      (RW): ORIGIN = 0x2000FA00, LENGTH = 0x00000200  /* Boot stack */
end_bstack  (RW): ORIGIN = 0x2000FC00, LENGTH = 0x00000000  /* Boot stack end address requires 4B alignment */
}

SECTIONS

{

    __INTERNAL_SRAM_BASE  = 0x20000000;

    __INTERNAL_SRAM_SIZE  =  0x0000FA00;

...

...

...

.my_section

    {

        __my_section_start = .;

. = ALIGN (0x4);

;;;;;;;;;;; additional variables are defined here...

    } > my_ram      

On running this application, we have found that RTCS (ethernet communication) has stopped functioning.

What could be the reason ? can any one has came across such a situation ?

Labels (1)
0 Kudos
1 Solution
908 Views
dineshsonagra
Contributor III

Dear David,

Thanks...

We were thinking to find the RAM used by RTOS so that we can estimate RAM available to us..OR set RTOS in RAM upper area / heap..

However, for our academic interest, I will see suggested TAD codes..

Problem is resolved... Kernel is set in RAM upper area..

regds,

Dinesh

View solution in original post

0 Kudos
10 Replies
908 Views
DavidS
NXP Employee
NXP Employee

Hi Dinesh,

Please download the MQX4.2.0.1 patch and apply it to your MQX4.2 release.

It has following that may resolve your issue:

MQX RTOS 4.2.0.1

o MQX-5540

 Added checking of the heap low address and the heap high address against the memory address 0x20000000 to see whether the global variables reside on that address and issue warning to the user.

 Affects all BSPs.

Regards,

David

0 Kudos
908 Views
dineshsonagra
Contributor III

Hi David,

I am awaiting your reply..

regds,

Dinesh

0 Kudos
908 Views
DavidS
NXP Employee
NXP Employee

Hi Dinesh,

Did the patch help?

You should not have to change the linker file.

Regards,

David

0 Kudos
908 Views
dineshsonagra
Contributor III

Dear David,

In continuation to my earlier note, we have doubt that MQX RTOS and RTCS may take reasonable amount of RAM and hence we may be finding difficulty in running application. We are expecting around 80K RAM for our application data.

Is there any method to find out RAM used for MQX or defining RAM for MQX in upper heap RAM ?

regds,

Dinesh

0 Kudos
908 Views
DavidS
NXP Employee
NXP Employee

Hi Dinesh,

I think you need non-Free CW10.x to use the MQX TAD (Task Aware Debugging) to see RTOS related usage.

But there is source code for TAD in C:\Freescale\Freescale_MQX_4_1_1_GA\mqx\source\tad .

It has several calls to look at task stack usage and heap usage that might be helpful.

Regards,

David

0 Kudos
908 Views
dineshsonagra
Contributor III

Dear David,

Thanks...

We were thinking to find the RAM used by RTOS so that we can estimate RAM available to us..OR set RTOS in RAM upper area / heap..

However, for our academic interest, I will see suggested TAD codes..

Problem is resolved... Kernel is set in RAM upper area..

regds,

Dinesh

From: DavidS <admin@community.freescale.com>

To: Dinesh Sonagra <rnd.himson@yahoo.co.in>

Sent: Wednesday, 17 February 2016 1:59 AM

Subject: Re: - Use of RAM beyond 64KB in K60 controller with MQX 4.2.0

#yiv9057795681 * #yiv9057795681 a #yiv9057795681 body {font-family:Helvetica, Arial, sans-serif;}#yiv9057795681 #yiv9057795681 h1, #yiv9057795681 h2, #yiv9057795681 h3, #yiv9057795681 h4, #yiv9057795681 h5, #yiv9057795681 h6, #yiv9057795681 p, #yiv9057795681 hr {}#yiv9057795681 .yiv9057795681button td {}

|

NXP Community

|

Use of RAM beyond 64KB in K60 controller with MQX 4.2.0

reply from David E Seymour in MQX Software Solutions - View the full discussionHi Dinesh,I think you need non-Free CW10.x to use the MQX TAD (Task Aware Debugging) to see RTOS related usage.But there is source code for TAD in C:\Freescale\Freescale_MQX_4_1_1_GA\mqx\source\tad .It has several calls to look at task stack usage and heap usage that might be helpful.Regards,David

Reply to this message by replying to this email, or go to the message on NXP Community

Start a new discussion in MQX Software Solutions by email or at NXP Community

Following Use of RAM beyond 64KB in K60 controller with MQX 4.2.0 in these streams: Inbox

This email was sent by NXP Community because you are a registered user.

You may unsubscribe instantly from NXP Community, or adjust email frequency in your email preferences |

|

0 Kudos
909 Views
dineshsonagra
Contributor III

Dear David,

Thanks...

We were thinking to find the RAM used by RTOS so that we can estimate RAM available to us..OR set RTOS in RAM upper area / heap..

However, for our academic interest, I will see suggested TAD codes..

Problem is resolved... Kernel is set in RAM upper area..

regds,

Dinesh

0 Kudos
908 Views
dineshsonagra
Contributor III

Dear David,

We have tried to install the suggested patch. But it has not solved the problem.

As our team is new on such programming, pls advise how to check 'heap low address and the heap high address against the memory address 0x20000000 to see whether the global variables reside on that address' ?

Some one has advise to work with MQX 4.1.0. Shall we try with MQX 4.1.0 ?

We also come to know that RAM is divided into TWO blocks of 64K each. Hence variables should not straddling the 64k boundary. Also read and write function can not span the 64k boundary between 2 blocks ? Is this true ?

regds,

Dinesh

 

From: DavidS <admin@community.freescale.com>

To: Dinesh Sonagra <rnd.himson@yahoo.co.in>

Sent: Friday, 12 February 2016 9:22 PM

Subject: Re: - Use of RAM beyond 64KB in K60 controller with MQX 4.2.0

#yiv3047704310 * #yiv3047704310 a #yiv3047704310 body {font-family:Helvetica, Arial, sans-serif;}#yiv3047704310 #yiv3047704310 h1, #yiv3047704310 h2, #yiv3047704310 h3, #yiv3047704310 h4, #yiv3047704310 h5, #yiv3047704310 h6, #yiv3047704310 p, #yiv3047704310 hr {}#yiv3047704310 .yiv3047704310button td {}

|

NXP Community

|

Use of RAM beyond 64KB in K60 controller with MQX 4.2.0

reply from David E Seymour in MQX Software Solutions - View the full discussionHi Dinesh,Did the patch help?You should not have to change the linker file.Regards,David

Reply to this message by replying to this email, or go to the message on NXP Community

Start a new discussion in MQX Software Solutions by email or at NXP Community

Following Use of RAM beyond 64KB in K60 controller with MQX 4.2.0 in these streams: Inbox

This email was sent by NXP Community because you are a registered user.

You may unsubscribe instantly from NXP Community, or adjust email frequency in your email preferences |

|

0 Kudos
908 Views
dineshsonagra
Contributor III

Dear David,

We have tried to install the suggested patch. But it has not solved the problem.

As our team is new on such programming, pls advise how to check 'heap low address and the heap high address against the memory address 0x20000000 to see whether the global variables reside on that address' ?

Some one has advise to work with MQX 4.1.0. Shall we try with MQX 4.1.0 ?

We also come to know that RAM is divided into TWO blocks of 64K each. Hence variables should not straddling the 64k boundary. Also read and write function can not span the 64k boundary between 2 blocks ? Is this true ?

regds,

Dinesh

0 Kudos
908 Views
dineshsonagra
Contributor III

Hi David,

Thanks for prompt response.. I will try with MQX 4.2.0.1 today..

Meanwhile, after loading MQX 4.2.0.1, do we need to have RAM segments as defined earlier ? OR new MQX version will take care of it ?

regds,

Dinesh

0 Kudos