Jump to content

Custom Linker Script Hint


stryd_one
 Share

Recommended Posts

Hey boxers!

Quick tip for you, regarding the new unified mios platform, and custom linker scripts....

You can specify your own linker script, like many things, in the makefile. Chances are, you'll put the linker script in the same directory as the main.c, right... So you copy your makefile from '\trunk\etc\lkr', into your app's root dir, and you make your mods... Then you edit the makefile.

The original:

# define the processor, linker file and project name
PROCESSOR = 18f452
LKR_FILE  = $(MIOS_PATH)/etc/lkr/p$(PROCESSOR).lkr
PROJECT   = project
The mod:
# define the processor, linker file and project name
PROCESSOR = 18f452
# Custom linker
LKR_FILE  = ./$(PROCESSOR).lkr
PROJECT   = project

Now, you're probably thinking like "Duh" right about now. But there's one important thing to note there, and it's pretty subtle.

This:

LKR_FILE = $(PROCESSOR).lkr

Will compile. No worries. But it won't work with the dist script. You need this:

LKR_FILE = ./$(PROCESSOR).lkr

the dot-slash is required. That's all, enjoy!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...