Bug in GPUTILS ? Write to EEPROM for P18F2580

View: New views
7 Messages — Rating Filter:   Alert me  

Bug in GPUTILS ? Write to EEPROM for P18F2580

by vaclavpe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I found strange problem. In ASM I have following:

; ; Starting pCode block for absolute Ival
S_main__EE_prog code 0XF0007B
_EE_prog:
        DB 0x50, 0x72, 0x6f, 0x67, ... etc...

But in LST (and on HEX as well) I have problem:

f00078   006e     dw 0x6e  ;unknown opcode
                                           
                                           ; ; Starting pCode block for absolute Ival
                                           S_main__EE_prog code 0XF0007B
                                           _EE_prog:
f0007a   7250     btg 0x50, 0x1, 0         DB 0x50, 0x72, 0x6f, 0x67, ... etc ...

I must say that I don't want code of 0x7B to be put onto 0x7A. Is there something bad in GPASM or is there a workaround for this problem ?

If I move _EE_prog to 0x7A - I get following message: "error: multiple sections using address 0xf0007a"

I initialize data EEPROM directly in SDCC.

Thank you in advance,
Vaclav



---------------------------------------------------------------------
To unsubscribe, e-mail: gnupic-unsubscribe@...
For additional commands, e-mail: gnupic-help@...


Re: Bug in GPUTILS ? Write to EEPROM for P18F2580

by Robert Pearce-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 15 Feb 2009, Vaclav Peroutka <vaclavpe@...> wrote :

>Hello,
>
>I found strange problem. In ASM I have following:
>
>; ; Starting pCode block for absolute Ival
>S_main__EE_prog        code    0XF0007B
>_EE_prog:
>       DB      0x50, 0x72, 0x6f, 0x67, ... etc...
>
>But in LST (and on HEX as well) I have problem:
>
>f00078   006e     dw   0x6e  ;unknown opcode
>
>                                           ; ; Starting pCode block for
>absolute Ival
>                                           S_main__EE_prog     code    0XF0007B
>                                           _EE_prog:
>f0007a   7250     btg  0x50, 0x1, 0            DB      0x50, 0x72,
>0x6f, 0x67, ... etc ...
>
>I must say that I don't want code of 0x7B to be put onto 0x7A. Is there
>something bad in GPASM or is there a workaround for this problem ?
>
I think you may need to declare your section as packed:

    S_main__EE_prog      code_pack       0XF0007B

If the section is not packed then on an 18F target the assembler will
word align the output of every source line.

>If I move _EE_prog to 0x7A - I get following message: "error: multiple
>sections using address 0xf0007a"
>
I'm not sure why it would do that, but I suspect it relates to something
you didn't quote.
--
Rob Pearce                       http://www.bdt-home.demon.co.uk

The contents of this | Windows NT crashed.
message are purely   | I am the Blue Screen of Death.
my opinion. Don't    | No one hears your screams.
believe a word.      |

---------------------------------------------------------------------
To unsubscribe, e-mail: gnupic-unsubscribe@...
For additional commands, e-mail: gnupic-help@...


Re: Bug in GPUTILS ? Write to EEPROM for P18F2580

by vaclavpe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Robert,

I created simple code for SDCC (it internally uses GPUTILS). You can just run the command in Makefile. ASM, LST etc, files are automatically generated. Please see atached code. Anyway inside attached ZIP there are all files already prepared.

My complaint is that I want to put some string on 0x7B. Previous string ends on 0x79. And GPASM does not skip 0x7A.

> I think you may need to declare your section as packed:
>
>     S_main__EE_prog      code_pack       0XF0007B

It seems to me that it did not help.

I use following versions (in Win32) :
D:\_gpasm_problem>sdcc --version
SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.4 #5264 (Nov 11 2008) (MINGW32)

D:\_gpasm_problem>gpasm --version
gpasm-0.13.6 beta

Hopefully now it will be more clear.


---------------------------------------------------------------------
To unsubscribe, e-mail: gnupic-unsubscribe@...
For additional commands, e-mail: gnupic-help@...

=?us-ascii?Q?=5Fgpasm=5Fproblem=2Ezip?= (28K) Download Attachment

Re: Re: Bug in GPUTILS ? Write to EEPROM for P18F2580

by Robert Pearce-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 16 Feb 2009, Vaclav Peroutka <vaclavpe@...> wrote :
>My complaint is that I want to put some string on 0x7B. Previous string ends on 0x79. And GPASM does not skip 0x7A.
>
>> I think you may need to declare your section as packed:
>>      S_main__EE_prog      code_pack       0XF0007B
>
>It seems to me that it did not help.

It seems to me the ZIP file you attached didn't include that change. I
don't know how to persuade SDCC to do it, though. Maybe somebody else
does.
--
Rob Pearce                       http://www.bdt-home.demon.co.uk

The contents of this | Windows NT crashed.
message are purely   | I am the Blue Screen of Death.
my opinion. Don't    | No one hears your screams.
believe a word.      |

---------------------------------------------------------------------
To unsubscribe, e-mail: gnupic-unsubscribe@...
For additional commands, e-mail: gnupic-help@...


Re: Re: Bug in GPUTILS ? Write to EEPROM for P18F2580

by vaclavpe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Robert,

> It seems to me the ZIP file you attached didn't include that change. I
> don't know how to persuade SDCC to do it, though. Maybe somebody else
> does.

I had to edit it manually and then run GPASM. In the attached ZIP there are "main.manual.asm" and "main.manual.lst" files. There is code_pack directive. But as you can see in LST, there is no change - still bad location of 0x7B code.

I compiled it ( and then renamed LST) with
> gpasm.exe -DSDCC_MODEL_SMALL -DSTACK_MODEL_SMALL -c "main.manual.asm" -o "main.o"

I hope it is more helpful.

Best Regards,
Vaclav

---------------------------------------------------------------------
To unsubscribe, e-mail: gnupic-unsubscribe@...
For additional commands, e-mail: gnupic-help@...

=?us-ascii?Q?=5Fgpasm=5Fproblem2=2Ezip?= (23K) Download Attachment

Re: Bug in GPUTILS ? Write to EEPROM for P18F2580

by Robert Pearce-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 19 Feb 2009 09:35:39 +0100 (CET)
Vaclav Peroutka <vaclavpe@...> wrote:

> I had to edit it manually and then run GPASM. In the attached ZIP there are "main.manual.asm" and "main.manual.lst" files. There is code_pack directive. But as you can see in LST, there is no change - still bad location of 0x7B code.
>
> I compiled it ( and then renamed LST) with
> > gpasm.exe -DSDCC_MODEL_SMALL -DSTACK_MODEL_SMALL -c "main.manual.asm" -o "main.o"
>
OK, I've tried it here, and it does seem gpasm can't begin a new code
section at an odd address, even when marked "packed". This looks like a
bug, so you should raise it in the gputils bug system. I'm not involved
with gputils development, so somebody else needs to look into it.

Regards,
Rob

---------------------------------------------------------------------
To unsubscribe, e-mail: gnupic-unsubscribe@...
For additional commands, e-mail: gnupic-help@...


Re: Bug in GPUTILS ? Write to EEPROM for P18F2580

by David Barnett-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Feb 19, 2009 at 4:51 PM, Robert Pearce <rob@...>wrote:

> OK, I've tried it here, and it does seem gpasm can't begin a new code
> section at an odd address, even when marked "packed".

That had been my guess from what I remember of the code. We've got several
nasty problems with odd addresses, and we've fixed a few already with nasty
hacks. You'll probably need to use a workaround...

David