Question

I'm having some trouble with compiling the Procyon libraries with AVR Studio 6. The Code i am using works entirely with AVR studio 4.

The following lines fail to compile in this common lib:

//! prints a string stored in program rom
/// \note This function does not actually store your string in
/// program rom, but merely reads it assuming you stored it properly.
void rprintfProgStr(const prog_char str[]);

Which results in the error:

Error   1   unknown type name 'prog_char' D:\AVRTests\ProcyonLibTest\ProcyonLibTest\rprintf.h   85  1   ProcyonLibTest

There is also another error to do with the deceleration of this function. The next one is:

// use this to store hex conversion in RAM
//static char HexChars[] = "0123456789ABCDEF";
// use this to store hex conversion in program memory
//static prog_char HexChars[] = "0123456789ABCDEF";
static char __attribute__ ((progmem)) HexChars[] = "0123456789ABCDEF";

Which results in the error:

Error   2   variable 'HexChars' must be const in order to be put into read-only section by means of '__attribute__((progmem))'  D:\AVRTests\ProcyonLibTest\ProcyonLibTest\rprintf.c 45  39  ProcyonLibTest

This is with a standard library that from research everyone seems to have working. Any ideas about why this might be happening?

Was it helpful?

Solution

Error 1 seems to have something to do with not including <avr/pgmspace.h>. Or maybe the versions are incompatible. You may have to make your own typedef to get it to work.

Error 2 looks like an error caused by the version of the compiler being newer. You could modify the file to make the variable const.

If you don't want to tweak these files, then you need to get compatible versions of everything.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top