K60F and K64F ROM section set to half capacity on purpose?

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

K60F and K64F ROM section set to half capacity on purpose?

Jump to solution
1,011 Views
williamely
Contributor IV

I noticed that the linker files for both the TWR-K64F120M and TWR-K60F120M have the "rom" section set like this:

rom (RX): ORIGIN = 0x00000420, LENGTH = 0x0007FBE0  /* Code + Const data */

I've been changing this line to make the full flash capacity available.

rom (RX): ORIGIN = 0x00000420, LENGTH = 0x000FFBE0  /* Code + Const data */

Is this a good thing to do or should I make an additional "rom" section?

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
731 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello William:

The answer pretty much depends on the rest of the linker file, not just that line. Yes, you can extend the section and use the whole flash space, as long as you properly allocate your vector table, flash configuration field and initialized variables.

I think you got that linker file from an example project, right?

As reference, you can create a new bareboard project with CodeWarrior and check the linker file. It makes use of the entire 1 MB of flash.


Regards!
Jorge Gonzalez


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

View solution in original post

0 Kudos
Reply
4 Replies
732 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello William:

The answer pretty much depends on the rest of the linker file, not just that line. Yes, you can extend the section and use the whole flash space, as long as you properly allocate your vector table, flash configuration field and initialized variables.

I think you got that linker file from an example project, right?

As reference, you can create a new bareboard project with CodeWarrior and check the linker file. It makes use of the entire 1 MB of flash.


Regards!
Jorge Gonzalez


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

0 Kudos
Reply
731 Views
williamely
Contributor IV

Just to be thorough...

Here's the memory section of the PE linker script for the MK60FN1M0VLQ12:

MEMORY {

  m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000001E8

  m_text      (RX) : ORIGIN = 0x00000410, LENGTH = 0x00007BF0  /* This should be the same as the K64F since they are both 1M0 parts */

  m_data      (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000

  m_data_20000000 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000

  m_cfmprotrom  (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010

}

Here is the same for the MK64FN1M0VLQ12:

MEMORY {

  m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000198

  m_text      (RX) : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0     /* I believe this line is correct */

  m_data_1FFF0000 (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000

  m_data      (RW) : ORIGIN = 0x20000000, LENGTH = 0x00030000   

  m_cfmprotrom  (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010

}

I think there is a mistake in the K60F PE and MQX linker scripts for the 1M0 parts and that mistake seems to have carried over into the K64 MQX linker script.

0 Kudos
Reply
731 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi William:

I couldn't say if that is a mistake or if it had some purpose. But you can go ahead and change it, there should be no problem.

And from your previous comment, if you have the linker that comes with MQX, then do not worry about allocating stuff, as you already have some sections called "vectorrom" and "cfmprotrom", correct?


Regards!
Jorge Gonzalez

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

0 Kudos
Reply
731 Views
williamely
Contributor IV

Thanks Jorge. I got the linker file from the BSP for the tower kit. I'll make a bareboard project and see how that linker script compares with the BSP.

0 Kudos
Reply