Using the linker file to move some of MQX's larger code to external memory?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Using the linker file to move some of MQX's larger code to external memory?

437 次查看
carlnormansuret
Contributor V

Hi All,

I have just ported a larger MCF52259 project to MQX4.2 from 4.1 and found it to be much larger requiring me to move most code to run from MRAM. We already do this with no problems for our own code, but, I now need to move some non critical MQX code to MRAM to execute. The low space is due to having a remote update procedure that leaves two complete working bootable images leaving us with less than half the normal 512KB.

For my own code there is no issue moving the code to MRAM using the linker file:

..

Image1                      (RX): ORIGIN = 0x00001000, LENGTH = 0x0003F000  ##Normal Image 1 release

MRAM_CODEIMG1  (RX): ORIGIN = 0x10000000, LENGTH = 0x00025000  ##MRAM release image 1 where we move extra code

...

KEEP_SECTION { .vectors_rom, .vectors_ram, .cfmconfig,  MRAM_CODEIMG1_Page}

...

.MRAM_CODEIMG1_Page:

  {

  Logger_c.c (.data)   ##our files that we move and run in MRAM

  Logger_c.c (.rodata)

  Logger_c.c (.text)

  Functions_c.c (.data)

  Functions_c.c (.rodata)

  Functions_c.c (.text)

  io_dopr_c.c (.data)       ## MQX file (C:\Freescale\Freescale_MQX_4_2\mqx\source\fio\io_dopr.c) error shows "File not found"

  io_dopr_c.c (.rodata)   ## "File not found"

  io_dopr_c.c (.text)       ## "File not found"

  } > MRAM_CODEIMG1

...

The io_dopr.c files are out of scope (C:\Freescale\Freescale_MQX_4_2\mqx\source\fio\io_dopr.c). Can I make the linker see these? Or how do I go about forcing these files to be located in MRAM?

0 项奖励
1 回复

275 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi Carl,

the problem here is that you want to relocate code that is not in your project, the code in this file is already object code that is part of MQX library (bsp.a) which is located in C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.cw10gcc\debug\bsp.

Therefore, when you build your applciation, the compiler is processing io_dopr.c, io_dopr_c.c is not generated and linker will not find it.

I hope this helps to clarify the issue.

Best regards,

Carlos

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

0 项奖励