I'm migrating an old MPLAB asm file to the latest version of MPLAB X (v5.15). I keep getting this linker error:
MPLINK 5.09, LINKER
Device Database Version 1.46
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - section 'PROG2' has a memory 'page1' which can not fit the absolute section. Section 'PROG2' start=0x00001000, length=0x000000ea.
The problem seems to be with this linker directive:
PROG2 CODE PAGE2_START
where PAGE2_START equ 0x1000.
I'm using a 16C77 so it has 4 pages of code. Page 2 starts at 0x1000. It goes to 0x17ff so 0x000000ea bytes should fit well within this space.
It seems the linker think it should be located in page 1. This is why I think I'm getting this error as page 1 is already full. How do I tell the linker to put it in page 2?
I'm using the standard 16F77 linker file, "16f77_g.lkr". I've tried moving all the code in page 2 to a seperate .asm file, but still get this error.
Turns out the label I used (PROG2) I had used in an earlier function.