[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: |
Royce Pereira |
Subject: |
Re: [avr-gcc-list] String array in ROM gives error in spite of following example code. |
Date: |
Thu, 12 Jun 2014 16:08:50 +0530 |
I found that this does not throw an error:
const word pgtmp_msg[] PROGMEM =
{ ptmpUP_msg, ptmpDN_msg, ptmpCLG_msg,} ;
but it does give a warning:
warning: initialization makes integer from pointer without a cast
[enabled by default]
{ ptmpUP_msg, ptmpDN_msg, ptmpCLG_msg,};
^
Is there a proper way of doing this, now that the libc example too is
inaccurate ?
On Thu, Jun 12, 2014 at 4:04 PM, Royce Pereira <address@hidden> wrote:
> Francois,
>
> No, that does not work.
>
> In fact, it was *exactly* what i was using before (which was not as
> per the libc examples).
>
> But it gave a similar error, so i tried following the libc example exactly.
>
> But still no luck.
>
>
> On Thu, Jun 12, 2014 at 3:59 PM, Francois Lorrain
> <address@hidden> wrote:
>> Hello,
>>
>> Newer version of gcc have changed the progmem behaviour, it cannot be
>> applied to typedef anymore if I remember well.
>>
>> const char * pgtmp_msg[] should solve your issue
>>
>> Regards
>>
>> Francois
>>
>>
>> On Thu, Jun 12, 2014 at 12:23 PM, Royce Pereira <address@hidden> wrote:
>>>
>>> Hi,
>>>
>>> I recently updated WinAVR to a newer version of the AVR-GCC toolchain,
>>> downloaded from the Atmel site.
>>>
>>> My version is this:
>>>
>>> avr-gcc (AVR_8_bit_GNU_Toolchain_3.4.3_1072) 4.8.1
>>>
>>> My code was compiling without errors before, but with this version, it
>>> is giving errors in spite of following the instructions in the faq
>>> section of the avr-libc document.
>>> //---------------------------------------------
>>> #include <avr/io.h>
>>> #include <avr/pgmspace.h>
>>>
>>> const char ptmpUP_msg[] PROGMEM = "Upper Temp" ;
>>> const char ptmpDN_msg[] PROGMEM = "Lower Temp" ;
>>> const char ptmpCLG_msg[] PROGMEM = "Chiller Temp" ;
>>>
>>> PGM_P pgtmp_msg[] PROGMEM =
>>> { ptmpUP_msg, ptmpDN_msg, ptmpCLG_msg,} ;
>>>
>>> //------------------------------------------------------
>>> The above code gives the following error:
>>>
>>> error: variable 'pgtmp_msg' must be const in order to be put into
>>> read-only section by means of '__attribute__((progmem))'
>>> //-----------------------------------------------------
>>>
>>> But I have followed the avr-libc example exactly.
>>> So why is this error thrown and whats the correct way to do this ?
>>>
>>> Thank You.
>>> --
>>> Best Regards,
>>>
>>> -- Royce Pereira
>>>
>>> _______________________________________________
>>> AVR-GCC-list mailing list
>>> address@hidden
>>> https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>>
>>
>
>
>
> --
> Best Regards,
>
> -- Royce Pereira
--
Best Regards,
-- Royce Pereira
- [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., Francois Lorrain, 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 <=
- 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, 2014/06/13
- Re: [avr-gcc-list] String array in ROM gives error in spite of following example code., Royce Pereira, 2014/06/13