Closed mhightower83 closed 4 years ago
Copied over from https://github.com/esp8266/Arduino/pull/7060#issuecomment-669317101
memmove_P does not support IRAM
memmove_P
#include <Arduino.h> #include <ESP8266WiFi.h> #include <umm_malloc/umm_malloc.h> #include <umm_malloc/umm_heap_select.h> //#define memmove_P ets_memmove char str[] = "Move over"; void setup() { WiFi.persistent(false); WiFi.mode(WIFI_OFF); Serial.begin(115200); delay(10); Serial.printf_P(PSTR("\r\nBegin ...\r\n")); { HeapSelectIram ephemeral; size_t sz = strlen(str) + 1; char *newstr = (char *)malloc(sz + 8); memcpy(newstr, str, sz); Serial.println(newstr); memmove_P(&newstr[1], newstr, sz); newstr[0] = ' '; Serial.println(newstr); free(newstr); } } void loop() {}
Prints:
Begin ... Move over MMMMMMMMMM
Works when not using IRAM or using ets_memmove with a non32-bit access handler.
Your comment about the issue: https://github.com/esp8266/Arduino/pull/7060#issuecomment-669437477
Copied over from https://github.com/esp8266/Arduino/pull/7060#issuecomment-669317101
memmove_P
does not support IRAMPrints:
Works when not using IRAM or using ets_memmove with a non32-bit access handler.
Your comment about the issue: https://github.com/esp8266/Arduino/pull/7060#issuecomment-669437477