Giter Site home page Giter Site logo

Comments (6)

HamzaHajeir avatar HamzaHajeir commented on June 30, 2024 1

I've successfully built the libraries with working code, I had to deal with lwip CMakeLists.txt to include altcp sources.

I guess the missing altcp sources to CMakeLists was the source behind previous unsuccessful builds.

Thanks you for your guidance @me-no-dev.

from esp32-arduino-lib-builder.

me-no-dev avatar me-no-dev commented on June 30, 2024 1

Great!

from esp32-arduino-lib-builder.

me-no-dev avatar me-no-dev commented on June 30, 2024

Arduino adds defines like this: https://github.com/espressif/arduino-esp32/blob/release/v2.x/CMakeLists.txt#L224-L230C13
But I am not sure if it will propagate across all components, so I suggest you have a look at the build system info: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html

from esp32-arduino-lib-builder.

HamzaHajeir avatar HamzaHajeir commented on June 30, 2024

Thanks @me-no-dev for your guidance. Unfortunately haven't succeeded with solution provided.

I've tried with different methods trying to achieve the goal:
On CMakeLists.txt level:

  • add_compile_definitions()
  • add_compile_options()
  • target_compile_options() [gives a CMake error (Incompatible target).]

Other manual insertions:

  • Adding definitions at this line in build.sh (Build IDF libs section)
  • Adding the options manually in sdkconfig
  • Adding the options manually in defconfig.common

No one of them succeeded in having altcp function get compiled in liblwip.a.

However, I've found something might be important at Build System document:

image

The document shows that esp-idf isn't part of the project being built, and it comes standalone.

So really, how can I propagate a compile-flag into ESP-IDF?

Best,
Hamza

from esp32-arduino-lib-builder.

HamzaHajeir avatar HamzaHajeir commented on June 30, 2024

Navigating forward, Got some guidance how to override idf libraries; by copying the library out from idf components directory to the project's components directory.

Will inform with progress.

from esp32-arduino-lib-builder.

HamzaHajeir avatar HamzaHajeir commented on June 30, 2024

Just to keep this information until official support of ALTCP:

Enhanced the code with more stabilized ALTCP TCP mode, but with an increased Lwip stack size needed for the enhanced code.

Normal (unenhanced code), which queues a function on main loop thread on data receive for application processing, was working good, but changing to the better code (continue processing within lwip thread just ended up crashing with this decoded log:

13:04:09.160 > Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception). 

13:04:09.166 > Debug exception reason: Stack canary watchpoint triggered (tiT) 

13:04:09.172 > Core  0 register dump:

13:04:09.174 > PC      : 0x4008db4d  PS      : 0x00060036  A0      : 0x4008bfb7  A1      : 0x3ffb2340  

13:04:09.182 > A2      : 0x3ffc5644  A3      : 0x3ffc5658  A4      : 0x3ffc5658  A5      : 0x00000001  

13:04:09.190 > A6      : 0x00000000  A7      : 0x00000018  A8      : 0x3ffc564c  A9      : 0x3ffb2320  

13:04:09.198 > A10     : 0x3ffb9454  A11     : 0x3ffb9454  A12     : 0x00000014  A13     : 0x00000000  

13:04:09.206 > A14     : 0x3ffb7a28  A15     : 0x80000001  SAR     : 0x00000018  EXCCAUSE: 0x00000001  

13:04:09.213 > EXCVADDR: 0x00000000  LBEG    : 0x400894cc  LEND    : 0x400894d7  LCOUNT  : 0x00000000  

13:04:09.221 > 

13:04:09.221 > 

13:04:09.222 > Backtrace: 0x4008db4a:0x3ffb2340 0x4008bfb4:0x3ffb2370 0x4008bf64:0xa5a5a5a5 |<-CORRUPTED

13:04:09.311 > 
13:04:09.311 >   #0  0x4008db4a:0x3ffb2340 in taskSelectHighestPriorityTaskSMP at /home/hamza/arduino/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:3436

13:04:09.311 >       (inlined by) vTaskSwitchContext at /home/hamza/arduino/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:3519
13:04:09.311 >   #1  0x4008bfb4:0x3ffb2370 in _frxt_dispatch at /home/hamza/arduino/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/portasm.S:436
13:04:09.311 >   #2  0x4008bf64:0xa5a5a5a5 in _frxt_int_exit at /home/hamza/arduino/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/portasm.S:231

Which after further research, found it relates to limited lwip stack size. Thus rebuilt libraries with increased Lwip stack size of 3072 (up from 2560) and it successfully worked.

I'll inform with further notes in my progress upgrading to TLS.

from esp32-arduino-lib-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.