I have following code :
#include "ESP8266WiFi.h"
extern "C" {
#include <user_interface.h>
}
byte rtcStore[1];
const char trial[] = "[{\"T\":\"20\",\"H\":\"40\"},{\"T\":\"20\",\"H\":\"40\"},{\"T\":\"20\",\"H\":\"40\"},{\"T\":\"20\",\"H\":\"40\"},{\"T\":\"20\",\"H\":\"40\"},{\"T\":\"20\",\"H\":\"40\"},{\"T\":\"20\",\"H\":\"40\"},{\"T\":\"20\",\"H\":\"40\"},{\"T\":\"20\",\"H\":\"40\"},{\"T\":\"20\",\"H\":\"40\"}]";
void setup() {
// Start Serial
Serial.begin(115200);
delay(10);
Serial.println("Hello");
// put your setup code here, to run once:
}
void loop() {
delay(1000);
rtcStore[0] = 10;
Serial.println("Mem write rtcStore:");
Serial.println(system_rtc_mem_write(65, rtcStore, sizeof(rtcStore)));
Serial.println("Mem write trial:");
Serial.println(system_rtc_mem_write(68, trial, sizeof(trial)));
char t[sizeof(trial)];
byte r[1];
Serial.println("Mem read rtcStore:");
Serial.println(system_rtc_mem_read(65, &r, sizeof(r)));
Serial.println("Mem read trial:");
Serial.println(system_rtc_mem_read(68, &t, sizeof(trial)));
Serial.print('<');
Serial.print(t);
Serial.println('>');
Serial.print('<');
Serial.print(r[0]);
Serial.println('>');
}
The above code outputs on Mac wrong:
r...lrß.c.ân..à....ì.p<.ìx.ßÇÜäl.p...ònnä.Ä;ònÄÜä...b#l`.$`.üpònàÃÜ...àÇÀl.À...b.nâãnÀ$Ø.bÀľ~ònî.ÄÁ.l`.ü.Ü#nÀ.r....nrß;.ÄÀ...r...rßÛnÀ..àÇÄl`.üünÄbàHello
Mem write rtcStore:
1
Mem write trial:
0
Mem read rtcStore:
0
Mem write trial:
1
<¨;N..ü÷æ%¨A.FkÞì.I$0½ÇûY...è~...!.?Üå°.ül..ð.:Y±í¦@.Cý®.£LÁ
«'"Ìim(Éð-Qî..LÒ,%Gµûv ]såþy£@.>
<192>
and on windows correct :
r...lrß.#.ânÀ.à....ì.p|ß.ìx.Çäl.p...ònnä.;ònÄä...bcl`.$`.üpònàÃÜ..àÇÀl....bÀ.nâãnÀ$Ø.bÀÄ>~ònî.ÄÁ.l`.ü.Ü#nÀ..r....nrß;.ÄÀ.?.r...rßÛnÀ..àÇÄl`.üünÄbàHello
Mem write rtcStore:
1
Mem write trial:
1
Mem read rtcStore:
0
Mem read trial:
1
<[{"T":"20","H":"40"},{"T":"20","H":"40"},{"T":"20","H":"40"},{"T":"20","H":"40"},{"T":"20","H":"40"},{"T":"20","H":"40"},{"T":"20","H":"40"},{"T":"20","H":"40"},{"T":"20","H":"40"},{"T":"20","H":"40"}]>
<0>
The xtensa compiler is the same 4.8.2, why do i see this difference ? I can take the bin from windows and flash with esptool on mac and that works fine. It's driving me nuts. Any ideas what is wrong ?
donnib