user82138: Using ESP8266 (NodeMcu 1) in Arduino IDE:
I can't upload my sketch because a single call to strcpy_P seems to increase the IROM usage by about 400%: 25% total usage without the call, 100+% with the call.
And even more strange, it depends on the second parameter of strcpy_P (the source):
If a pointer to a char array is provided, the usage increases dramatically
  char * ptr = (char *) pgm_read_word (&myArrays[index]);
  char buffer [1500];

  strcpy_P (buffer, ptr); // can't upload, uses 100+% of available IROM

Whereas with PSTR as parameter (just to test) total size of sketch is just 25% of IROM, leaving everything else unchanged:
  char * ptr = (char *) pgm_read_word (&myArrays[index]);
  char buffer [1500];

  strcpy_P(buffer, PSTR("Test")); // Ok, does not increase sketch size /IROM  usage

What's going on here ?

user70044: I guess the problem is not the strcpy_P function, but your array. Without that function call, the entire array can be removed by the compiler (I presume it's not used anywhere else). As soon as you add code that definitely accesses it, it is included in the code and therefore increases the size of the program so much.

82138: <p>Using ESP8266 (NodeMcu 1) in Arduino IDE:</p>
<p>I can't upload my sketch because a single call to <strong>strcpy_P</strong> seems to increase the IROM usage by about 400%: 25% total usage without the call, 100+% with the call.</p>
<p>And even more strange, it depends on the second parameter of strcpy_P (the source):
If a pointer to a char array is provided, the usage increases dramatically</p>
<pre><code>  char * ptr = (char *) pgm_read_word (&amp;myArrays[index]);
  char buffer [1500];

  strcpy_P (buffer, ptr); // can't upload, uses 100+% of available IROM
</code></pre>
<p>Whereas with PSTR as parameter (just to test) total size of sketch is just 25% of IROM, leaving everything else unchanged:</p>
<pre><code>  char * ptr = (char *) pgm_read_word (&amp;myArrays[index]);
  char buffer [1500];

  strcpy_P(buffer, PSTR(&quot;Test&quot;)); // Ok, does not increase sketch size /IROM  usage
</code></pre>
<p>What's going on here ?</p>
 70044: <p>I guess the problem is not the <code>strcpy_P</code> function, but your array. Without that function call, the entire array can be removed by the compiler (I presume it's not used anywhere else). As soon as you add code that definitely accesses it, it is included in the code and therefore increases the size of the program so much.</p>
