Description
Problem Description
We recently encountered issues with the latest pre3 NONOS SDK that forced us to revert to 2.2.1, ref #5784. The issues in the NONOS sdk, and their potential solutions, are tracked there.
This issue is meant to track solving a higher-level dilemma, which is what to do about the NONOS SDK moving forward.
Espressif has explained that the NONOS SDK will be maintained for the time being, but likely not enhanced. Their plan seems to be to EOL it, as emphasis will be kept on the FreeRTOS SDK and its migration to be similar to esp-idf.
There are then several paths forward possible:
1. Migrate to NONOS SDK v3.x
Pros:
- Maintains status quo in our core as NONOS (continuity in the architecture)
- Should address the current SDK issue dilemma (sleep bug vs. stability)
- Keeps results of recent efforts to free available heap and other high profile improvements
- Potential to eventually have full control if the closed libs ever get reverse-engineered
- Buys us time (we can always change our minds and migrate to FreeRTOS later)
Cons:
- Not straightforward to migrate due to the introduction of partitions
- NONOS sdk is meant for EOL anyways, so direction is destined to be a dead end in the (possible far) future, unless the closed libs get reverse-engineered far enough
2. Migrate to a full FreeRTOS SDK (currently at v3.1)
Pros:
- Espressif seems to want to move in this direction, so support would be better than for NONOS sdk
- Availability of an underlying OS (tasks, threads, IPC, etc)
- Likely allows a better architecture design (2 contexts that are real contexts)
Cons:
- Most likely free available heap will be far less than with NONOS sdk
- Huge design effort: this SDK aims to be similar to esp-idf, but esp-idf is not well-suited for the ESP due to RAM constraints. That means that some architecture parts need to have a different design. (E.g.: too many OS tasks, and each requires its own stack and msg queue, lots of C-C++ interface points, etc)
- Huge migration effort: will require a full rewrite of a whole lot of the core code
- Probably less control over some parts, such as lwip/ssl
3. Migrate to a limited FreeRTOS SDK (no preemptive)
Pros
- May get us off NONOS SDK the fastest (or may not)
Cons:
- No guarantees of stability (in fact, the chances of a whole lot of new bugs and overall functional breakage is rather high)
- Huge effort
- We'll be on FreeRTOS, but it will be a gutted version of the OS (not real-time, cooperative, etc)
- Migrating to a full FreeRTOS architecture still means a complete rewrite of a lot of code (doing this limited migration could potentially be wasted effort)
- Likely less available heap
@d-a-v @earlephilhower @igrr and other maintainers: floor is open for discussion.
After thinking about this at length, my own preferences are as follows:
- Pursue option 1: migrate to SDK v3.x first. We can choose at a later time, once we have a stable core, to migrate to FreeRTOS, or continue on NONOS.
- Avoid option 3 at all costs. I consider it very risky with very little return, and I think that migrating to a limited version of the FreeRTOS will buy us the worst of all worlds, and at a high price at that.