Copying an array stored in progmem to another array

Hey guys and gals,
I'm having yet another issue / stumbling block learning about 2D arrays.
I'm trying to copy the entire contents of an array which is stored in progmem into another array as shown here.

Arrays are stored like this.

volatile unsigned int arrayy[8][8]   = { 
  {B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111}, 
  {B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111}, 
  {B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111}, 
  {B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111}, 
  {B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111}, 
  {B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111}, 
  {B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111}, 
  {B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111}, 
};

  const int arrayx[8][8] PROGMEM  = { 
  {B11111111, B10000001, B10000001, B10000001, B10000001, B10000001, B10000001, B11111111}, 
  {B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001}, 
  {B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001}, 
  {B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001}, 
  {B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001}, 
  {B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001}, 
  {B10000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10000001}, 
  {B11111111, B10000001, B10000001, B10000001, B10000001, B10000001, B10000001, B11111111}, 
  };

Now if it were just an array stored in the dynamic memory I would use a for loop to transfer the data from array x into array y like this.

  for(int l = 0; l < 8; l ++){
    for(int m = 0; m < 8; m++){
      arrayy[l][m] = arrayx[l][m];

needless to say its not quite as easy when pulling it from the progmem space.
Can anyone point me in the right direction on this?

Kind regards,
Unordung

Two references that should be helpful:

https://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html

You only need to tell the compiler to read the source array element from progmem:

      arrayy[l][m] = pgm_read_word(&arrayx[l][m]);

Much easier, and probably faster, to use memcpy, although the compiler issues a warning because the destination array is declared as volatile.

  memcpy_P(arrayy, arrayx, sizeof(arrayy));

Since the destination array is volatile, using either method you should temporarily disable interrupts while doing the copy. Also, is there some reason you are using int instead of byte?

Awesome thank you for the reply.
That was exactly what I needed.

PS sorry for the delay. :wink:
I just wanted to make sure anyone who stumbled upon this post knew your answer was spot on.