gnupic: .COD file problems with MPLAB


Previous by date: 13 Sep 2004 02:15:47 +0100 .COD file problems with MPLAB, Aaron Colwell
Next by date: 13 Sep 2004 02:15:47 +0100 Re: .COD file problems with MPLAB, Scott Dattalo
Previous in thread: 13 Sep 2004 02:15:47 +0100 .COD file problems with MPLAB, Aaron Colwell
Next in thread: 13 Sep 2004 02:15:47 +0100 Re: .COD file problems with MPLAB, Scott Dattalo

Subject: Re: .COD file problems with MPLAB
From: Craig Franklin ####@####.####
Date: 13 Sep 2004 02:15:47 +0100
Message-Id: <414405AE.40806@users.sourceforge.net>

Aaron Colwell wrote:

> I've been having trouble using MPLAB with the .cod files generated by 
> GPLINK. After looking at
> the code for a little bit, I figured out that making the following 
> change allows MPLAB to properly
> read the .cod files.
>
> Index: cod.c
> ===================================================================
> RCS file: /cvsroot/gputils/gputils/gplink/cod.c,v
> retrieving revision 1.7
> diff -r1.7 cod.c
> 282c282
> <     gp_putl16(&lb.block[offset + COD_LS_SLOC], state.lst.was_org);
> ---
>
>>     gp_putl16(&lb.block[offset + COD_LS_SLOC], state.lst.was_org << 
>> state.byte_addr);
>
>

This is a known problem.  Not only with gplink, but gpasm.  It is first 
on the gpasm TODO list in the source code.

It hasn't been changed because it requires gpsim to be changed too.  If 
gpsim makes a release soon we could change it.  Scott, what are your plans?

If that isn't going to happen soon, I could add an --mplab switch on 
gputils.

> I don't know if this is what the "right fix" should be, but it seems 
> to make things work for me. I'm
> using gplink via sdcc. Here is the command-line that sdcc is using.
>
> C:\msys\1.0\local\bin\gplink.exe 
> -I"C:\msys\1.0\local\bin\..\share\sdcc\lib" 
> -I"C:\msys\1.0\local\bin\..\share\sdcc\lib\pic16"  -m  -o prog  
> prog.o  pic18f242.lib
>
> The problem I'm seeing in MPLAB is that the addresses are half of what 
> they are supposed to be, so
> stepping through the code in the simulator does not work right. It 
> shows the wrong lines for the
> current instruction.
>

I think there are a couple of other minor issues with COD files.

I have always had good luck using the gplink's COFF output for mplab.  
Add a -c on gplink and you get a .cof file.  There are no known issues 
with that format.

> Aaron
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's 
> FREE! hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>
>


Previous by date: 13 Sep 2004 02:15:47 +0100 .COD file problems with MPLAB, Aaron Colwell
Next by date: 13 Sep 2004 02:15:47 +0100 Re: .COD file problems with MPLAB, Scott Dattalo
Previous in thread: 13 Sep 2004 02:15:47 +0100 .COD file problems with MPLAB, Aaron Colwell
Next in thread: 13 Sep 2004 02:15:47 +0100 Re: .COD file problems with MPLAB, Scott Dattalo


Powered by ezmlm-browse 0.20.