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

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

Re: [avr-gcc-list] String in flash


From: Russell Shaw
Subject: Re: [avr-gcc-list] String in flash
Date: Wed, 15 Oct 2003 00:31:02 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030311 Debian/1.2.1-10

E.Weddington wrote:
Hi,
Both these put .string into the .data section. How do i

get it into

the .text section? (at90s4433, latest CVS avr-libc, avr-

gcc 3.3.2,

avr-as 2.14, avr-ld 2.14)

  static PGM_P hex="0123456789abcdef";
  static const char* hex="0123456789abcdef";

Read the avr-libc docs, IIRC the Program Space Utilities section. The header file you need is
<avr/pgmspace.h>.

I've read all the manual and header files. I've tried:

  static const char* hex="0123456789abcdef";
  static PGM_P hex="0123456789abcdef";
  static PGM_P hex=(prog_int8_t*)"0123456789abcdef";

but the "0123456789abcdef" string seems to go in the .data
section:

  217                           .data
  218                   .LC0:
  219 0000 3031 3233            .string "0123456789abcdef"
  219      3435 3637
  219      3839 6162
  219      6364 6566
  219      00
  220                           .type   hex, @object
  221                           .size   hex, 2
  222                   hex:
  223 0011 0000                 .word   .LC0

These give an error:

  static PGM_P hex =  pgm_read_byte("0123456789abcdef");
  static PGM_P hex =  PSTR("0123456789abcdef");
gives:
  error: braced-group within expression allowed only inside a function



reply via email to

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