avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] PROGMEM with boot loader


From: Yannick PODGORSKI
Subject: Re: [avr-gcc-list] PROGMEM with boot loader
Date: Mon, 22 Nov 2004 11:22:27 +0100

Hi Wolfgang,
thanks again but it doesn't work again.
I use :
       const char essai[] PROGMEM = {"essai"};
and
       fprintf_P(OutPc, "%s", pgm_read_byte_far(essai));

You talked about PRG_RDB but I don't use it.
I try to use PSRT :
       fprintf_P(OutPc, PSTR("PSTR")); and it doesn't work.
You say that's fprint_P() supports only near progmem but
I don't see that in libc.
Sorry for my questions.

Yannick.

On Fri, 19 Nov 2004, Wolfgang Quack wrote:

Hi Yannick,

uups, sorry.

The fprintf_P() in avr-libc-1.0.4 supports only near progmem.

Look at avr-libc-1.0.4/libc/stdio/vfprintf.c line 141:
The old style macro PRG_RDB() is used there.
This is defined as the near version of pgm_read_byte() instead of the
far version you need to access the upper memory.

Wolfgang


On Fri, 19 Nov 2004, Yannick PODGORSKI wrote:

Hi Wolfgang,
thanks for your answer but it doesn't work
with "RAMPZ = 1" or "RAMPZ = 0".
I try this before but nothing.
I try again to put the section .text at the address 0x0
and it works with "RAMPZ = 1" AND "RAMPZ = 0".
It's strange because this bit allow me to access to upper
or lower flash and I can access whatever the RAMPZ is.
Thanks.

Yannick


> On Fri, 19 Nov 2004, Wolfgang Quack wrote


> Hi Yannick,
>
> Just put "RAMPZ = 1;" in front of fprintf_P(...)
>
> You need this, because the const's are now in the upper space or flash.
>
> Wolfgang




reply via email to

[Prev in Thread] Current Thread [Next in Thread]