[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] String array in ROM gives error in spite of following
From: |
Senthil Kumar Selvaraj |
Subject: |
Re: [avr-gcc-list] String array in ROM gives error in spite of following example code. |
Date: |
Fri, 13 Jun 2014 12:44:03 +0530 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Jun 13, 2014 at 12:02:58PM +0530, Royce Pereira wrote:
> Thanks, Joerg,
>
> This is news to me :) !
>
> I googled for '__flash qualifier in AVR-GCC' and I understand that
> using __flash eliminates the need for 'pgm_read_byte(&flashLocation)'
> ?
It reads as many bytes as necessary.
>
> That is, you read it directly (like other ram variables), and avr gcc
> will read it from flash automatically ?
>
Yes. And there's the __memx qualifier which lets you access both flash
and RAM seamlessly.
If you use the __flash<n> qualifiers to place data in flash, there's some
linker script setup involved.
Regards
Senthil
>
> On Fri, Jun 13, 2014 at 11:19 AM, Joerg Wunsch <address@hidden> wrote:
> > Royce Pereira <address@hidden> wrote:
> >
> >> Even the libc documentation, which was once the bible of avr-gcc on
> >> this is not accurate. The sample code just does not work.
> >
> > Apparently, nobody noticed before. Please, file a bug report
> > to the avr-libc project, so we can fix that.
> >
> > The question here (as always) is whether you really want both, the
> > strings itself as well as the pointers (table of it) in flash. The
> > table is quite small, and could as well be kept in RAM unless you are
> > very thight on RAM.
> >
> > As the compiler now understands the __flash qualifier, using that
> > would make it a lot easier.
> > --
> > cheers, Joerg .-.-. --... ...-- -.. . DL8DTL
> >
> > http://www.sax.de/~joerg/
> > Never trust an operating system you don't have sources for. ;-)
> >
> > _______________________________________________
> > AVR-GCC-list mailing list
> > address@hidden
> > https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>
>
>
> --
> Best Regards,
>
> -- Royce Pereira
>
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., (continued)
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Royce Pereira, 2014/06/12
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Royce Pereira, 2014/06/12
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Royce Pereira, 2014/06/12
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Bob Paddock, 2014/06/12
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Senthil Kumar, 2014/06/12
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Royce Pereira, 2014/06/12
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Senthil Kumar Selvaraj, 2014/06/13
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Royce Pereira, 2014/06/13
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Joerg Wunsch, 2014/06/13
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Royce Pereira, 2014/06/13
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.,
Senthil Kumar Selvaraj <=
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Royce Pereira, 2014/06/13
Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Georg-Johann Lay, 2014/06/16