gnupic: Re: [gnupic] Re: GPAL, GPLINK and __CONFIG


Previous by date: 13 Apr 2005 02:10:26 +0100 Re: GPAL, GPLINK and __CONFIG, Shaun
Next by date: 13 Apr 2005 02:10:26 +0100 Re: [gnupic] gpal cry for help, Craig Franklin
Previous in thread:
Next in thread: 13 Apr 2005 02:10:26 +0100 Re: [gnupic] Re: GPAL, GPLINK and __CONFIG, Shaun

Subject: Re: [gnupic] Re: GPAL, GPLINK and __CONFIG
From: Craig Franklin ####@####.####
Date: 13 Apr 2005 02:10:26 +0100
Message-Id: <425DC2AA.9090304@users.sourceforge.net>

Shaun wrote:

>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
>
>  
>
This can be made to work, but I wouldn't recommend it.  Asm blocks are 
only valid within subprograms.  The config creates a separate section, 
putting it in the middle of your code section can cause problems.

Not sure what caused the assertion.  Send be the file and I will figure 
it out.

>(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).
>
>  
>

Don't do that either.  Modifying output files is error prone and 
difficult to maintain.

Again I don't know what is causing the segfault.  I need the version you 
are using and an example.

>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.
>
>  
>
The plan is to add a pragma.  For now I recommend putting the config in 
a separate asm file.  Assemble it and add it to the link list.

>-Shaun
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ####@####.####
>For additional commands, e-mail: ####@####.####
>
>
>  
>


Previous by date: 13 Apr 2005 02:10:26 +0100 Re: GPAL, GPLINK and __CONFIG, Shaun
Next by date: 13 Apr 2005 02:10:26 +0100 Re: [gnupic] gpal cry for help, Craig Franklin
Previous in thread:
Next in thread: 13 Apr 2005 02:10:26 +0100 Re: [gnupic] Re: GPAL, GPLINK and __CONFIG, Shaun


Powered by ezmlm-browse 0.20.