Array of pointers : what is the error ?

Hello,

Incredible, 3 hours on this issue and impossible to find a solution.
Why can i only read array elements ONLY with a constant index ?

Thank you if you can help me.

I’ve tested this sketch on an arduino Nano.
Patrick

typedef struct {
      uint8_t   A;
      uint8_t   B;
      uint8_t   C;
      uint8_t   D;
      uint8_t   E;
      uint8_t   F;
      uint8_t   G;
      uint8_t   H;
} r_;

r_    R;

static uint8_t* const PROGMEM Ind[] = {&R.A, &R.B, &R.C, &R.D, &R.E, &R.F, &R.G, &R.H};

void setup() {
  Serial.begin(9600);

  R.A = 0X01;
  R.B = 0X02;
  R.C = 0X04;
  R.D = 0X08;
  R.E = 0X10;
  R.F = 0X20;
  R.G = 0X40;
  R.H = 0X80;

  int x = 0x43;
  Serial.println((uint16_t)&R.D, HEX);
  Serial.println(R.D, HEX);
  Serial.println((uint16_t)Ind [x-0x40], HEX);
  Serial.println(*Ind [x-0x40], HEX);
  x = 0x0;
  while (x < 0x8) {
    Serial.println((uint16_t)Ind [x], HEX);
    x++;
  }
  for (x = 0x40; x < 0x48; x++) {
    Serial.println((uint16_t)Ind [x-0x40], HEX);
  }
  for (x = 0; x < 8; x++) {
    Serial.println((uint16_t)Ind [x], HEX);
  }
  x = 0x0;
  while (x < 0x8) {
    switch (x) {
    case 0 : Serial.println((uint16_t)Ind [0], HEX); break;
    case 1 : Serial.println((uint16_t)Ind [1], HEX); break;
    case 2 : Serial.println((uint16_t)Ind [2], HEX); break;
    case 3 : Serial.println((uint16_t)Ind [3], HEX); break;
    case 4 : Serial.println((uint16_t)Ind [4], HEX); break;
    case 5 : Serial.println((uint16_t)Ind [5], HEX); break;
    case 6 : Serial.println((uint16_t)Ind [6], HEX); break;
    case 7 : Serial.println((uint16_t)Ind [7], HEX); break;
    }
    x++;
  }
}

void loop() {
}

Result :

119
8
119
8
B8B8
0
87
0
0
301
0
C5
B8B8
0
87
0
0
301
0
AC
B8B8
0
87
0
0
301
0
EE
116
117
118
119
11A
11B
11C
11D

PROGMEM is a different address space, and needs special instructions to read it.

I don't see those special instructions in your code.

Oh bloody sh** !
Stupid

Thanks, of course.