How to resolve linker warnings in custom linker section

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

How to resolve linker warnings in custom linker section

1,221 Views
pcpro1789
Contributor III

We are using MCUXpresso's Managed Linker Script feature.  However, we do have a small linker script to support gnu_build_id, used by Memfault.

image.png

The highlighted region is causing these warnings:

gnu_build_id.ld:12: warning: memory region `QSPI_FLASH' not declared
gnu_build_id.ld:12: warning: memory region `SRAM' not declared
imxrt685_Debug_memory.ld:15: warning: redeclaration of memory region `QSPI_FLASH'
imxrt685_Debug_memory.ld:16: warning: redeclaration of memory region `SRAM'

The MEMORY defined in the generated imxrt685_Debug_memory.ld is pretty typical.

pcpro1789_1-1737136068991.png

Removing the highlighted portion from gnu_build_id.ld results in the warnings going away, but then the ID code may not appear at the correct address.

Perhaps something needs to be done with the the Miscellaneous or Managed Linker Script settings?

pcpro1789_2-1737136219702.png

pcpro1789_3-1737136290488.png

 

0 Kudos
Reply
4 Replies

1,187 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @pcpro1789 

I hope to find you well.

The debug  linker script created by MCUxpresso does includes memory.ld and library ld.

diego_charles_0-1737409341202.png

Are you missing this?  QSPI_FLASH and SRAM  are already defined in the IDE's magemed linker script. 

diego_charles_1-1737409443868.png

how are you integrating the below script? I mentoned the above since I do not saw the includes. 

diego_charles_2-1737409525712.png

Diego

 

 

0 Kudos
Reply

1,076 Views
pcpro1789
Contributor III

@diego_charles QSPI_FLASH and SRAM are already defined in the MCUXpresso Memory configuration.

jjf capture 0017.png
Tags (1)

1,065 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @pcpro1789 

Thank you for your reply! I am very sorry for the delayed response.

I agree with you the main and default ld, which is generated by the MCUxpresso define SRAM and QSPI_FLASH . However, the linker file that you included, does not know about those areas, I suggested that you could add the import directive on that ld. 

Snag_67deabe.png

Does including the other lds on this on your ld works?

There is another option that we can try:

Disable the Manage Linker script, and add your ld to the lds generated by the IDE. This way when you re-compile the IDE will not longer re-create the ld. Please help me testing this workarround. 

 

Snag_67f9e98.png

I am not falimiliar with the ld that you require to include, but there is another one, to avoid disabling the Manage linker script and to add sections in on the IDES auto generated lds. This is creating your custom extra linker areas.  But this is all the flexibility I can find on the MCUXpresso managed linker script. 

 

Snag_683812a.png

 

Thank you!

Diego

 

 

 

0 Kudos
Reply

1,168 Views
pcpro1789
Contributor III

@diego_charles The Managed Linker Script utility does indeed generate the memory.ld and library.ld files.

The custom script is integrated via the Miscellaneous linker settings (third screen capture in my original post).  Here it is again.  Please see the highlighted blue line.

jjf capture 0011.png

 

0 Kudos
Reply