gnupic: Re: [gnupic] pic18f24j10
Subject:
Re: [gnupic] pic18f24j10
From:
"Xiaofan Chen" ####@####.####
Date:
2 Jul 2007 01:09:23 +0100
Message-Id: <a276da400707011708o2fd37580j8e009165d15c3658@mail.gmail.com>
On 7/1/07, Michael Ballbach ####@####.#### wrote:
>
> This is due to code in coff.c which tries to pad out the config section
> with defaults. Your device's config address space is not between
> 0x300000 and 0x30000d, which is what this code expects. Your config
> bytes appear to be after 0x3ff8. The result is that the code tries to
> pack all the bytes between 0x3ff8 to 0x30000d with 0xff's.
>
> I suggest this patch which will use the configuration database when
> available to calculate the last valid configuration address. Please let
> us know how it works for you:
>
The patch seems to work. Without the patch, the test code in relocation
mode produced big hex files. With the patch, the following test code
produce the same hex file as the corresponding code in absolute mode.
XFCHEN@APSGSGPXFCHEN ~/mcu
$ cat main1.asm
LIST P=18F24J10 ;directive to define processor
#include <p18f24j10.inc>
CONFIG WDTEN = OFF ;To use ICD2 as a debugger disable WDT
CONFIG STVREN = ON ;Reset on stack
overflow/underflow enabled
CONFIG XINST = OFF ;Legacy mode
CONFIG CP0 = OFF ;Program memory is not code-protected
CONFIG FOSC = HSPLL ;HS oscillator. PLL enabled
CONFIG FOSC2 = ON ;Clock selected by FOSC as system clock
CONFIG FCMEN = OFF ;Fail-Safe Clock Monitor disabled
CONFIG IESO = OFF ;Two-Speed Start-up disabled
CONFIG WDTPS = 32768 ;1:32768
;Reset vector
RESET_VECTOR CODE 0x0000
Main: nop
bra Main
end
XFCHEN@APSGSGPXFCHEN ~/mcu
$ gpasm -i -c main1.asm
XFCHEN@APSGSGPXFCHEN ~/mcu
$ gplink -o main1 main1.o
message: using default linker script
"C:/msys/1.0/local/share/gputils/lkr/\18f24j10.lkr"
XFCHEN@APSGSGPXFCHEN ~/mcu
$ cat main1.hex
:020000040000FA
:040000000000FED727
:063FF800A0F405FFFFF13B
:00000001FF
XFCHEN@APSGSGPXFCHEN ~/mcu
$ diff main.hex main1.hex
Regards,
Xiaofan