Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Royce Pereira
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)' ? That is, you read it directly (like other ram variables), and avr gcc will read it from flash automatically ? On Fri

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Joerg Wunsch
Royce Pereira 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 whet

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Royce Pereira
Well, I'm happy that it is stricter. The point is that there doesn't seem to be a consensus on how to do this. Even the libc documentation, which was once the bible of avr-gcc on this is not accurate. The sample code just does not work. On Fri, Jun 13, 2014 at 10:24 AM, Senthil Kumar Selvaraj wr

[avr-gcc-list] TINY13 PWM behavior stumps me.

2014-06-12 Thread Jim Brain
I have a chunk of code that operates fine on larger AVR8s, but does not seem to operate on the T13. Just wondering if it's me (could be, this is the first time I have used such a small AVR8), or the uC... A snippet: static volatile uint8_t i = 0; int main(void) { DDRB = _BV(PB0) | _BV(PB1)

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Senthil Kumar Selvaraj
On Thu, Jun 12, 2014 at 09:58:54PM +0530, Royce Pereira wrote: > I'll try the various suggestions tomorrow. > > But I'm surprised at the diverse replies. > > Don't people declare an array of strings anymore ? :-) > Well, the compiler is now stricter in that it expects the array itself to be dec

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Royce Pereira
I'll try the various suggestions tomorrow. But I'm surprised at the diverse replies. Don't people declare an array of strings anymore ? :-) On Thu, Jun 12, 2014 at 9:30 PM, Senthil Kumar wrote: > Does > > PGM_P const pgtmp_msg[]PROGMEM = >{ ptmpUP_msg, ptmpDN_msg, ptmpCLG_msg,} ; > >

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Senthil Kumar
Does PGM_P const pgtmp_msg[]PROGMEM = { ptmpUP_msg, ptmpDN_msg, ptmpCLG_msg,} ; work? The array itself needs to be declared const, as progmem/flash contents cannot be modified. Regards Senthil On Thu, Jun 12, 2014 at 6:16 PM, Bob Paddock wrote: > #define FLASH /* Empty, used for IA

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Bob Paddock
#define FLASH /* Empty, used for IAR compiler. Define PROGMEM as empty to use GCC */ static char const FLASH string000[] PROGMEM = "NO_MSG"; /* 000/0x00 */ ... static PGM_P const string_pointers[] PROGMEM = { string000, /* 0x00 */ ... }; That works without out warnings for C. There was a

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Royce Pereira
Sorry, the 'word' type means 'unsigned integer'. I have a header that defines 'word'. :-) On Thu, Jun 12, 2014 at 4:08 PM, Royce Pereira wrote: > I found that this does not throw an error: > > const word pgtmp_msg[]PROGMEM = >{ ptmpUP_msg, ptmpDN_msg, ptmpCLG_msg,} ; > > but it does giv

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Royce Pereira
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 the

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Royce Pereira
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 wrote: > Hello, > > N

Re: [avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Francois Lorrain
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 wrote: > Hi, > > I recently updated WinAVR to a newer

[avr-gcc-list] String array in ROM gives error in spite of following example code.

2014-06-12 Thread Royce Pereira
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 ins