Git Product home page Git Product logo

Comments (5)

dansiviter avatar dansiviter commented on July 18, 2024

I can't seem to get useful error information as it seems it fails badly before I can extract via a Mbed Error Hook to Serial. However, I did try mbed_get_last_error_info and it was reporting the following:

Status: 0x8003010D Value: 0xFFFFFFFE
Type: 0 Module: 3 Code: 269

Which seemingly translates to MBED_ERROR_TYPE_SYSTEM, MBED_MODULE_NETWORK_STACK and TIMEOUT but may be a red herring. Again, no idea why this would be an issue due to using Scheduler.h.

from arduinocore-mbed.

facchinm avatar facchinm commented on July 18, 2024

Hi @dansiviter ,
the problem seem to be a stack overflow; the scheduler threads override the default mbed thread stack size setting it to 1K https://github.com/arduino/ArduinoCore-mbed/blob/main/libraries/Scheduler/src/Scheduler.h#L33 .
If you increase to 4K (via Scheduler.startLoop(loop1, 4096)) everything works as expected

from arduinocore-mbed.

facchinm avatar facchinm commented on July 18, 2024

I think the best way to tackle this would be to discourage the use of Scheduler lib (which was "ported" only to allow old sketches to run "seamlessly", but provides many more ways to shoot yourself in the foot than the normal, cooperative lib)

from arduinocore-mbed.

dansiviter avatar dansiviter commented on July 18, 2024

Thanks @facchinm, that's sorted it. Unfortunately, my codebase needs to work on some MKR boards too and using Scheduler.h makes life much simpler for 3rd party libraries that like to use delay(...) far too much. Therefore, I'd suggest a multipronged approach: modify code to correct the stack size and also put a comment in to discourage usage. Happy to submit a PR if that's a suitable approach?

from arduinocore-mbed.

facchinm avatar facchinm commented on July 18, 2024

@dansiviter super, I'd love to merge such PR 😉

from arduinocore-mbed.

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.