Jump to content

Recommended Posts

Posted

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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...