Arduino Nano ESP32 - Debug memory coruption

Hi guys,

I’m trying to indentify a memory corruption in my code. Some time it crashes after a few minutes, sometimes after a few hours.
This is the content of platformio.ini:

[env:arduino_nano_esp32]
platform = espressif32
board = arduino_nano_esp32
framework = arduino
build_type = debug
lib_deps =
  adafruit/RTClib@^2.1.3
  milesburton/DallasTemperature@^3.11.0
  ottowinter/ESPAsyncWebServer-esphome@^3.1.0
  adafruit/Adafruit BusIO@^1.15.0
  SPI
  lowpowerlab/RFM69@^1.5.2
  r3mko/ZMPT101B-Sensor@^1.0.1
build_src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/>
build_unflags = -fno-rtti
build_flags = -DCORE_DEBUG_LEVEL=0
monitor_filters =
  default
  time
  log2file
  esp32_exception_decoder

As far as I read runtime debug in not available for this configuration, also changeing the “build” flags is not possible for “arduino framework”.
I’ve alreay trtied a static analisys of the code, but nothing came up.

Using esp_core_dump_get_summary I was able to extract the following info:

00:42:48.727 > [backtrace]:Backtrace: 0x403775BA 0x4037DC41 0x40383E41 0x4037E85F 0x4208E979 0x4208EAC8 0x4209CD76 0x4209CE63 0x4208EC7C 0x42007DBB 0x42009589 0x42003117
00:42:48.728 > [backtrace]Backtrace Depth: 12
00:42:48.728 > [backtrace]Backtrace Corrupted:No#
00:42:48.728 > [backtrace]Program Counter:1077376442
00:42:48.728 > [backtrace]Coredump Version:590080
00:42:48.728 > [backtrace]Exception cause:29

Any suggestion is highly appreciated.
Thank you.

I’ve found the issue:
conncurent acces to I2C. I have multiple devices on I2C and also read/write from different tasks
=>access to I2C must be synchronized

1 Like