platformio / platform-espressif8266

Espressif 8266: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif8266
Apache License 2.0
334 stars 219 forks source link

Non-32-bit Access Method for ESP8266 #277

Closed fsender closed 2 years ago

fsender commented 2 years ago

My new project needs a permission to access flash memory directly. On Arduino IDE, I can set this flag easily. Then I can enable byte/word access to IRAM/PROGMEM. I cannot find this flag on PlatformIO IDE.

output from my Arduino IDE when using Non-32-bit Access "Using pgm_read macros for IRAM/PROGMEM"

-fqbn=esp8266:esp8266:nodemcuv2:xtal=160,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600 -vid-pid=1A86_7523 -ide-version=10819

output from my Arduino IDE when using Non-32-bit Access "Byte/word access to IRAM/PROGMEM"

-fqbn=esp8266:esp8266:nodemcuv2:xtal=160,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=safe,eesz=4M2M,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600 -vid-pid=1A86_7523 -ide-version=10819
mcspr commented 2 years ago

Relevant fqdn option is non32xfer=safe https://github.com/esp8266/Arduino/blob/07789808b941d556f8ac1bd482342561a0e37d12/boards.txt#L81-L84 The equivalent for PIO is to use build_flags = -DNON32XFER_HANDLER

I suppose there could be yet another -DPIO_FRAMEWORK_ARDUINO_NON32XFER_HANDLER, but that request should go to the esp8266/Arduino repo plus a platform documentation update