gnupic: Re: GPAL, GPLINK and __CONFIG
Subject:
Re: GPAL, GPLINK and __CONFIG
From:
Shaun ####@####.####
Date:
12 Apr 2005 21:52:15 +0100
Message-Id: <425C34E3.1020500@cam.ac.uk>
Hi,
I've been playing with GPAL on an 16F877A -- I need to set __CONFIG
_RC_OSC as I don't have a crystal handy. I've tried the following
methods but only the final one worked:
(1) add an 'asm' block to my main function containing __CONFIG _RC_OSC
-- fails in the linker with:
gplink: gpcofflink.c:1359: gp_cofflink_patch_addr: Assertion
`current_value & 0x80000000' failed.
Aborted
(2) run "gpal -S" then manually add the __CONFIG line and then run gpasm
and gplink -- works (although gplink segfaults on completion it creates
the output file before this happens).
The difference seems to be that adding __CONFIG in the pal file adds the
line after the
".code_main code
_main_prog_address:
global _main_prog_address
; procedure main.main
main.main:"
chunk. While when I add it by hand I put it right after the include
p16f877a.inc line.
Could a pragma be added to set the __CONFIG fuses or is there another
way of doing it in/outside of gpal that isn't so laborious? An
alternative would be to allow adding an asm block that would be put in
above the code for example.
-Shaun