Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By giotherobot
#86110 Hello, I'm developing a project with a couple of custom libraries to simplify and modularize development.
I'm using the an ESP-12 mounted on a Wemos D1 board.
I'm using PlatformIO [Core 4.2.1] on VSCodium.

Code: Select allPLATFORM: Espressif 8266 2.3.3 > WeMos D1 R2 and mini
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif8266 3.20603.200130 (2.6.3)
 - tool-esptool 1.413.0 (4.13)
 - tool-esptoolpy 1.20800.0 (2.8.0)
 - toolchain-xtensa 2.40802.191122 (4.8.2)


To enable debug massages during development I thought of adding some
Code: Select all#ifdef DEBUG
and use the build_options on the platformio.ini file to enable them in some environments.
Now the problem: if I enable my DEBUG option, i.e. I insert a
Code: Select all#define DEBUG
, the compilation fail with the following error:

Code: Select allIn file included from /home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/assert.h:10:0,
                 from /home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h:459,
                 from /home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/sys/errno.h:11,
                 from /home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/errno.h:9,
                 from /home/giotherobot/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp:26:
/home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h: In function 'uint32_t pgm_read_dword_unaligned(const void*)':
/home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h:107:1: error: a15 cannot be used in asm here
 }
 ^


If i do not enble the DEBUG option I can compile without problems. Now i can use a "custom" debug define but this should not happen, right?

Thanks for your time.
User avatar
By giotherobot
#86127 Apparently the problem is NOT dependant on the #define DEBUG preprocessor line but also on setting the build_type flag to debug.

Code: Select allIn file included from /home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/sys/stdio.h:6:0,
                 from /home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/stdio.h:63,
                 from /home/giotherobot/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/4.8.2/cstdio:42,
                 from /home/giotherobot/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/4.8.2/random:39,
                 from /home/giotherobot/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/4.8.2/bits/stl_algo.h:65,
                 from /home/giotherobot/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/4.8.2/algorithm:62,
                 from /home/giotherobot/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp:27:
/home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h: In function 'uint32_t pgm_read_dword_unaligned(const void*)':
/home/giotherobot/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h:107:1: error: a15 cannot be used in asm here
 }


Here is my platformio.ini for reference:
Code: Select all[platformio]
default_envs = windSensor

[env]
platform = espressif8266
board = d1_mini
framework = arduino
lib_deps = PubSubClient
build_type = debug
debug_build_flags =
    ;-D DEBUG
    ;-D DEBUG_ESP_PORT=Serial
monitor_speed = 115200

[env:windSensor]
build_flags = -D SENSOR_WIND

[env:accelSensor]
build_flags = -D SENSOR_ACCEL

[env:strainSensor]
build_flags = -D SENSOR_STRAIN
User avatar
By giotherobot
#86128 Some more testing:
if I totally remove the debug_build_flags line it compiles successfully.

From platformio documentation it appears that the default flags added are
Code: Select all-Og -g2 -ggdb2

I'm not that expert to know what those do but it appears that adding those back along my -D DEBUG works.
User avatar
By marcmerlin
#87001 I'm having the same exact problem with the arduino environment. that is with version 2.6.3 in the arduino board manager.
details here:
https://www.reddit.com/r/esp8266/commen ... cannot_be/

2.7.1 has the same problem.
downgrading to 2.5.2 fixed the problem. This confirms it's definitely a compiler induced breakage.