flash memory re-map using linker control (ld) file.

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

flash memory re-map using linker control (ld) file.

545 Views
Ming
Contributor III

I would like to partition m_text (RX) section into two separate sections. One contains all ProcessorExpert generated code while the other one takes care of my application specific code. Within ld file, I divided m_text spaces into two sections: m_text2 and m_text. I attempted to specify a particular object generated by ProcessorExpert and place it under m_text2 while keeping the rest of code (.text) under m_text. The linker doesn't like it and generated an error.
The only usable method I have tried so far is using __attribute__((section(".xxxx"))) method, but it is impractical to manually place it before every functions generated by ProcessorExpert.

.generated_code :
  {
          AD1.o (.text)
          . = ALIGN(4);
  } > m_text2 /* new section to include AD1.o generated by ProcessorExpert, that's the intention, NOT working */
 
  /* The program code and other data goes into INTERNAL_FLASH */
  .text :
  {
    . = ALIGN(4);
    *(.text)           /* .text sections (code) */
    *(.text*)          /* .text* sections (code) */
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */

    KEEP (*(.init))
    KEEP (*(.fini))

    . = ALIGN(4);

0 Kudos
3 Replies

384 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Ming Jiang:

I think you should use this format instead (check the asterisks):

.generated_code :

  {

          *AD1.o (.text*)

          . = ALIGN(4);

  } > m_text2

PS. Always try to post to specialized forum spaces. Otherwise your questions gets lost and you get no answers.


Regards!,
Jorge Gonzalez

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

0 Kudos

384 Views
Ming
Contributor III

Thanks. BTW, I was trying to post my issue to the Kinetis forum by clicking the Ask it botton. But the post never showed up, maybe I am not doing wright. How do I make a post?

0 Kudos

384 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Ming:

The "Ask it" button should work. But I have known of some threads submitted to review due to some used words that could be classified as spam.

If you still have problems to post, try asking about this issue in Using Freescale Community, and I hope you can at least post your question there.

Regards!

Jorge Gonzalez

0 Kudos