Skip to content

Commit

Permalink
NONOS SDK clean-up (#8770)
Browse files Browse the repository at this point in the history
Remove nonos-sdk-v2.2.0-28-g89920dc aka 3v0, since we have a real v3
Remove 3.0.0...3.0.4 to reduce overhead in maintaining a bunch or binary patches
Update our docs and menu opts to mention 'experimental' status

Old versions still remains in git history, so anyone wanting to play around with 3.0.x could still make use of that work
  • Loading branch information
mcspr committed Jan 2, 2023
1 parent 3f1d608 commit 204d2c9
Show file tree
Hide file tree
Showing 94 changed files with 51 additions and 2,596 deletions.
30 changes: 3 additions & 27 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ menu.vt=VTables
menu.exception=C++ Exceptions
menu.stacksmash=Stack Protection
menu.wipe=Erase Flash
menu.sdk=Espressif FW
menu.sdk=NONOS SDK Version
menu.ssl=SSL Support
menu.mmu=MMU
menu.non32xfer=Non-32-Bit Access
Expand Down Expand Up @@ -363,19 +363,7 @@ generic.menu.sdk.nonosdk_190313=nonos-sdk 2.2.1+61 (190313)
generic.menu.sdk.nonosdk_190313.build.sdk=NONOSDK22x_190313
generic.menu.sdk.nonosdk221=nonos-sdk 2.2.1 (legacy)
generic.menu.sdk.nonosdk221.build.sdk=NONOSDK221
generic.menu.sdk.nonosdk3v0=nonos-sdk pre-3 (180626 known issues)
generic.menu.sdk.nonosdk3v0.build.sdk=NONOSDK3V0
generic.menu.sdk.nonosdk300=nonos-sdk 3.0.0
generic.menu.sdk.nonosdk300.build.sdk=NONOSDK300
generic.menu.sdk.nonosdk301=nonos-sdk 3.0.1
generic.menu.sdk.nonosdk301.build.sdk=NONOSDK301
generic.menu.sdk.nonosdk302=nonos-sdk 3.0.2
generic.menu.sdk.nonosdk302.build.sdk=NONOSDK302
generic.menu.sdk.nonosdk303=nonos-sdk 3.0.3
generic.menu.sdk.nonosdk303.build.sdk=NONOSDK303
generic.menu.sdk.nonosdk304=nonos-sdk 3.0.4
generic.menu.sdk.nonosdk304.build.sdk=NONOSDK304
generic.menu.sdk.nonosdk305=nonos-sdk 3.0.5
generic.menu.sdk.nonosdk305=nonos-sdk 3.0.5 (experimental)
generic.menu.sdk.nonosdk305.build.sdk=NONOSDK305
generic.menu.ip.lm2f=v2 Lower Memory
generic.menu.ip.lm2f.build.lwip_include=lwip2/include
Expand Down Expand Up @@ -720,19 +708,7 @@ esp8285.menu.sdk.nonosdk_190313=nonos-sdk 2.2.1+61 (190313)
esp8285.menu.sdk.nonosdk_190313.build.sdk=NONOSDK22x_190313
esp8285.menu.sdk.nonosdk221=nonos-sdk 2.2.1 (legacy)
esp8285.menu.sdk.nonosdk221.build.sdk=NONOSDK221
esp8285.menu.sdk.nonosdk3v0=nonos-sdk pre-3 (180626 known issues)
esp8285.menu.sdk.nonosdk3v0.build.sdk=NONOSDK3V0
esp8285.menu.sdk.nonosdk300=nonos-sdk 3.0.0
esp8285.menu.sdk.nonosdk300.build.sdk=NONOSDK300
esp8285.menu.sdk.nonosdk301=nonos-sdk 3.0.1
esp8285.menu.sdk.nonosdk301.build.sdk=NONOSDK301
esp8285.menu.sdk.nonosdk302=nonos-sdk 3.0.2
esp8285.menu.sdk.nonosdk302.build.sdk=NONOSDK302
esp8285.menu.sdk.nonosdk303=nonos-sdk 3.0.3
esp8285.menu.sdk.nonosdk303.build.sdk=NONOSDK303
esp8285.menu.sdk.nonosdk304=nonos-sdk 3.0.4
esp8285.menu.sdk.nonosdk304.build.sdk=NONOSDK304
esp8285.menu.sdk.nonosdk305=nonos-sdk 3.0.5
esp8285.menu.sdk.nonosdk305=nonos-sdk 3.0.5 (experimental)
esp8285.menu.sdk.nonosdk305.build.sdk=NONOSDK305
esp8285.menu.ip.lm2f=v2 Lower Memory
esp8285.menu.ip.lm2f.build.lwip_include=lwip2/include
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/core_esp8266_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ extern "C" void user_init(void) {
install_vm_exception_handler();
#endif

#if defined(NON32XFER_HANDLER) || (defined(MMU_IRAM_HEAP) && (NONOSDK < (0x30000 - 1)))
#if defined(NON32XFER_HANDLER) || (defined(MMU_IRAM_HEAP) && (NONOSDK < (0x30000)))
install_non32xfer_exception_handler();
#endif

Expand Down
10 changes: 5 additions & 5 deletions cores/esp8266/core_esp8266_non32xfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ extern "C" {

#define EXCCAUSE_LOAD_STORE_ERROR 3 /* Non 32-bit read/write error */

#if (defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP)) && (NONOSDK < (0x30000 - 1))
#if (defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP)) && (NONOSDK < (0x30000))
static fn_c_exception_handler_t old_c_handler = NULL;
#endif

#if defined(NON32XFER_HANDLER) || (defined(MMU_IRAM_HEAP) && (NONOSDK < (0x30000 - 1)))
#if defined(NON32XFER_HANDLER) || (defined(MMU_IRAM_HEAP) && (NONOSDK < (0x30000)))
static
IRAM_ATTR void non32xfer_exception_handler(struct __exception_frame *ef, [[maybe_unused]] int cause)
{
Expand Down Expand Up @@ -145,7 +145,7 @@ IRAM_ATTR void non32xfer_exception_handler(struct __exception_frame *ef, [[maybe
} while(false);

/* Fail request, die */
#if (NONOSDK < (0x30000 - 1))
#if (NONOSDK < (0x30000))
/*
The old handler points to the SDK. Be alert for HWDT when Calling with
INTLEVEL != 0. I cannot create it any more. I thought I saw this as a
Expand All @@ -170,9 +170,9 @@ IRAM_ATTR void non32xfer_exception_handler(struct __exception_frame *ef, [[maybe
abort();
#endif
}
#endif // #if defined(NON32XFER_HANDLER) || (defined(MMU_IRAM_HEAP) && (NONOSDK < (0x30000 - 1)))
#endif // #if defined(NON32XFER_HANDLER) || (defined(MMU_IRAM_HEAP) && (NONOSDK < (0x30000)))

#if (defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP)) && (NONOSDK < (0x30000 - 1))
#if (defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP)) && (NONOSDK < (0x30000))
/*
To operate reliably, this module requires the new
`_xtos_set_exception_handler` from `exc-sethandler.cpp` and
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/exc-sethandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <user_interface.h> // need NONOSDK

#if defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP) || \
defined(NEW_EXC_C_WRAPPER) || defined(MMU_EXTERNAL_HEAP) || (NONOSDK >= (0x30000 - 1))
defined(NEW_EXC_C_WRAPPER) || defined(MMU_EXTERNAL_HEAP) || (NONOSDK >= (0x30000))

/*
* The original module source code came from:
Expand Down
2 changes: 0 additions & 2 deletions cores/esp8266/heap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,6 @@ void IRAM_ATTR vPortFree(void *ptr, const char* file, int line)
try IRAM.
WPA2 Enterprise connect crashing is fixed at v3.0.2 and up.
Not used for unreleased version NONOSDK3V0.
*/
#ifdef UMM_HEAP_IRAM
void* IRAM_ATTR sdk3_pvPortMalloc(size_t size, const char* file, int line, bool iram)
Expand Down
14 changes: 1 addition & 13 deletions cores/esp8266/wpa2_eap_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,13 @@
defined(NONOSDK22x_191124) || \
defined(NONOSDK22x_190313) || \
defined(NONOSDK221) || \
defined(NONOSDK3V0) || \
defined(NONOSDK300) || \
defined(NONOSDK301) || \
defined(NONOSDK302) || \
defined(NONOSDK303) || \
defined(NONOSDK304) || \
defined(NONOSDK305)

// eap_peer_config_deinit() - For this list of SDKs there are no significant
// changes in the function. Just the line number reference for when vPortFree
// is called. When vPortFree is called, register a12 continues to hold a pointer
// to the struct StateMachine. Our cleanup routine should continue to work.
#if defined(NONOSDK300) || defined(NONOSDK301)
// Minor changes only line number changed
#define SDK_LEAK_LINE 809
#elif defined(NONOSDK302) || defined(NONOSDK303) || defined(NONOSDK304)
// Minor changes only line number changed
#define SDK_LEAK_LINE 831
#elif defined(NONOSDK305)
#if defined(NONOSDK305)
// At v3.0.5 Espressif moved `.text.eap_peer_config_deinit` to
// `eap_peer_config_deinit` then later in latest git they moved it
// back. For our linker script both are placed in flash.
Expand Down
1 change: 1 addition & 0 deletions doc/esp8266wifi/client-class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ This API frees up resources used by the connection. Consider using it instead of
*Example:*

.. code:: cpp
# define MIN_HEAP_FREE 20000 // or whatever min available heap memory convienent for your application
auto client = server.accept();
// ... do something with the client object ...
Expand Down
6 changes: 5 additions & 1 deletion doc/esp8266wifi/generic-class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ Other Function Calls
bool enableAP (bool enable)
int hostByName (const char *aHostname, IPAddress &aResult)
appeared with SDK pre-V3:
Also, when using NONOS SDK v3:

.. code:: cpp
uint8_t getListenInterval ();
bool isSleepLevelMax ();
Expand Down
22 changes: 17 additions & 5 deletions doc/ideoptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,25 @@ Erase Flash

- ``All Flash``: WiFi settings and Filesystems are erased.

Espressif Firmware
NONOS SDK Version
~~~~~~~~~~~~~~~~~~

There are a number of available espressif firmwares. The first / default
choice is fine. Only try with others after reading on the issue tracker
that something has to be tried with them. Note that Espressif obsoleted
all of them at the time of writing.
Our Core is based on [Espressif NONOS SDK](https://github.com/espressif/ESP8266_NONOS_SDK).

- **2.2.1+100 (190703)** (default)
- 2.2.1+119 (191122)
- 2.2.1+113 (191105)
- 2.2.1+111 (191024)
- 2.2.1+61 (190313)
- 2.2.1 (legacy)
- 3.0.5 (experimental)

See our issue tracker in regards to default version selection.

* `#6724 (comment) <https://github.com/esp8266/Arduino/pull/6724#issuecomment-556243781>`__
* `#6826 <https://github.com/esp8266/Arduino/pull/6826>`__

Notice that 3.x.x is provided **as-is** and remains **experimental**.

SSL Support
~~~~~~~~~~~
Expand Down
10 changes: 5 additions & 5 deletions libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ bool ESP8266WiFiGenericClass::setSleepMode(WiFiSleepType_t type, uint8_t listenI
*/

#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))

#ifdef DEBUG_ESP_WIFI
if (listenInterval && type == WIFI_NONE_SLEEP)
Expand Down Expand Up @@ -334,9 +334,9 @@ bool ESP8266WiFiGenericClass::setSleepMode(WiFiSleepType_t type, uint8_t listenI
}
}
}
#else // (NONOSDK >= (0x30000 - 1))
#else // (NONOSDK >= (0x30000))
(void)listenInterval;
#endif // (NONOSDK >= (0x30000 - 1))
#endif // (NONOSDK >= (0x30000))

bool ret = wifi_set_sleep_type((sleep_type_t) type);
if (!ret) {
Expand Down Expand Up @@ -571,7 +571,7 @@ bool ESP8266WiFiGenericClass::forceSleepWake() {
* @return interval
*/
uint8_t ESP8266WiFiGenericClass::getListenInterval () {
#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))
return wifi_get_listen_interval();
#else
return 0;
Expand All @@ -583,7 +583,7 @@ uint8_t ESP8266WiFiGenericClass::getListenInterval () {
* @return true if max level
*/
bool ESP8266WiFiGenericClass::isSleepLevelMax () {
#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))
return wifi_get_sleep_level() == MAX_SLEEP_T;
#else
return false;
Expand Down
6 changes: 3 additions & 3 deletions libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static bool sta_config_equal(const station_config& lhs, const station_config& rh
*/
static bool sta_config_equal(const station_config& lhs, const station_config& rhs) {

#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))
static_assert(sizeof(station_config) == 116, "struct station_config has changed, please update comparison function");
#else
static_assert(sizeof(station_config) == 112, "struct station_config has changed, please update comparison function");
Expand Down Expand Up @@ -94,7 +94,7 @@ static bool sta_config_equal(const station_config& lhs, const station_config& rh
return false;
}

#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))
if(lhs.open_and_wep_mode_disable != rhs.open_and_wep_mode_disable) {
return false;
}
Expand Down Expand Up @@ -166,7 +166,7 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
}

conf.threshold.rssi = -127;
#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))
conf.open_and_wep_mode_disable = !(_useInsecureWEP || *conf.password == 0);
#endif
#if (NONOSDK >= (0x30200))
Expand Down
6 changes: 3 additions & 3 deletions tests/host/common/user_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ extern "C"
config->bssid[i] = i;
config->threshold.rssi = 1;
config->threshold.authmode = AUTH_WPA_PSK;
#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))
config->open_and_wep_mode_disable = true;
#endif
#if (NONOSDK >= (0x30200))
Expand Down Expand Up @@ -215,7 +215,7 @@ extern "C"
return STATION_MODE;
}

#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))

sleep_level_t wifi_get_sleep_level(void)
{
Expand Down Expand Up @@ -271,7 +271,7 @@ extern "C"
return true;
}

#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))

bool wifi_set_sleep_level(sleep_level_t level)
{
Expand Down
16 changes: 2 additions & 14 deletions tools/boards.txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1668,19 +1668,7 @@ def sdk ():
('.menu.sdk.nonosdk_190313.build.sdk', 'NONOSDK22x_190313'),
('.menu.sdk.nonosdk221', 'nonos-sdk 2.2.1 (legacy)'),
('.menu.sdk.nonosdk221.build.sdk', 'NONOSDK221'),
('.menu.sdk.nonosdk3v0', 'nonos-sdk pre-3 (180626 known issues)'),
('.menu.sdk.nonosdk3v0.build.sdk', 'NONOSDK3V0'),
('.menu.sdk.nonosdk300', 'nonos-sdk 3.0.0'),
('.menu.sdk.nonosdk300.build.sdk', 'NONOSDK300'),
('.menu.sdk.nonosdk301', 'nonos-sdk 3.0.1'),
('.menu.sdk.nonosdk301.build.sdk', 'NONOSDK301'),
('.menu.sdk.nonosdk302', 'nonos-sdk 3.0.2'),
('.menu.sdk.nonosdk302.build.sdk', 'NONOSDK302'),
('.menu.sdk.nonosdk303', 'nonos-sdk 3.0.3'),
('.menu.sdk.nonosdk303.build.sdk', 'NONOSDK303'),
('.menu.sdk.nonosdk304', 'nonos-sdk 3.0.4'),
('.menu.sdk.nonosdk304.build.sdk', 'NONOSDK304'),
('.menu.sdk.nonosdk305', 'nonos-sdk 3.0.5'),
('.menu.sdk.nonosdk305', 'nonos-sdk 3.0.5 (experimental)'),
('.menu.sdk.nonosdk305.build.sdk', 'NONOSDK305'),
])
}
Expand Down Expand Up @@ -1757,7 +1745,7 @@ def all_boards ():
print('menu.exception=C++ Exceptions')
print('menu.stacksmash=Stack Protection')
print('menu.wipe=Erase Flash')
print('menu.sdk=Espressif FW')
print('menu.sdk=NONOS SDK Version')
print('menu.ssl=SSL Support')
print('menu.mmu=MMU')
print('menu.non32xfer=Non-32-Bit Access')
Expand Down
6 changes: 0 additions & 6 deletions tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,6 @@ def scons_patched_match_splitext(path, suffixes=None):
("SDK22x_191024", "NONOSDK22x_191024"),
("SDK22x_191105", "NONOSDK22x_191105"),
("SDK22x_191122", "NONOSDK22x_191122"),
("SDK3", "NONOSDK3V0"),
("SDK300", "NONOSDK300"),
("SDK301", "NONOSDK301"),
("SDK302", "NONOSDK302"),
("SDK303", "NONOSDK303"),
("SDK304", "NONOSDK304"),
("SDK305", "NONOSDK305"),
)
nonosdk_version = NONOSDK_VERSIONS[0]
Expand Down
20 changes: 3 additions & 17 deletions tools/sdk/include/user_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,8 @@
#ifndef __USER_INTERFACE_H__
#define __USER_INTERFACE_H__

#if defined(NONOSDK3V0)
#define NONOSDK (0x30000 - 1)
#elif defined(NONOSDK300)
#define NONOSDK (0x30000)
#elif defined(NONOSDK301)
#define NONOSDK (0x30100)
#elif defined(NONOSDK302)
#define NONOSDK (0x30200)
#elif defined(NONOSDK303)
#define NONOSDK (0x30300)
#elif defined(NONOSDK304)
#define NONOSDK (0x30400)
#elif defined(NONOSDK305)
#if defined(NONOSDK305)
#define NONOSDK (0x30500)
#elif defined(NONOSDK306)
#define NONOSDK (0x30600)
#else
#define NONOSDK (0x22100)
#endif
Expand Down Expand Up @@ -276,7 +262,7 @@ struct station_config {
// with both ssid[] and bssid[] matched. Please check about this.
uint8 bssid[6];
wifi_fast_scan_threshold_t threshold;
#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))
bool open_and_wep_mode_disable; // Can connect to open/wep router by default.
#endif
#if (NONOSDK >= (0x30200))
Expand Down Expand Up @@ -464,7 +450,7 @@ typedef enum {
MODEM_SLEEP_T
} sleep_type_t;

#if (NONOSDK >= (0x30000 - 1))
#if (NONOSDK >= (0x30000))

typedef enum {
MIN_SLEEP_T,
Expand Down
Loading

0 comments on commit 204d2c9

Please sign in to comment.