Error with compiling for ESP32
See original GitHub issue- PlatformIO Core. If you’ve found a bug, please provide an information below.
You can erase any parts of this template not applicable to your Issue.
Configuration
Operating system:
OSX 10.13.6
PlatformIO Version (platformio --version
):
PlatformIO on VSCode, version 5.0.0
Description of problem
I tried to compile the recent tasmota Dev Branch for the ESP32Dev Board. It stops with following Error: *** [tasmota/StackThunk_light.cpp] /Volumes/Macintosh SD/Benutzer/myUsername/Downloads/Github/Tasmota/.pioenvs/tasmota32-DE/.sconsign37.dblite: No such file or directory
Ive tried to reinstall the whole PlatformIO/VSCode stuff. Deleted the .platformio Folder end tried it again. Nothing from that Works. I also tried the 2.0.0 Framework from Espressif32
Steps to Reproduce
- Install VS Code + Platformio v5
- Download Tasmota latestDev
- Try to Build tasmota32 Enviroment
Actual Results
> Executing task: platformio run --environment tasmota32-DE <
Processing tasmota32-DE (framework: arduino; platform: espressif32@2.0.0; board: esp32dev)
----------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (2.0.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 80MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 3.10004.200129 (1.0.4)
- tool-esptoolpy 1.20800.0 (2.8.0)
- toolchain-xtensa32 2.50200.80 (5.2.0)
Converting tasmota.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 84 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP32-to-ESP8266-compat> 0.0.2
| |-- <WiFi> 1.0
| |-- <HTTPClient> 1.2
| | |-- <WiFi> 1.0
| | |-- <WiFiClientSecure> 1.0
| | | |-- <WiFi> 1.0
| |-- <WebServer> 1.0
| | |-- <WiFi> 1.0
| | |-- <FS> 1.0
| |-- <HTTPUpdate> 1.3
| | |-- <HTTPClient> 1.2
| | | |-- <WiFi> 1.0
| | | |-- <WiFiClientSecure> 1.0
| | | | |-- <WiFi> 1.0
| | |-- <Update> 1.0
| | |-- <WiFi> 1.0
|-- <WiFi> 1.0
|-- <BearSSL> 0.6
|-- <WiFiClientSecure> 1.0
| |-- <WiFi> 1.0
|-- <Adafruit CCS811 Library> 1.0.0
| |-- <Wire> 1.0.1
|-- <Adafruit MAX31865 library> 1.0.1
| |-- <SPI> 1.0
|-- <Adafruit MCP9808 Library> 1.1.2
| |-- <Wire> 1.0.1
|-- <Adafruit SGP30 Sensor> 1.2.0
| |-- <Wire> 1.0.1
|-- <Adafruit VEML7700 Library> 1.0.0
| |-- <Adafruit BusIO> 1.0.10
| | |-- <Wire> 1.0.1
| | |-- <SPI> 1.0
| |-- <Wire> 1.0.1
|-- <ESP8266Audio> 1.5.0
| |-- <SPI> 1.0
| |-- <ESP32-to-ESP8266-compat> 0.0.2
| | |-- <WiFi> 1.0
| | |-- <HTTPClient> 1.2
| | | |-- <WiFi> 1.0
| | | |-- <WiFiClientSecure> 1.0
| | | | |-- <WiFi> 1.0
| | |-- <WebServer> 1.0
| | | |-- <WiFi> 1.0
| | | |-- <FS> 1.0
| | |-- <HTTPUpdate> 1.3
| | | |-- <HTTPClient> 1.2
| | | | |-- <WiFi> 1.0
| | | | |-- <WiFiClientSecure> 1.0
| | | | | |-- <WiFi> 1.0
| | | |-- <Update> 1.0
| | | |-- <WiFi> 1.0
| |-- <HTTPClient> 1.2
| | |-- <WiFi> 1.0
| | |-- <WiFiClientSecure> 1.0
| | | |-- <WiFi> 1.0
| |-- <WiFi> 1.0
| |-- <FS> 1.0
| |-- <SPIFFS> 1.0
| | |-- <FS> 1.0
| |-- <FFat> 1.0
| | |-- <FS> 1.0
| |-- <SD(esp32)> 1.0.5
| | |-- <FS> 1.0
| | |-- <SPI> 1.0
|-- <ESP32 Mail Client> 2.1.4
| |-- <WiFi> 1.0
| |-- <HTTPClient> 1.2
| | |-- <WiFi> 1.0
| | |-- <WiFiClientSecure> 1.0
| | | |-- <WiFi> 1.0
| |-- <FS> 1.0
| |-- <SD(esp32)> 1.0.5
| | |-- <FS> 1.0
| | |-- <SPI> 1.0
| |-- <SPI> 1.0
| |-- <SPIFFS> 1.0
| | |-- <FS> 1.0
|-- <FFat> 1.0
| |-- <FS> 1.0
|-- <FS> 1.0
|-- <I2Cdevlib-Core>
| |-- <Wire> 1.0.1
|-- <LibTeleinfo> 1.1.3
|-- <I2Cdevlib-MPU6050>
| |-- <I2Cdevlib-Core>
| | |-- <Wire> 1.0.1
|-- <Mutichannel_Gas_Sensor> 0.0.1
| |-- <Wire> 1.0.1
|-- <ArduinoNTPd>
| |-- <WiFi> 1.0
|-- <OpenTherm Library> 0.9.0
|-- <SD(esp32)> 1.0.5
| |-- <FS> 1.0
| |-- <SPI> 1.0
|-- <SPIFFS> 1.0
| |-- <FS> 1.0
|-- <UdpListener> 1.0
|-- <VL53L0X> 1.0.2
| |-- <Wire> 1.0.1
|-- <C2Programmer> 1.0.0
|-- <A4988_Stepper> 0.0.1
|-- <Adafruit GFX Library> 1.5.6
| |-- <SPI> 1.0
|-- <Adafruit ILI9341> 1.2.0
| |-- <Adafruit GFX Library> 1.5.6
| | |-- <SPI> 1.0
| |-- <SPI> 1.0
|-- <Adafruit LED Backpack Library> 1.1.6
| |-- <Adafruit GFX Library> 1.5.6
| | |-- <SPI> 1.0
| |-- <Wire> 1.0.1
|-- <Adafruit_SH1106-gemu-1.0>
| |-- <Waveshare esp 2.9 inch e-paper display driver> 1.0
| | |-- <Adafruit GFX Library> 1.5.6
| | | |-- <SPI> 1.0
| | |-- <SPI> 1.0
| |-- <Wire> 1.0.1
|-- <Adafruit SSD1306> 1.3.0
| |-- <Adafruit GFX Library> 1.5.6
| | |-- <SPI> 1.0
| |-- <SPI> 1.0
| |-- <Wire> 1.0.1
| |-- <Waveshare esp 2.9 inch e-paper display driver> 1.0
| | |-- <Adafruit GFX Library> 1.5.6
| | | |-- <SPI> 1.0
| | |-- <SPI> 1.0
|-- <Adafruit_TSL2591_Library>
| |-- <Wire> 1.0.1
|-- <ArduinoJson> 5.13.4
|-- <ArduinoOTA> 1.0
| |-- <Update> 1.0
| |-- <WiFi> 1.0
| |-- <ESPmDNS> 1.0
| | |-- <WiFi> 1.0
|-- <Arduino ST7789 Library> 0.9.5
| |-- <Adafruit GFX Library> 1.5.6
| | |-- <SPI> 1.0
| |-- <Waveshare esp 2.9 inch e-paper display driver> 1.0
| | |-- <Adafruit GFX Library> 1.5.6
| | | |-- <SPI> 1.0
| | |-- <SPI> 1.0
| |-- <SPI> 1.0
|-- <DNSServer> 1.1.0
| |-- <WiFi> 1.0
|-- <ESP8266SAM> 1.0
| |-- <ESP8266Audio> 1.5.0
| | |-- <SPI> 1.0
| | |-- <ESP32-to-ESP8266-compat> 0.0.2
| | | |-- <WiFi> 1.0
| | | |-- <HTTPClient> 1.2
| | | | |-- <WiFi> 1.0
| | | | |-- <WiFiClientSecure> 1.0
| | | | | |-- <WiFi> 1.0
| | | |-- <WebServer> 1.0
| | | | |-- <WiFi> 1.0
| | | | |-- <FS> 1.0
| | | |-- <HTTPUpdate> 1.3
| | | | |-- <HTTPClient> 1.2
| | | | | |-- <WiFi> 1.0
| | | | | |-- <WiFiClientSecure> 1.0
| | | | | | |-- <WiFi> 1.0
| | | | |-- <Update> 1.0
| | | | |-- <WiFi> 1.0
| | |-- <HTTPClient> 1.2
| | | |-- <WiFi> 1.0
| | | |-- <WiFiClientSecure> 1.0
| | | | |-- <WiFi> 1.0
| | |-- <WiFi> 1.0
| | |-- <FS> 1.0
| | |-- <SPIFFS> 1.0
| | | |-- <FS> 1.0
| | |-- <FFat> 1.0
| | | |-- <FS> 1.0
| | |-- <SD(esp32)> 1.0.5
| | | |-- <FS> 1.0
| | | |-- <SPI> 1.0
|-- <ESP32 Ethernet> 1.1.0
| |-- <WiFi> 1.0
|-- <AT24C256>
| |-- <Wire> 1.0.1
|-- <FT5206_Library> 1.0.0
| |-- <Wire> 1.0.1
|-- <FrogmoreScd30>
| |-- <Wire> 1.0.1
| |-- <ESP32-to-ESP8266-compat> 0.0.2
| | |-- <WiFi> 1.0
| | |-- <HTTPClient> 1.2
| | | |-- <WiFi> 1.0
| | | |-- <WiFiClientSecure> 1.0
| | | | |-- <WiFi> 1.0
| | |-- <WebServer> 1.0
| | | |-- <WiFi> 1.0
| | | |-- <FS> 1.0
| | |-- <HTTPUpdate> 1.3
| | | |-- <HTTPClient> 1.2
| | | | |-- <WiFi> 1.0
| | | | |-- <WiFiClientSecure> 1.0
| | | | | |-- <WiFi> 1.0
| | | |-- <Update> 1.0
| | | |-- <WiFi> 1.0
|-- <ILI9488> 1.0.2
| |-- <Waveshare esp 2.9 inch e-paper display driver> 1.0
| | |-- <Adafruit GFX Library> 1.5.6
| | | |-- <SPI> 1.0
| | |-- <SPI> 1.0
| |-- <SPI> 1.0
|-- <IRremoteESP8266> 2.7.10
| |-- <ESP32-to-ESP8266-compat> 0.0.2
| | |-- <WiFi> 1.0
| | |-- <HTTPClient> 1.2
| | | |-- <WiFi> 1.0
| | | |-- <WiFiClientSecure> 1.0
| | | | |-- <WiFi> 1.0
| | |-- <WebServer> 1.0
| | | |-- <WiFi> 1.0
| | | |-- <FS> 1.0
| | |-- <HTTPUpdate> 1.3
| | | |-- <HTTPClient> 1.2
| | | | |-- <WiFi> 1.0
| | | | |-- <WiFiClientSecure> 1.0
| | | | | |-- <WiFi> 1.0
| | | |-- <Update> 1.0
| | | |-- <WiFi> 1.0
|-- <KeeloqLib> 1.1
|-- <LOLIN_HP303B> 1.0.0
| |-- <SPI> 1.0
| |-- <Wire> 1.0.1
|-- <LinkedList>
|-- <LiquidCrystal_I2C>
| |-- <Wire> 1.0.1
|-- <NeoPixelBus> 2.5.0
| |-- <SPI> 1.0
| |-- <ESP32-to-ESP8266-compat> 0.0.2
| | |-- <WiFi> 1.0
| | |-- <HTTPClient> 1.2
| | | |-- <WiFi> 1.0
| | | |-- <WiFiClientSecure> 1.0
| | | | |-- <WiFi> 1.0
| | |-- <WebServer> 1.0
| | | |-- <WiFi> 1.0
| | | |-- <FS> 1.0
| | |-- <HTTPUpdate> 1.3
| | | |-- <HTTPClient> 1.2
| | | | |-- <WiFi> 1.0
| | | | |-- <WiFiClientSecure> 1.0
| | | | | |-- <WiFi> 1.0
| | | |-- <Update> 1.0
| | | |-- <WiFi> 1.0
|-- <NewPing> 1.9.1
|-- <NimBLE-Arduino> 0.9.0
|-- <PubSubClient> 2.7
|-- <RA8876> 1.0.2
| |-- <SPI> 1.0
| |-- <Waveshare esp 2.9 inch e-paper display driver> 1.0
| | |-- <Adafruit GFX Library> 1.5.6
| | | |-- <SPI> 1.0
| | |-- <SPI> 1.0
|-- <rc-switch> 2.6.2
|-- <RF24> 1.3.3
| |-- <SPI> 1.0
|-- <SPI> 1.0
|-- <SSD3115> 1.0
| |-- <Waveshare esp 2.9 inch e-paper display driver> 1.0
| | |-- <Adafruit GFX Library> 1.5.6
| | | |-- <SPI> 1.0
| | |-- <SPI> 1.0
| |-- <SPI> 1.0
|-- <TasmotaModbus> 1.2.0
| |-- <TasmotaSerial> 3.1.0
| | |-- <ESP32-to-ESP8266-compat> 0.0.2
| | | |-- <WiFi> 1.0
| | | |-- <HTTPClient> 1.2
| | | | |-- <WiFi> 1.0
| | | | |-- <WiFiClientSecure> 1.0
| | | | | |-- <WiFi> 1.0
| | | |-- <WebServer> 1.0
| | | | |-- <WiFi> 1.0
| | | | |-- <FS> 1.0
| | | |-- <HTTPUpdate> 1.3
| | | | |-- <HTTPClient> 1.2
| | | | | |-- <WiFi> 1.0
| | | | | |-- <WiFiClientSecure> 1.0
| | | | | | |-- <WiFi> 1.0
| | | | |-- <Update> 1.0
| | | | |-- <WiFi> 1.0
|-- <TasmotaSerial> 3.1.0
| |-- <ESP32-to-ESP8266-compat> 0.0.2
| | |-- <WiFi> 1.0
| | |-- <HTTPClient> 1.2
| | | |-- <WiFi> 1.0
| | | |-- <WiFiClientSecure> 1.0
| | | | |-- <WiFi> 1.0
| | |-- <WebServer> 1.0
| | | |-- <WiFi> 1.0
| | | |-- <FS> 1.0
| | |-- <HTTPUpdate> 1.3
| | | |-- <HTTPClient> 1.2
| | | | |-- <WiFi> 1.0
| | | | |-- <WiFiClientSecure> 1.0
| | | | | |-- <WiFi> 1.0
| | | |-- <Update> 1.0
| | | |-- <WiFi> 1.0
|-- <Ticker> 1.1
|-- <Joba_Tsl2561> 2.0.10
| |-- <Wire> 1.0.1
|-- <Wire> 1.0.1
|-- <TTGO TWatch Library> 1.2.0
| |-- <Wire> 1.0.1
|-- <base64> 1.1.1
|-- <BME680_driver-bme680_v3.5.9>
|-- <Waveshare esp 2.9 inch e-paper display driver> 1.0
| |-- <Adafruit GFX Library> 1.5.6
| | |-- <SPI> 1.0
| |-- <SPI> 1.0
|-- <ESP KNX IP Library> 0.5.2
| |-- <EEPROM> 1.0.3
| |-- <ESP32-to-ESP8266-compat> 0.0.2
| | |-- <WiFi> 1.0
| | |-- <HTTPClient> 1.2
| | | |-- <WiFi> 1.0
| | | |-- <WiFiClientSecure> 1.0
| | | | |-- <WiFi> 1.0
| | |-- <WebServer> 1.0
| | | |-- <WiFi> 1.0
| | | |-- <FS> 1.0
| | |-- <HTTPUpdate> 1.3
| | | |-- <HTTPClient> 1.2
| | | | |-- <WiFi> 1.0
| | | | |-- <WiFiClientSecure> 1.0
| | | | | |-- <WiFi> 1.0
| | | |-- <Update> 1.0
| | | |-- <WiFi> 1.0
| |-- <WiFi> 1.0
|-- <HPMA115S0 Arduino Library> 1.0.0
|-- <Unishox Compressor Decompressor highly customized and optimized for ESP8266 and Tasmota> 1.0
Building in release mode
*** use provided user_config_override.h as planned ***
*** [tasmota/StackThunk_light.cpp] /Volumes/Macintosh SD/Benutzer/myUsername/Downloads/Github/Tasmota/.pioenvs/tasmota32-DE/.sconsign37.dblite: No such file or directory
===================================================== [FAILED] Took 15.23 seconds =====================================================
Environment Status Duration
------------- -------- ------------
tasmota32-DE FAILED 00:00:15.233
================================================ 1 failed, 0 succeeded in 00:00:15.233 ================================================
The terminal process "platformio 'run', '--environment', 'tasmota32-DE'" terminated with exit code: 1.
Expected Results
Building a working file.
If problems with PlatformIO Build System:
The content of platformio.ini
:
Platformio.ini:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter, extra scripting
; Upload options: custom port, speed and extra flags
; Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/en/stable/projectconf.html
[platformio]
description = Provide ESP8266 based devices with Web, MQTT and OTA firmware
src_dir = tasmota
build_dir = .pioenvs
workspace_dir = .pioenvs
build_cache_dir = .cache
extra_configs = platformio_tasmota32.ini
platformio_tasmota_env.ini
platformio_tasmota_env32.ini
platformio_override.ini
; *** Build/upload environment
default_envs =
; *** Uncomment by deleting ";" in the line(s) below to select version(s)
; tasmota
; tasmota-ircustom
; tasmota-minimal
; tasmota-lite
; tasmota-knx
; tasmota-sensors
; tasmota-display
; tasmota-zbbridge
; tasmota-ir
; tasmota-BG
; tasmota-BR
; tasmota-CN
; tasmota-CZ
; tasmota-DE
; tasmota-ES
; tasmota-FR
; tasmota-GR
; tasmota-HE
; tasmota-HU
; tasmota-IT
; tasmota-KO
; tasmota-NL
; tasmota-PL
; tasmota-PT
; tasmota-RO
; tasmota-RU
; tasmota-SE
; tasmota-SK
; tasmota-TR
; tasmota-TW
; tasmota-UK
;
; *** alternatively can be done in: platformio_override.ini
; *** See example: platformio_override_sample.ini
; *********************************************************************
[common]
framework = arduino
board = esp01_1m
board_build.flash_mode = dout
board_build.ldscript = eagle.flash.1m.ld
platform = ${core.platform}
platform_packages = ${core.platform_packages}
build_unflags = ${core.build_unflags}
build_flags = ${core.build_flags}
board_build.f_cpu = 80000000L
board_build.f_flash = 40000000L
monitor_speed = 115200
upload_speed = 115200
; *** Upload Serial reset method for Wemos and NodeMCU
upload_resetmethod = nodemcu
upload_port = COM5
extra_scripts = ${scripts_defaults.extra_scripts}
[scripts_defaults]
extra_scripts = pio/strip-floats.py
pio/name-firmware.py
pio/gzip-firmware.py
pio/override_copy.py
[esp_defaults]
; *** remove undesired all warnings
build_unflags = -Wall
-Wdeprecated-declarations
build_flags = -Wno-deprecated-declarations
-D_IR_ENABLE_DEFAULT_=false
-DDECODE_HASH=true -DDECODE_NEC=true -DSEND_NEC=true
-DDECODE_RC5=true -DSEND_RC5=true -DDECODE_RC6=true -DSEND_RC6=true
; new mechanism to set the IRremoteESP8266 supported protocols: none except HASH, NEC, RC5, RC6
; *********************************************************************
; *** Use custom settings from file user_config_override.h
-DUSE_CONFIG_OVERRIDE
; *********************************************************************
[esp82xx_defaults]
build_flags = ${esp_defaults.build_flags}
-Wl,-Map,firmware.map
-D CORE_DEBUG_LEVEL=0
-D NDEBUG
-mtarget-align
-DFP_IN_IROM
-DBEARSSL_SSL_BASIC
; NONOSDK22x_190703 = 2.2.2-dev(38a443e)
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703
; lwIP 2 - Higher Bandwidth no Features
-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
; VTABLES in Flash
-DVTABLES_IN_FLASH
; remove the 4-bytes alignment for PSTR()
-DPSTR_ALIGN=1
; restrict to minimal mime-types
-DMIMETYPE_MINIMAL
[irremoteesp_full]
build_flags = -DUSE_IR_REMOTE_FULL
-U_IR_ENABLE_DEFAULT_
-DDECODE_PRONTO=false -DSEND_PRONTO=false
[core]
; *** Esp8266 Tasmota modified Arduino core based on core 2.7.4
platform = espressif8266@2.6.2
platform_packages = jason2866/framework-arduinoespressif8266
build_unflags = ${esp_defaults.build_unflags}
build_flags = ${esp82xx_defaults.build_flags}
Platformio_tasmota32.ini:
; *** BETA ESP32 Tasmota version ***
; *** expect the unexpected. Some features not working!!! ***
[common32]
platform = espressif32@2.0.0
platform_packages = tool-esptoolpy@1.20800.0
board = esp32dev
board_build.ldscript = esp32_out.ld
board_build.partitions = esp32_partition_app1984k_spiffs64k.csv
board_build.flash_mode = ${common.board_build.flash_mode}
board_build.f_flash = ${common.board_build.f_flash}
board_build.f_cpu = ${common.board_build.f_cpu}
build_unflags = ${esp_defaults.build_unflags}
-Wpointer-arith
monitor_speed = ${common.monitor_speed}
upload_port = ${common.upload_port}
upload_resetmethod = ${common.upload_resetmethod}
upload_speed = 921600
extra_scripts = ${common.extra_scripts}
build_flags = ${esp_defaults.build_flags}
-D CORE_DEBUG_LEVEL=0
-D BUFFER_LENGTH=128
-D MQTT_MAX_PACKET_SIZE=1200
-D uint32=uint32_t
-D uint16=uint16_t
-D uint8=uint8_t
-D sint8_t=int8_t
-D sint32_t=int32_t
-D sint16_t=int16_t
-D memcpy_P=memcpy
-D memcmp_P=memcmp
lib_extra_dirs =
libesp32
lib_ignore =
cc1101
Source file to reproduce issue:
/*
StackThunk_light.c - Allow use second stack for BearSSL calls
Light version with reduced Stack size due to Tasmota optimizations.
BearSSL uses a significant amount of stack space, much larger than
the default Arduino core stack. These routines handle swapping
between a secondary, user-allocated stack on the heap and the real
stack.
Copyright (c) 2017 Earle F. Philhower, III. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)
*/
#include "my_user_config.h"
#include <stdint.h>
#include <stdlib.h>
#include "StackThunk_light.h"
#include <ets_sys.h>
extern "C" {
uint32_t *stack_thunk_light_ptr = NULL;
uint32_t *stack_thunk_light_top = NULL;
uint32_t *stack_thunk_light_save = NULL; /* Saved A1 while in BearSSL */
uint32_t stack_thunk_light_refcnt = 0;
//#define _stackSize (5600/4)
#ifdef USE_MQTT_TLS_FORCE_EC_CIPHER
#define _stackSize (5300/4) // using a light version of bearssl we can save 300 bytes
#else
#define _stackSize (3600/4) // using a light version of bearssl we can save 2k
#endif
#define _stackPaint 0xdeadbeef
/* Add a reference, and allocate the stack if necessary */
void stack_thunk_light_add_ref()
{
stack_thunk_light_refcnt++;
if (stack_thunk_light_refcnt == 1) {
stack_thunk_light_ptr = (uint32_t *)malloc(_stackSize * sizeof(uint32_t));
stack_thunk_light_top = stack_thunk_light_ptr + _stackSize - 1;
stack_thunk_light_save = NULL;
stack_thunk_light_repaint();
}
}
/* Drop a reference, and free stack if no more in use */
void stack_thunk_light_del_ref()
{
if (stack_thunk_light_refcnt == 0) {
/* Error! */
return;
}
stack_thunk_light_refcnt--;
if (!stack_thunk_light_refcnt) {
free(stack_thunk_light_ptr);
stack_thunk_light_ptr = NULL;
stack_thunk_light_top = NULL;
stack_thunk_light_save = NULL;
}
}
void stack_thunk_light_repaint()
{
if (stack_thunk_light_ptr) {
for (int i=0; i < _stackSize; i++) {
stack_thunk_light_ptr[i] = _stackPaint;
}
}
}
/* Simple accessor functions used by postmortem */
uint32_t stack_thunk_light_get_refcnt() {
return stack_thunk_light_refcnt;
}
uint32_t stack_thunk_light_get_stack_top() {
return (uint32_t)stack_thunk_light_top;
}
uint32_t stack_thunk_light_get_stack_bot() {
return (uint32_t)stack_thunk_light_ptr;
}
uint32_t stack_thunk_light_get_cont_sp() {
return (uint32_t)stack_thunk_light_save;
}
/* Return the number of bytes ever used since the stack was created */
uint32_t stack_thunk_light_get_max_usage()
{
uint32_t cnt = 0;
/* No stack == no usage by definition! */
if (!stack_thunk_light_ptr) {
return 0;
}
for (cnt=0; (cnt < _stackSize) && (stack_thunk_light_ptr[cnt] == _stackPaint); cnt++) {
/* Noop, all work done in for() */
}
return 4 * (_stackSize - cnt);
}
/* Print the stack from the first used 16-byte chunk to the top, decodable by the exception decoder */
void stack_thunk_light_dump_stack()
{
uint32_t *pos = stack_thunk_light_top;
while (pos < stack_thunk_light_ptr) {
if ((pos[0] != _stackPaint) || (pos[1] != _stackPaint) || (pos[2] != _stackPaint) || (pos[3] != _stackPaint))
break;
pos += 4;
}
ets_printf(">>>stack>>>\n");
while (pos < stack_thunk_light_ptr) {
ets_printf("%08x: %08x %08x %08x %08x\n", (int32_t)pos, pos[0], pos[1], pos[2], pos[3]);
pos += 4;
}
ets_printf("<<<stack<<<\n");
}
/* Called when the stack overflow is detected by a thunk. Main memory is corrupted at this point. Do not return. */
void stack_thunk_light_fatal_overflow()
{
ets_printf("FATAL ERROR: BSSL stack overflow\n");
abort();
}
};
Additional info
Related issue from Tasmota issues: https://github.com/arendst/Tasmota/issues/9254
Issue Analytics
- State:
- Created 3 years ago
- Comments:22 (8 by maintainers)
This issue presents for any OS, not only macOS. Great that we found a problem.
Thanks, @kugelkopf123, for the remote session that helped to debug this issue and, @Jason2866, for the fix.
I could reproduce this issue. The problem is linked with invalid
platformio.ini
.build_dir
is a child ofworkspace_dir
, where you forced everything to 1 folder. PlatformIO checks for project modification and removedbuild_dir
on changes. As result, it REMOVES EVERYTHING, including installed dependencies. They also are part ofworkspace_dir
. I meanlib_deps
. This causes PlatformIO IDE to rebuild IntelliSense Index every time becauselib_deps
modifies every time.P.S: I removed
workspace_dir = .pioenvs
and now everything works. The question, why do you override the default build and workspace folders? Do we have a problem with PlatformIO Core?