ETLCPP and platformio

Hello!

I’ve been trying to use the ETLCPP (id 930) in my project for an while and I am not being able.
I already created the etl_profile.h and added it to the src folder. And it still throws several errors
while compiling. I am using an esp8266.

The only way I was capable to use this library is by downloading and adding an older version in the lib folder.

is anybody having the same issue as me?

Thank you all!

What exact errors are you getting in what source code? What board and framework are you using (platformio.ini? Which is the old version of the library that works?

I am using the nodemcuv2 with the arduino framework. At first the compiler wasn’t being able to find the etl_profile in my src folder, them I added it as a build_flag. Now it keeps requesting for the ecl_user.h

I read that the etlcpp project changed and now we(users) have to control the etl_profile file, but I don’t know how to do this correctly. I am using the last version that it was just adding this folder to the .piolibdeps (with pio install or adding to the lib_deps), I think it is the version 1.18.10

This is a copy of my platformio.ini

[env:nodemcuv2_dev]
platform = espressif8266
framework = arduino
board = nodemcuv2
upload_speed = 115200
build_flags =
  -Wl,-Tesp8266.flash.4m.ld
  -I src
  '-DLABMET_SSID="xxxxx"'
  '-DWIFI_PASSWORD="xxxxx"'
  '-DDB_ID="test_user_2"'
  '-DTOPIC="/xxxxx/"'
  '-DSTATION_UPDATE_INTERVAL=300000L'
  '-DREADING_RATE=15000L'
  '-DMESSAGE_FLASHING=1'
  '-DPROD=0'
lib_deps =
  19
  64
  83
  576
  663
  748
  930

[env:nodemcuv2_prod]
platform = espressif8266
framework = arduino
board = nodemcuv2
upload_speed = 115200
build_flags =
  -Wl,-Tesp8266.flash.4m.ld
  '-DLABMET_SSID="ttttt"'
  '-DWIFI_PASSWORD="ttttt"'
  '-DDB_ID="lmt0013"'
  '-DTOPIC="/lttttt/"'
  '-DSTATION_UPDATE_INTERVAL=300000L'
  '-DREADING_RATE=15000L'
  '-DMESSAGE_FLASHING=1'
  '-DPROD=1'
lib_deps =
  19
  64
  83
  576
  663
  748
  930

See github issue. ecl_user.h is included from the ETL library in the file ecl_timer.ht can be found in examples\ArmTimerCallbacks - C. As far as I understand it, it defines types and functions which make timers work.

Documentation of that header file is available at ecl_timer. There it also gives you an example file to use with the GCC compiler if you wish to use atomic locks (instead of interrupts).

I created a test project with the most recent version myself and ran into two other problems:

  • undefined reference to __gnu_cxx::__verbose_terminate_handler: Fixed it myself by defining it as an empty function…
  • section .text will not fit in region iram1_0_seg, no idea how to fix yet

It seems that the linker script (.platformio\packages\framework-arduinoespressif8266\tools\sdk\ld\eagle.app.v6.common.ld places a few things into instruction RAM (IRAM), of which the ESP8266 only has 32K. The .text section of the firmware.elf, which it will try to put in IRAM, for the Blink example yields 38845 Bytes in my example. Overflow.

I’ve been toying around with the linker script changing a few things from iram to irom (flash), but that didn’t help. Manually hacking the definition how much IRAM the ESP8266 has (in eagle.flash.4m1m.ld) makes it compile, but that obviously won’t work when you flash it. I don’t know exactly what it tries to put there. Biggest function in there is _Unwind_Backtrace from libgcc.a, maybe ETL causes the inclusion of that function? Use amap to check.

I’ve uploaded my test project as a zip: Dropbox - esp_test.zip - Simplify your life

Maybe you can further investigate this.