MCUXpresso build not dependent on changes to linker file?

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

MCUXpresso build not dependent on changes to linker file?

767 Views
rshipman
Contributor V

IDE: MCUXpresso IDE v11.0.1 [Build 2563] [2019-09-01]

Platform: MIMXRT1020-evk eval board

Example project: demos/iled_blinky

If I edit the linker .ld script (using the unmanaged linker script option) the project is not rebuilt (it should just be relinked ideally but this does not happen either). I have to clean the project or edit a source file to make it rebuild. The makefile does not appear to have a dependency on the .ld file, which is a source file ultimately (even though it can be generated by MCUXpresso if managed linker script is enabled). MCUXpresso does rebuild if you make changes to the linker script via the settings under Properties, but in either case the makefile should always have a dependency IMHO.

E.g.: in Debug/makefile, something like

LINKER_SCRIPTS := evkmimxrt1020_iled_blinky_Debug_library.ld \

                  evkmimxrt1020_iled_blinky_Debug_memory.ld \

                  evkmimxrt1020_iled_blinky_Debug.ld

:

:

# Tool invocations
evkmimxrt1020_iled_blinky.axf: $(OBJS) $(LINKER_SCRIPTS) $(USER_OBJS)

I haven't tested this so the syntax may be wrong.

Some other makefile suggestions:

It is probably safer to have spaces between the $(EXECUTABLES)$(OBJS)$(C_DEPS) variables in the clean target. E.g.:

# Other Targets
clean:
-$(RM) $(EXECUTABLES) $(OBJS) $(C_DEPS) evkmimxrt1020_iled_blinky.axf
-@echo ' '

Please clean up any .map (and possibly .hex) and whatever else is generated or derived from the binary or map files - either directly or via the MCUXpresso menus.

Perhaps consider using something like $(TARGET_STUB), so that all references to evkmimxrt1020_iled_blinky are replaced by $(TARGET_STUB)? E.g. $(TARGET_STUB).axf. This would be helpful if a user turns off auto makefile generation and starts editing them. And perhaps even a $(BUILD_CONFIG) variable which is set to _Debug or whatever.

0 Kudos
2 Replies

653 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Thank you for your feedback. This is something that we have looked at in the past - but unfortunately there is no straight forward way to do this, as the makefile generation is largely under the control of the underlying Eclipse build engine, rather than with MCUXpresso IDE itself.

This is something we could have another look at again at some point in the future, as the last time we reviewed this was some time ago. But at the moment, if you make modifications to your linker scripts, then you are recommended to always do a clean before building.

Regards,

MCUXpresso IDE Support

0 Kudos

653 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
I'd highly recommend you follow the steps which are presented in 18.9 Modifying the Generated Linker Script / Memory Layout in the attachment to enable the modified linker in the rebuild process.

Have a great day,
TIC

 

 

 

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

 

 

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos