Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Build with -DSUPPORT_BLE on PlatformIO results in firmware that loops a reset #238

Open
3 of 10 tasks
hugonl31 opened this issue Jan 5, 2025 · 0 comments
Open
3 of 10 tasks
Labels
bug Something isn't working

Comments

@hugonl31
Copy link

hugonl31 commented Jan 5, 2025

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Have you tried with the latest version and does the problem still exist?

  • Yes, I have tried with the latest version and the problem still exists.

Current and expected behavior

Build with -DSUPPORT_BLE on PlatformIO results in firmware that loops a reset, while the same build with -DSUPPORT_BLE commented out works fine, just like your web installer. Otherwise all functionality is the same as the web installer. I have the latest version of VSCode, PlatformIO and all the dependencies. I am using your latest build and these libs:

Adafruit_NeoPixel-1.10.3
arduino-ble-gadget-historyInterval
arduino-i2c-scd4x-featureset
arduino-upt-core-0.2.0
ArduinoJson-7.0.1
ArduinoMenu-4.21.4
AsyncElegantOTA-2.2.6
AsyncTCP-master
BatterySense-1.1.1
Button2-1.6.5
canairio_sensorlib-fixOffset
ESPAsyncTCP-1.2.2
ESPAsyncWebServer-2.1.0
Improv-WiFi-Library-main
NimBLE-Arduino-1.4.0
pubsubclient-2.8
streamFlow-bf16ce89269f88d4acfd48d46e8167a5fcf0234f
Timer-1.2.1

And:

TTGO_TDISPLAY dependencies...
Platform espressif32 @ 6.9.0+sha.492d38b (required: git+https://github.com/platformio/platform-espressif32.git)
├── framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b (required: platformio/framework-arduinoespressif32 @ ~3.20017.0)
├── tool-esptoolpy @ 1.40501.0 (required: platformio/tool-esptoolpy @ ~1.40501.0)
├── tool-mkfatfs @ 2.0.1 (required: platformio/tool-mkfatfs @ ~2.0.0)
├── tool-mklittlefs @ 1.203.210628 (required: platformio/tool-mklittlefs @ ~1.203.0)
├── tool-mkspiffs @ 2.230.0 (required: platformio/tool-mkspiffs @ ~2.230.0)
└── toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5 (required: espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5)

Libraries
└── TFT_eSPI @ 2.5.43 (required: bodmer/TFT_eSPI @ ^2.5.43)

I am using your recommended AliExpress supplier for LILYGO TTGO T-DISPLAY and SCD30. I tried three different TTGOs and SCD30, all the same behavior. I tried many different libs to rule out version mismatch, but cannot find a lib collection that works successfully with BLE enabled. I tried your platformio.ini in original state, but some libs won't download, so I fetched them manually, specifically looking for the version you list.

Reproduction

Build with -DSUPPORT_BLE enabled on PlatformIO, with these libs:

Adafruit_NeoPixel-1.10.3
arduino-ble-gadget-historyInterval
arduino-i2c-scd4x-featureset
arduino-upt-core-0.2.0
ArduinoJson-7.0.1
ArduinoMenu-4.21.4
AsyncElegantOTA-2.2.6
AsyncTCP-master
BatterySense-1.1.1
Button2-1.6.5
canairio_sensorlib-fixOffset
ESPAsyncTCP-1.2.2
ESPAsyncWebServer-2.1.0
Improv-WiFi-Library-main
NimBLE-Arduino-1.4.0
pubsubclient-2.8
streamFlow-bf16ce89269f88d4acfd48d46e8167a5fcf0234f
Timer-1.2.1

Then upload TTGO_TDISPLAY to LILYGO TTGO DISPLAY with SCD30.

If applicable, add screenshots to help explain your problem

Monitor output:

18:59:02.831 > Backtrace: 0x400848bd:0x3ffe3a90 0x400950e9:0x3ffe3ab0 0x4009b035:0x3ffe3ad0 0x401c2ae7:0x3ffe3b50 0x401c2b2e:0x3ffe3b70 0x401c2a8f:0x3ffe3b90 0x401c3c03:0x3ffe3bb0 0x4011bf4a:0x3ffe3bd0 0x4011c9ac:0x3ffe3c00 0x40147edf:0x3ffe3c20 0x40083fd1:0x3ffe3c50 0x40079306:0x3ffe3c90 |<-CORRUPTED
18:59:02.861 >
18:59:02.861 >
18:59:02.861 >
18:59:02.861 >
18:59:02.861 > ELF file SHA256: bd72fff85dd88208
18:59:02.863 >
18:59:02.863 > E (767) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
18:59:02.876 > Rebooting...
18:59:02.876 > ets Jul 29 2019 12:21:46
18:59:02.879 >
18:59:02.879 > rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
18:59:02.881 > configsip: 0, SPIWP:0xee
18:59:02.881 > clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
18:59:02.892 > mode:DIO, clock div:2
18:59:02.895 > load:0x3fff0030,len:1184
18:59:02.895 > load:0x40078000,len:13232
18:59:02.896 > load:0x40080400,len:3028
18:59:02.901 > entry 0x400805e4
18:59:03.623 >
18:59:03.623 > abort() was called at PC 0x401c2ae7 on core 0

Which translates to:

0x400848bd: panic_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/panic.c:408
0x400950e9: esp_system_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/esp_system.c:137
0x4009b035: abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/abort.c:46
0x401c2ae7: __cxxabiv1::__terminate(void (*)()) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
0x401c2b2e: std::terminate() at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57
0x401c2a8f: __cxa_throw at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:95
0x401c3c03: std::__throw_out_of_range(char const*) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/src/c++11/functexcept.cc:82
0x4011bf4a: std::map, std::allocator > >::at(DataType const&) at c:\users\hugob\.platformio\packages\toolchain-xtensa-esp32\xtensa-esp32-elf\include\c++\8.4.0\bits\stl_map.h:539
0x4011bf4a: DataProvider::DataProvider(IBLELibraryWrapper&, DataType, bool, bool, bool, IWifiLibraryWrapper*) at C:\Users\hugob\Downloads\CO2-Gadget-0.014.006\lib/arduino-ble-gadget/src\DataProvider.h:57
0x4011bf4a: __static_initialization_and_destruction_0 at C:\Users\hugob\Downloads\CO2-Gadget-0.014.006\CO2_Gadget_BLE.h:12
0x4011c9ac: _GLOBAL__sub_I_hostName at C:\Users\hugob\Downloads\CO2-Gadget-0.014.006\main.cpp:694
0x40147edf: do_global_ctors at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/startup.c:201
0x40147edf: start_cpu0_default at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/startup.c:449
0x40083fd1: call_start_cpu0 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/port/cpu_start.c:687``

CO2 Gadget version

v0.14.006

Which CO2 Gadget flavour are you using?

  • Generic ESP32 without display
  • OLED
  • TFT
  • e-Ink
  • Other (please specify below)

How do you install CO2 Gadget?

  • From the web installer
  • From the source code on GitHub
  • Other (please specify below)

Possible solution

No response

@hugonl31 hugonl31 added the bug Something isn't working label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant