just struggling with this: The concurrent use of PROGMEM with String-objects and the F-Macro causes a compile error on ESP8266-boards
This:
const char html_page2[] PROGMEM = "Teststring";
void setup() {
// Open serial communications:
Serial.begin(115200);
Serial.println(F("Programmstart"));
}
void loop() {
}
This:
const String html_page2 PROGMEM = "Teststring";
void setup() {
// Open serial communications:
Serial.begin(115200);
Serial.println(F("Programmstart"));
}
void loop() {
}
With an ESP-Board it causes an
Arduino: 1.6.5 (Windows 7), Platine: "Generic ESP8266 Module (Autoflash), Serial, 80 MHz, 40MHz, DIO, 115200, 1M (512K SPIFFS)"
sketch_sep17a:1: error: html_page2 causes a section type conflict with __c
In file included from C:\Users\brutzler\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.5-1044-g170995a\cores\esp8266/Arduino.h:245:0,
from sketch_sep17a.ino:1:
C:\Users\brutzler\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.5-1044-g170995a\cores\esp8266/pgmspace.h:18:51: note: '__c' was declared here
#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
^
C:\Users\brutzler\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.5-1044-g170995a\cores\esp8266/WString.h:38:76: note: in definition of macro 'FPSTR'
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
^
C:\Users\brutzler\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.5-1044-g170995a\cores\esp8266/WString.h:39:34: note: in expansion of macro 'PSTR'
#define F(string_literal) (FPSTR(PSTR(string_literal)))
^
sketch_sep17a.ino:6:18: note: in expansion of macro 'F'
html_page2 causes a section type conflict with __c
And even eliminating the F-Macro of the Seriel.println, it is compiling, but causing continously restarts of the ESP after flashing
ESP8266 Arduino add-on
Arduino IDE 1.6.5