Storing Strings in Flash

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Freaks,

I've got a few strings that I want to store in flash. Weird things happen when I try to do a strcpy into RAM. Basically the compiler (ICCAVR) is happy but I get unexpected results.

const unsigned char constTest[7] = "test\r\n";
unsigned char ramTest[7];

.....

strcpy(ramTest,(unsigned char *)constTest);
UartWrite(ramTest,strlen(ramTest));

Any Ideas?

Dave.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah found it....cstrcpy()