diff --git a/cores/esp8266/core_esp8266_main.cpp b/cores/esp8266/core_esp8266_main.cpp index 0b0c4ddc75..9af632f49b 100644 --- a/cores/esp8266/core_esp8266_main.cpp +++ b/cores/esp8266/core_esp8266_main.cpp @@ -496,7 +496,7 @@ extern "C" void user_init(void) { install_vm_exception_handler(); #endif -#if defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP) +#if defined(NON32XFER_HANDLER) || (defined(MMU_IRAM_HEAP) && (NONOSDK < (0x30000 - 1))) install_non32xfer_exception_handler(); #endif diff --git a/cores/esp8266/core_esp8266_non32xfer.cpp b/cores/esp8266/core_esp8266_non32xfer.cpp index 5047e8de5a..e9f592db20 100644 --- a/cores/esp8266/core_esp8266_non32xfer.cpp +++ b/cores/esp8266/core_esp8266_non32xfer.cpp @@ -26,10 +26,14 @@ * Code taken directly from @pvvx's public domain code in * https://github.com/pvvx/esp8266web/blob/master/app/sdklib/system/app_main.c * + * In Espressif versions NONOSDK v3.0.0+ a similar feature was added + * load_non_32_wide_handler. Theirs is always loaded. Add weak attribute to + * theirs so we can choose by adding an alias to ours. * */ #include +#include #define VERIFY_C_ASM_EXCEPTION_FRAME_STRUCTURE #include #include @@ -58,10 +62,13 @@ 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)) static fn_c_exception_handler_t old_c_handler = NULL; +#endif +#if defined(NON32XFER_HANDLER) || (defined(MMU_IRAM_HEAP) && (NONOSDK < (0x30000 - 1))) static -IRAM_ATTR void non32xfer_exception_handler(struct __exception_frame *ef, int cause) +IRAM_ATTR void non32xfer_exception_handler(struct __exception_frame *ef, [[maybe_unused]] int cause) { do { uint32_t insn, excvaddr; @@ -138,6 +145,7 @@ IRAM_ATTR void non32xfer_exception_handler(struct __exception_frame *ef, int cau } while(false); /* Fail request, die */ +#if (NONOSDK < (0x30000 - 1)) /* 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 @@ -148,16 +156,23 @@ IRAM_ATTR void non32xfer_exception_handler(struct __exception_frame *ef, int cau old_c_handler(ef, cause); return; } - +#endif /* Calling _xtos_unhandled_exception(ef, cause) in the Boot ROM, gets us a hardware wdt. Use panic instead as a fall back. It will produce a stack trace. */ +#if defined(DEBUG_ESP_PORT) || defined(DEBUG_ESP_MMU) panic(); +#else + // For non-debug builds, save on resources + abort(); +#endif } +#endif // #if defined(NON32XFER_HANDLER) || (defined(MMU_IRAM_HEAP) && (NONOSDK < (0x30000 - 1))) +#if (defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP)) && (NONOSDK < (0x30000 - 1)) /* To operate reliably, this module requires the new `_xtos_set_exception_handler` from `exc-sethandler.cpp` and @@ -174,5 +189,17 @@ void install_non32xfer_exception_handler(void) { non32xfer_exception_handler); } } +#else +// For v3.0.x SDKs, no need for install - call_user_start will do the job. +// Need this for build dependencies +void install_non32xfer_exception_handler(void) __attribute__((weak)); +void install_non32xfer_exception_handler(void) {} +#endif + +#if defined(NON32XFER_HANDLER) +// For SDKs 3.0.x, we made load_non_32_wide_handler in +// libmain.c:user_exceptions.o a weak symbol allowing this override to work. +extern void load_non_32_wide_handler(struct __exception_frame *ef, int cause) __attribute__((alias("non32xfer_exception_handler"))); +#endif }; diff --git a/cores/esp8266/exc-sethandler.cpp b/cores/esp8266/exc-sethandler.cpp index b8f9d69a35..1b5ad2b96b 100644 --- a/cores/esp8266/exc-sethandler.cpp +++ b/cores/esp8266/exc-sethandler.cpp @@ -39,8 +39,10 @@ * architecture, I am not convinced it can be done safely. * */ +#include // need NONOSDK -#if defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP) || defined(NEW_EXC_C_WRAPPER) || defined(MMU_EXTERNAL_HEAP) +#if defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP) || \ + defined(NEW_EXC_C_WRAPPER) || defined(MMU_EXTERNAL_HEAP) || (NONOSDK >= (0x30000 - 1)) /* * The original module source code came from: diff --git a/cores/esp8266/heap.cpp b/cores/esp8266/heap.cpp index 131973ae9f..a59269bc6b 100644 --- a/cores/esp8266/heap.cpp +++ b/cores/esp8266/heap.cpp @@ -356,25 +356,25 @@ void system_show_malloc(void) void* IRAM_ATTR pvPortMalloc(size_t size, const char* file, int line) { HeapSelectDram ephemeral; - return heap_pvPortMalloc(size, file, line);; + return heap_pvPortMalloc(size, file, line);; } void* IRAM_ATTR pvPortCalloc(size_t count, size_t size, const char* file, int line) { HeapSelectDram ephemeral; - return heap_pvPortCalloc(count, size, file, line); + return heap_pvPortCalloc(count, size, file, line); } void* IRAM_ATTR pvPortRealloc(void *ptr, size_t size, const char* file, int line) { HeapSelectDram ephemeral; - return heap_pvPortRealloc(ptr, size, file, line); + return heap_pvPortRealloc(ptr, size, file, line); } void* IRAM_ATTR pvPortZalloc(size_t size, const char* file, int line) { HeapSelectDram ephemeral; - return heap_pvPortZalloc(size, file, line); + return heap_pvPortZalloc(size, file, line); } void IRAM_ATTR vPortFree(void *ptr, const char* file, int line) @@ -384,7 +384,62 @@ void IRAM_ATTR vPortFree(void *ptr, const char* file, int line) // correct context. umm_malloc free internally determines the correct heap. HeapSelectDram ephemeral; #endif - return heap_vPortFree(ptr, file, line); + return heap_vPortFree(ptr, file, line); } +#if (NONOSDK >= (0x30000)) +//////////////////////////////////////////////////////////////////////////////// +/* + New for NON-OS SDK 3.0.0 and up + Needed for WPA2 Enterprise support. This was not present in SDK pre 3.0 + + The NON-OS SDK 3.0.x has breaking changes to pvPortMalloc. They added one more + argument for selecting a heap. To avoid breaking the build, I renamed their + broken version pvEsprMalloc. To be used, the LIBS need to be edited. + + They also added pvPortZallocIram and pvPortCallocIram, which are not a + problem. + + WPA2 Enterprise connect crashing is fixed at v3.0.2 and up. + + Not used for unreleased version NONOSDK3V0. +*/ +void* IRAM_ATTR sdk3_pvPortMalloc(size_t size, const char* file, int line, bool iram) +{ + if (iram) { + HeapSelectIram ephemeral; + return heap_pvPortMalloc(size, file, line); + } else { + HeapSelectDram ephemeral; + return heap_pvPortMalloc(size, file, line); + } +} + +void* IRAM_ATTR pvPortCallocIram(size_t count, size_t size, const char* file, int line) +{ + HeapSelectIram ephemeral; + return heap_pvPortCalloc(count, size, file, line); +} + +void* IRAM_ATTR pvPortZallocIram(size_t size, const char* file, int line) +{ + HeapSelectIram ephemeral; + return heap_pvPortZalloc(size, file, line); +} + +/* + uint32_t IRAM_ATTR user_iram_memory_is_enabled(void) + { + return CONFIG_ENABLE_IRAM_MEMORY; + } + + We do not need the function user_iram_memory_is_enabled(). + 1. It was used by mem_manager.o which was replaced with this custom heap + implementation. IRAM memory selection is handled differently. + 2. In libmain.a, Cache_Read_Enable_New uses it for cache size. However, When + using IRAM for memory or running with 48K IRAM for code, we use a + replacement Cache_Read_Enable to correct the cache size ignoring + Cache_Read_Enable_New's selected value. +*/ +#endif }; diff --git a/cores/esp8266/wpa2_eap_patch.cpp b/cores/esp8266/wpa2_eap_patch.cpp index 4a49cb216c..455ff5dd9f 100644 --- a/cores/esp8266/wpa2_eap_patch.cpp +++ b/cores/esp8266/wpa2_eap_patch.cpp @@ -5,12 +5,44 @@ * modules. * */ - #include #include #include #include "coredecls.h" +#if defined(NONOSDK22x_190703) || \ + defined(NONOSDK22x_191122) || \ + defined(NONOSDK22x_191105) || \ + 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) + // 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. + #define SDK_LEAK_LINE 831 +#else + #define SDK_LEAK_LINE 799 +#endif + #ifdef DEBUG_WPA2_EAP_PATCH #include "esp8266_undocumented.h" #define DEBUG_PRINTF ets_uart_printf @@ -100,7 +132,7 @@ struct StateMachine { // size 200 bytes * same line. */ void patch_wpa2_eap_vPortFree_a12(void *ptr, const char* file, int line, void* a12) { - if (799 == line) { + if (SDK_LEAK_LINE == line) { // This caller is eap_peer_config_deinit() struct StateMachine* sm = (struct StateMachine*)a12; if (ptr == sm->config[0]) { @@ -126,21 +158,38 @@ void patch_wpa2_eap_vPortFree_a12(void *ptr, const char* file, int line, void* a } #endif } -#if 0 - // This is not needed because the call was NO-OPed in the library. This code - // snippit is just to show how a future memory free issue might be resolved. - else if (672 == line) { + +#if defined(NONOSDK300) || defined(NONOSDK301) + else if (682 == line) { // This caller is wpa2_sm_rx_eapol() // 1st of a double free // let the 2nd free handle it. return; } +#elif defined(NONOSDK302) || defined(NONOSDK303) || defined(NONOSDK304) || defined(NONOSDK305) + // It looks like double free is fixed. WPA2 Enterpise connections work + // without crashing. wpa2_sm_rx_eapol() has a few changes between NONOSDK301 + // and NONOSDK302. However, this set of releases still have memory leaks. +#else + // This is not needed because the call was NO-OPed in the library. + // Keep code snippit for reference. + // else if (672 == line) { + // // This caller is wpa2_sm_rx_eapol() + // // 1st of a double free + // // let the 2nd free handle it. + // return; + // } #endif vPortFree(ptr, file, line); } }; +#else +#error "Internal error: A new SDK has been added. This module must be updated." +#error " Need to test WPA2 Enterpise connectivity." +#endif + /* * This will minimize code space for non-wifi enterprise sketches which do not * need the patch and disable_extra4k_at_link_time(). diff --git a/doc/mmu.rst b/doc/mmu.rst index 9c3ec48acb..3846bc3f81 100644 --- a/doc/mmu.rst +++ b/doc/mmu.rst @@ -76,19 +76,28 @@ The Arduino IDE Tools menu option, ``MMU`` has the following selections: MMU related build defines and possible values. These values change as indicated with the menu options above: -+-------------------------+--------------+--------------+------------------------------------+------------------------------+ -| ``#define`` | balanced | IRAM | shared (IRAM and Heap) | not shared (IRAM and Heap) | -+=========================+==============+==============+====================================+==============================+ -| ``MMU_IRAM_SIZE`` | ``0x8000`` | ``0xC000`` | ``0xC000`` | ``0x8000`` | -+-------------------------+--------------+--------------+------------------------------------+------------------------------+ -| ``MMU_ICACHE_SIZE`` | ``0x8000`` | ``0x4000`` | ``0x4000`` | ``0x4000`` | -+-------------------------+--------------+--------------+------------------------------------+------------------------------+ -| ``MMU_IRAM_HEAP`` | -- | -- | defined, enables\ ``umm_malloc`` | -- | -+-------------------------+--------------+--------------+------------------------------------+------------------------------+ -| ``MMU_SEC_HEAP`` | -- | \*\* | \*\* | ``0x40108000`` | -+-------------------------+--------------+--------------+------------------------------------+------------------------------+ -| ``MMU_SEC_HEAP_SIZE`` | -- | \*\* | \*\* | ``0x4000`` | -+-------------------------+--------------+--------------+------------------------------------+------------------------------+ ++-------------+------------+------------+-------------+-------------+ +| ``#define`` | balanced | IRAM | shared | not shared | +| | | | (IRAM and | (IRAM and | +| | | | Heap) | Heap) | ++=============+============+============+=============+=============+ +| ``MMU_ | ``0x8000`` | ``0xC000`` | ``0xC000`` | ``0x8000`` | +| IRAM_SIZE`` | | | | | ++-------------+------------+------------+-------------+-------------+ +| ``MMU_IC | ``0x8000`` | ``0x4000`` | ``0x4000`` | ``0x4000`` | +| ACHE_SIZE`` | | | | | ++-------------+------------+------------+-------------+-------------+ +| ``MMU_ | – | – | defined, | – | +| IRAM_HEAP`` | | | e | | +| | | | nables\ ``u | | +| | | | mm_malloc`` | | ++-------------+------------+------------+-------------+-------------+ +| ``MMU | – | \*\* | \*\* | ``0 | +| _SEC_HEAP`` | | | | x40108000`` | ++-------------+------------+------------+-------------+-------------+ +| ``MMU_SEC_ | – | \*\* | \*\* | ``0x4000`` | +| HEAP_SIZE`` | | | | | ++-------------+------------+------------+-------------+-------------+ \*\* This define is to an inline function that calculates the value, based on unused code space, requires ``#include ``. @@ -112,8 +121,8 @@ The Arduino IDE Tools menu option, ``Non-32-Bit Access`` has the following selec option ``16KB cache + 48KB IRAM and 2nd Heap (shared)``. IRAM, unlike DRAM, must be accessed as aligned full 32-bit words, no -byte or short access. The pgm\_read macros are an option; however, the -store operation remains an issue. For a block copy, ets\_memcpy appears +byte or short access. The pgm_read macros are an option; however, the +store operation remains an issue. For a block copy, ets_memcpy appears to work well as long as the byte count is rounded up to be evenly divided by 4, and source and destination addresses are 4 bytes aligned. @@ -125,6 +134,11 @@ over-optimization. To get a sense of how memory access time is effected, see examples ``MMU48K`` and ``irammem`` in ``ESP8266``. +NON-OS SDK v3.0.0 and above have builtin support for Non-32-Bit Access. +Selecting ``Byte/Word access to IRAM/PROGMEM`` will override the builtin +version with ours. However, there is no known reason to do this other +than debugging. + Miscellaneous ------------- @@ -133,41 +147,43 @@ For calls to ``umm_malloc`` with interrupts disabled. - ``malloc`` will always allocate from the ``DRAM`` heap when called with interrupts disabled. -- ``realloc`` with a NULL pointer will use ``malloc`` and return a - ``DRAM`` heap allocation. Note, calling ``realloc`` with interrupts - disabled is **not** officially supported. You are on your own if you - do this. + + - ``realloc`` with a NULL pointer will use ``malloc`` and return a + ``DRAM`` heap allocation. Note, calling ``realloc`` with + interrupts disabled is **not** officially supported. You are on + your own if you do this. + - If you must use IRAM memory in your ISR, allocate the memory in your init code. To reduce the time spent in the ISR, avoid non32-bit access that would trigger the exception handler. For short or byte access, consider using the inline functions described in section - "Performance Functions" below. + “Performance Functions” below. How to Select Heap ~~~~~~~~~~~~~~~~~~ The ``MMU`` selection ``16KB cache + 48KB IRAM and 2nd Heap (shared)`` allows you to use the standard heap API function calls (``malloc``, -``calloc``, ``free``, ... ). to allocate memory from DRAM or IRAM. This +``calloc``, ``free``, … ). to allocate memory from DRAM or IRAM. This selection can be made by instantiating the class ``HeapSelectIram`` or ``HeapSelectDram``. The usage is similar to that of the ``InterruptLock`` class. The default/initial heap source is DRAM. The class is in ``umm_malloc/umm_heap_select.h``. -:: +.. code:: cpp - ... - char *bufferDram; - bufferDram = (char *)malloc(33); - char *bufferIram; - { - HeapSelectIram ephemeral; - bufferIram = (char *)malloc(33); - } - ... - free(bufferIram); - free(bufferDram); - ... + ... + char *bufferDram; + bufferDram = (char *)malloc(33); + char *bufferIram; + { + HeapSelectIram ephemeral; + bufferIram = (char *)malloc(33); + } + ... + free(bufferIram); + free(bufferDram); + ... ``free`` will always return memory to the correct heap. There is no need for tracking and selecting before freeing. @@ -182,8 +198,9 @@ Classes: - ``umm_get_current_heap_id()`` - ``umm_set_heap_by_id( ID value )`` - Possible ID values -- ``UMM_HEAP_DRAM`` -- ``UMM_HEAP_IRAM`` + + - ``UMM_HEAP_DRAM`` + - ``UMM_HEAP_IRAM`` Also, an alternate stack select method API is available. This is not as easy as the class method; however, for some small set of cases, it may @@ -201,9 +218,9 @@ a pointer: .. code:: cpp - bool mmu_is_iram(const void *addr); - bool mmu_is_dram(const void *addr); - bool mmu_is_icache(const void *addr); + bool mmu_is_iram(const void *addr); + bool mmu_is_dram(const void *addr); + bool mmu_is_icache(const void *addr); Performance Functions ~~~~~~~~~~~~~~~~~~~~~ @@ -213,23 +230,25 @@ exception handler reducing execution time and stack use, it comes at the cost of increased code size. These are an alternative to the ``pgm_read`` macros for reading from -IRAM. When compiled with 'Debug Level: core' range checks are performed +IRAM. When compiled with ‘Debug Level: core’ range checks are performed on the pointer value to make sure you are reading from the address range of IRAM, DRAM, or ICACHE. .. code:: cpp - uint8_t mmu_get_uint8(const void *p8); - uint16_t mmu_get_uint16(const uint16_t *p16); - int16_t mmu_get_int16(const int16_t *p16); + uint8_t mmu_get_uint8(const void *p8); + uint16_t mmu_get_uint16(const uint16_t *p16); + int16_t mmu_get_int16(const int16_t *p16); While these functions are intended for writing to IRAM, they will work -with DRAM. When compiled with 'Debug Level: core', range checks are +with DRAM. When compiled with ‘Debug Level: core’, range checks are performed on the pointer value to make sure you are writing to the address range of IRAM or DRAM. .. code:: cpp - uint8_t mmu_set_uint8(void *p8, const uint8_t val); - uint16_t mmu_set_uint16(uint16_t *p16, const uint16_t val); - int16_t mmu_set_int16(int16_t *p16, const int16_t val); + uint8_t mmu_set_uint8(void *p8, const uint8_t val); + uint16_t mmu_set_uint16(uint16_t *p16, const uint16_t val); + int16_t mmu_set_int16(int16_t *p16, const int16_t val); + +:: diff --git a/tools/sdk/lib/NONOSDK300/libairkiss.a b/tools/sdk/lib/NONOSDK300/libairkiss.a index cfdcc84234..60415e5242 100644 Binary files a/tools/sdk/lib/NONOSDK300/libairkiss.a and b/tools/sdk/lib/NONOSDK300/libairkiss.a differ diff --git a/tools/sdk/lib/NONOSDK300/libcrypto.a b/tools/sdk/lib/NONOSDK300/libcrypto.a index 58a30a4b7f..a9c8f472a3 100644 Binary files a/tools/sdk/lib/NONOSDK300/libcrypto.a and b/tools/sdk/lib/NONOSDK300/libcrypto.a differ diff --git a/tools/sdk/lib/NONOSDK300/libespnow.a b/tools/sdk/lib/NONOSDK300/libespnow.a index fe07ba5a20..e91d442ae2 100644 Binary files a/tools/sdk/lib/NONOSDK300/libespnow.a and b/tools/sdk/lib/NONOSDK300/libespnow.a differ diff --git a/tools/sdk/lib/NONOSDK300/libmain.a b/tools/sdk/lib/NONOSDK300/libmain.a index f0cc5b1b09..c37cbb6cd1 100644 Binary files a/tools/sdk/lib/NONOSDK300/libmain.a and b/tools/sdk/lib/NONOSDK300/libmain.a differ diff --git a/tools/sdk/lib/NONOSDK300/libnet80211.a b/tools/sdk/lib/NONOSDK300/libnet80211.a index 08d187e40c..46963e477d 100644 Binary files a/tools/sdk/lib/NONOSDK300/libnet80211.a and b/tools/sdk/lib/NONOSDK300/libnet80211.a differ diff --git a/tools/sdk/lib/NONOSDK300/libphy.a b/tools/sdk/lib/NONOSDK300/libphy.a index dfd469518e..c8a1f759f7 100644 Binary files a/tools/sdk/lib/NONOSDK300/libphy.a and b/tools/sdk/lib/NONOSDK300/libphy.a differ diff --git a/tools/sdk/lib/NONOSDK300/libpp.a b/tools/sdk/lib/NONOSDK300/libpp.a index b70496cb3c..6417871c8e 100644 Binary files a/tools/sdk/lib/NONOSDK300/libpp.a and b/tools/sdk/lib/NONOSDK300/libpp.a differ diff --git a/tools/sdk/lib/NONOSDK300/libsmartconfig.a b/tools/sdk/lib/NONOSDK300/libsmartconfig.a index 7ac84c5024..0d6258e4a2 100644 Binary files a/tools/sdk/lib/NONOSDK300/libsmartconfig.a and b/tools/sdk/lib/NONOSDK300/libsmartconfig.a differ diff --git a/tools/sdk/lib/NONOSDK300/libwpa.a b/tools/sdk/lib/NONOSDK300/libwpa.a index 9671b68843..0e69ca8cf8 100644 Binary files a/tools/sdk/lib/NONOSDK300/libwpa.a and b/tools/sdk/lib/NONOSDK300/libwpa.a differ diff --git a/tools/sdk/lib/NONOSDK300/libwpa2.a b/tools/sdk/lib/NONOSDK300/libwpa2.a index 758c588df8..c55e52c69f 100644 Binary files a/tools/sdk/lib/NONOSDK300/libwpa2.a and b/tools/sdk/lib/NONOSDK300/libwpa2.a differ diff --git a/tools/sdk/lib/NONOSDK300/libwps.a b/tools/sdk/lib/NONOSDK300/libwps.a index 37749d92b5..17fd13acf6 100644 Binary files a/tools/sdk/lib/NONOSDK300/libwps.a and b/tools/sdk/lib/NONOSDK300/libwps.a differ diff --git a/tools/sdk/lib/NONOSDK301/libairkiss.a b/tools/sdk/lib/NONOSDK301/libairkiss.a index cfdcc84234..60415e5242 100644 Binary files a/tools/sdk/lib/NONOSDK301/libairkiss.a and b/tools/sdk/lib/NONOSDK301/libairkiss.a differ diff --git a/tools/sdk/lib/NONOSDK301/libcrypto.a b/tools/sdk/lib/NONOSDK301/libcrypto.a index 3e668365ad..a9c8f472a3 100644 Binary files a/tools/sdk/lib/NONOSDK301/libcrypto.a and b/tools/sdk/lib/NONOSDK301/libcrypto.a differ diff --git a/tools/sdk/lib/NONOSDK301/libespnow.a b/tools/sdk/lib/NONOSDK301/libespnow.a index b0de6ba659..bba9708362 100644 Binary files a/tools/sdk/lib/NONOSDK301/libespnow.a and b/tools/sdk/lib/NONOSDK301/libespnow.a differ diff --git a/tools/sdk/lib/NONOSDK301/libmain.a b/tools/sdk/lib/NONOSDK301/libmain.a index 85755c3754..02059b934c 100644 Binary files a/tools/sdk/lib/NONOSDK301/libmain.a and b/tools/sdk/lib/NONOSDK301/libmain.a differ diff --git a/tools/sdk/lib/NONOSDK301/libnet80211.a b/tools/sdk/lib/NONOSDK301/libnet80211.a index 0464bcffe1..39b995b268 100644 Binary files a/tools/sdk/lib/NONOSDK301/libnet80211.a and b/tools/sdk/lib/NONOSDK301/libnet80211.a differ diff --git a/tools/sdk/lib/NONOSDK301/libphy.a b/tools/sdk/lib/NONOSDK301/libphy.a index e09c71faf3..a51c7686e5 100644 Binary files a/tools/sdk/lib/NONOSDK301/libphy.a and b/tools/sdk/lib/NONOSDK301/libphy.a differ diff --git a/tools/sdk/lib/NONOSDK301/libpp.a b/tools/sdk/lib/NONOSDK301/libpp.a index bf326fb2e1..86f8ddeaae 100644 Binary files a/tools/sdk/lib/NONOSDK301/libpp.a and b/tools/sdk/lib/NONOSDK301/libpp.a differ diff --git a/tools/sdk/lib/NONOSDK301/libsmartconfig.a b/tools/sdk/lib/NONOSDK301/libsmartconfig.a index a4499794d4..0d6258e4a2 100644 Binary files a/tools/sdk/lib/NONOSDK301/libsmartconfig.a and b/tools/sdk/lib/NONOSDK301/libsmartconfig.a differ diff --git a/tools/sdk/lib/NONOSDK301/libwpa.a b/tools/sdk/lib/NONOSDK301/libwpa.a index 88962ad6f5..0e69ca8cf8 100644 Binary files a/tools/sdk/lib/NONOSDK301/libwpa.a and b/tools/sdk/lib/NONOSDK301/libwpa.a differ diff --git a/tools/sdk/lib/NONOSDK301/libwpa2.a b/tools/sdk/lib/NONOSDK301/libwpa2.a index cd7fa425a9..c55e52c69f 100644 Binary files a/tools/sdk/lib/NONOSDK301/libwpa2.a and b/tools/sdk/lib/NONOSDK301/libwpa2.a differ diff --git a/tools/sdk/lib/NONOSDK301/libwps.a b/tools/sdk/lib/NONOSDK301/libwps.a index 22796c0fe3..17fd13acf6 100644 Binary files a/tools/sdk/lib/NONOSDK301/libwps.a and b/tools/sdk/lib/NONOSDK301/libwps.a differ diff --git a/tools/sdk/lib/NONOSDK302/libairkiss.a b/tools/sdk/lib/NONOSDK302/libairkiss.a index cfdcc84234..60415e5242 100644 Binary files a/tools/sdk/lib/NONOSDK302/libairkiss.a and b/tools/sdk/lib/NONOSDK302/libairkiss.a differ diff --git a/tools/sdk/lib/NONOSDK302/libcrypto.a b/tools/sdk/lib/NONOSDK302/libcrypto.a index c08f980fbb..a9c8f472a3 100644 Binary files a/tools/sdk/lib/NONOSDK302/libcrypto.a and b/tools/sdk/lib/NONOSDK302/libcrypto.a differ diff --git a/tools/sdk/lib/NONOSDK302/libespnow.a b/tools/sdk/lib/NONOSDK302/libespnow.a index fa194dacd4..bba9708362 100644 Binary files a/tools/sdk/lib/NONOSDK302/libespnow.a and b/tools/sdk/lib/NONOSDK302/libespnow.a differ diff --git a/tools/sdk/lib/NONOSDK302/libmain.a b/tools/sdk/lib/NONOSDK302/libmain.a index ddf235a9f5..acd80b9b22 100644 Binary files a/tools/sdk/lib/NONOSDK302/libmain.a and b/tools/sdk/lib/NONOSDK302/libmain.a differ diff --git a/tools/sdk/lib/NONOSDK302/libnet80211.a b/tools/sdk/lib/NONOSDK302/libnet80211.a index ec9b914c1e..9401588113 100644 Binary files a/tools/sdk/lib/NONOSDK302/libnet80211.a and b/tools/sdk/lib/NONOSDK302/libnet80211.a differ diff --git a/tools/sdk/lib/NONOSDK302/libphy.a b/tools/sdk/lib/NONOSDK302/libphy.a index d01d97c683..a05dccb855 100644 Binary files a/tools/sdk/lib/NONOSDK302/libphy.a and b/tools/sdk/lib/NONOSDK302/libphy.a differ diff --git a/tools/sdk/lib/NONOSDK302/libpp.a b/tools/sdk/lib/NONOSDK302/libpp.a index 411764a5df..22714f45cb 100644 Binary files a/tools/sdk/lib/NONOSDK302/libpp.a and b/tools/sdk/lib/NONOSDK302/libpp.a differ diff --git a/tools/sdk/lib/NONOSDK302/libsmartconfig.a b/tools/sdk/lib/NONOSDK302/libsmartconfig.a index b8963440aa..d6d593e87f 100644 Binary files a/tools/sdk/lib/NONOSDK302/libsmartconfig.a and b/tools/sdk/lib/NONOSDK302/libsmartconfig.a differ diff --git a/tools/sdk/lib/NONOSDK302/libwpa.a b/tools/sdk/lib/NONOSDK302/libwpa.a index 827201ad2d..3f1ffba029 100644 Binary files a/tools/sdk/lib/NONOSDK302/libwpa.a and b/tools/sdk/lib/NONOSDK302/libwpa.a differ diff --git a/tools/sdk/lib/NONOSDK302/libwpa2.a b/tools/sdk/lib/NONOSDK302/libwpa2.a index e5c5f1676d..113dcfab5c 100644 Binary files a/tools/sdk/lib/NONOSDK302/libwpa2.a and b/tools/sdk/lib/NONOSDK302/libwpa2.a differ diff --git a/tools/sdk/lib/NONOSDK302/libwps.a b/tools/sdk/lib/NONOSDK302/libwps.a index 5ee8c6b4b4..5b945c18ac 100644 Binary files a/tools/sdk/lib/NONOSDK302/libwps.a and b/tools/sdk/lib/NONOSDK302/libwps.a differ diff --git a/tools/sdk/lib/NONOSDK303/libairkiss.a b/tools/sdk/lib/NONOSDK303/libairkiss.a index cfdcc84234..60415e5242 100644 Binary files a/tools/sdk/lib/NONOSDK303/libairkiss.a and b/tools/sdk/lib/NONOSDK303/libairkiss.a differ diff --git a/tools/sdk/lib/NONOSDK303/libcrypto.a b/tools/sdk/lib/NONOSDK303/libcrypto.a index c08f980fbb..a9c8f472a3 100644 Binary files a/tools/sdk/lib/NONOSDK303/libcrypto.a and b/tools/sdk/lib/NONOSDK303/libcrypto.a differ diff --git a/tools/sdk/lib/NONOSDK303/libespnow.a b/tools/sdk/lib/NONOSDK303/libespnow.a index fa194dacd4..bba9708362 100644 Binary files a/tools/sdk/lib/NONOSDK303/libespnow.a and b/tools/sdk/lib/NONOSDK303/libespnow.a differ diff --git a/tools/sdk/lib/NONOSDK303/libmain.a b/tools/sdk/lib/NONOSDK303/libmain.a index 7215a9fef0..025870e01b 100644 Binary files a/tools/sdk/lib/NONOSDK303/libmain.a and b/tools/sdk/lib/NONOSDK303/libmain.a differ diff --git a/tools/sdk/lib/NONOSDK303/libnet80211.a b/tools/sdk/lib/NONOSDK303/libnet80211.a index ec9b914c1e..9401588113 100644 Binary files a/tools/sdk/lib/NONOSDK303/libnet80211.a and b/tools/sdk/lib/NONOSDK303/libnet80211.a differ diff --git a/tools/sdk/lib/NONOSDK303/libphy.a b/tools/sdk/lib/NONOSDK303/libphy.a index a19fd81db9..9bdb6d6448 100644 Binary files a/tools/sdk/lib/NONOSDK303/libphy.a and b/tools/sdk/lib/NONOSDK303/libphy.a differ diff --git a/tools/sdk/lib/NONOSDK303/libpp.a b/tools/sdk/lib/NONOSDK303/libpp.a index e8a46b71fb..1ef693a435 100644 Binary files a/tools/sdk/lib/NONOSDK303/libpp.a and b/tools/sdk/lib/NONOSDK303/libpp.a differ diff --git a/tools/sdk/lib/NONOSDK303/libsmartconfig.a b/tools/sdk/lib/NONOSDK303/libsmartconfig.a index b8963440aa..d6d593e87f 100644 Binary files a/tools/sdk/lib/NONOSDK303/libsmartconfig.a and b/tools/sdk/lib/NONOSDK303/libsmartconfig.a differ diff --git a/tools/sdk/lib/NONOSDK303/libwpa.a b/tools/sdk/lib/NONOSDK303/libwpa.a index 827201ad2d..3f1ffba029 100644 Binary files a/tools/sdk/lib/NONOSDK303/libwpa.a and b/tools/sdk/lib/NONOSDK303/libwpa.a differ diff --git a/tools/sdk/lib/NONOSDK303/libwpa2.a b/tools/sdk/lib/NONOSDK303/libwpa2.a index e5c5f1676d..113dcfab5c 100644 Binary files a/tools/sdk/lib/NONOSDK303/libwpa2.a and b/tools/sdk/lib/NONOSDK303/libwpa2.a differ diff --git a/tools/sdk/lib/NONOSDK303/libwps.a b/tools/sdk/lib/NONOSDK303/libwps.a index 5ee8c6b4b4..5b945c18ac 100644 Binary files a/tools/sdk/lib/NONOSDK303/libwps.a and b/tools/sdk/lib/NONOSDK303/libwps.a differ diff --git a/tools/sdk/lib/NONOSDK304/libairkiss.a b/tools/sdk/lib/NONOSDK304/libairkiss.a index cfdcc84234..60415e5242 100644 Binary files a/tools/sdk/lib/NONOSDK304/libairkiss.a and b/tools/sdk/lib/NONOSDK304/libairkiss.a differ diff --git a/tools/sdk/lib/NONOSDK304/libcrypto.a b/tools/sdk/lib/NONOSDK304/libcrypto.a index 8880b20e70..a9c8f472a3 100644 Binary files a/tools/sdk/lib/NONOSDK304/libcrypto.a and b/tools/sdk/lib/NONOSDK304/libcrypto.a differ diff --git a/tools/sdk/lib/NONOSDK304/libespnow.a b/tools/sdk/lib/NONOSDK304/libespnow.a index 822bdd6cc1..bba9708362 100644 Binary files a/tools/sdk/lib/NONOSDK304/libespnow.a and b/tools/sdk/lib/NONOSDK304/libespnow.a differ diff --git a/tools/sdk/lib/NONOSDK304/libmain.a b/tools/sdk/lib/NONOSDK304/libmain.a index 3976870297..b0bfbb8699 100644 Binary files a/tools/sdk/lib/NONOSDK304/libmain.a and b/tools/sdk/lib/NONOSDK304/libmain.a differ diff --git a/tools/sdk/lib/NONOSDK304/libnet80211.a b/tools/sdk/lib/NONOSDK304/libnet80211.a index 863a66e3fb..825a697085 100644 Binary files a/tools/sdk/lib/NONOSDK304/libnet80211.a and b/tools/sdk/lib/NONOSDK304/libnet80211.a differ diff --git a/tools/sdk/lib/NONOSDK304/libphy.a b/tools/sdk/lib/NONOSDK304/libphy.a index a19fd81db9..9bdb6d6448 100644 Binary files a/tools/sdk/lib/NONOSDK304/libphy.a and b/tools/sdk/lib/NONOSDK304/libphy.a differ diff --git a/tools/sdk/lib/NONOSDK304/libpp.a b/tools/sdk/lib/NONOSDK304/libpp.a index 4ca2dc3dc2..8bdae4b7d8 100644 Binary files a/tools/sdk/lib/NONOSDK304/libpp.a and b/tools/sdk/lib/NONOSDK304/libpp.a differ diff --git a/tools/sdk/lib/NONOSDK304/libsmartconfig.a b/tools/sdk/lib/NONOSDK304/libsmartconfig.a index b8963440aa..d6d593e87f 100644 Binary files a/tools/sdk/lib/NONOSDK304/libsmartconfig.a and b/tools/sdk/lib/NONOSDK304/libsmartconfig.a differ diff --git a/tools/sdk/lib/NONOSDK304/libwpa.a b/tools/sdk/lib/NONOSDK304/libwpa.a index 0225fbe3f6..08e69ab26e 100644 Binary files a/tools/sdk/lib/NONOSDK304/libwpa.a and b/tools/sdk/lib/NONOSDK304/libwpa.a differ diff --git a/tools/sdk/lib/NONOSDK304/libwpa2.a b/tools/sdk/lib/NONOSDK304/libwpa2.a index 9d0e892b6e..113dcfab5c 100644 Binary files a/tools/sdk/lib/NONOSDK304/libwpa2.a and b/tools/sdk/lib/NONOSDK304/libwpa2.a differ diff --git a/tools/sdk/lib/NONOSDK304/libwps.a b/tools/sdk/lib/NONOSDK304/libwps.a index c805bb8a96..5b945c18ac 100644 Binary files a/tools/sdk/lib/NONOSDK304/libwps.a and b/tools/sdk/lib/NONOSDK304/libwps.a differ diff --git a/tools/sdk/lib/NONOSDK305/libairkiss.a b/tools/sdk/lib/NONOSDK305/libairkiss.a index cfdcc84234..60415e5242 100644 Binary files a/tools/sdk/lib/NONOSDK305/libairkiss.a and b/tools/sdk/lib/NONOSDK305/libairkiss.a differ diff --git a/tools/sdk/lib/NONOSDK305/libcrypto.a b/tools/sdk/lib/NONOSDK305/libcrypto.a index 3bd8940f5d..cbb94e7552 100644 Binary files a/tools/sdk/lib/NONOSDK305/libcrypto.a and b/tools/sdk/lib/NONOSDK305/libcrypto.a differ diff --git a/tools/sdk/lib/NONOSDK305/libespnow.a b/tools/sdk/lib/NONOSDK305/libespnow.a index 650b1f1311..2d3f7a8d2b 100644 Binary files a/tools/sdk/lib/NONOSDK305/libespnow.a and b/tools/sdk/lib/NONOSDK305/libespnow.a differ diff --git a/tools/sdk/lib/NONOSDK305/libmain.a b/tools/sdk/lib/NONOSDK305/libmain.a index b4493cc19e..699b5b4b14 100644 Binary files a/tools/sdk/lib/NONOSDK305/libmain.a and b/tools/sdk/lib/NONOSDK305/libmain.a differ diff --git a/tools/sdk/lib/NONOSDK305/libnet80211.a b/tools/sdk/lib/NONOSDK305/libnet80211.a index d24cf61ecd..1edb9e5dda 100644 Binary files a/tools/sdk/lib/NONOSDK305/libnet80211.a and b/tools/sdk/lib/NONOSDK305/libnet80211.a differ diff --git a/tools/sdk/lib/NONOSDK305/libphy.a b/tools/sdk/lib/NONOSDK305/libphy.a index a19fd81db9..9bdb6d6448 100644 Binary files a/tools/sdk/lib/NONOSDK305/libphy.a and b/tools/sdk/lib/NONOSDK305/libphy.a differ diff --git a/tools/sdk/lib/NONOSDK305/libpp.a b/tools/sdk/lib/NONOSDK305/libpp.a index c987fea170..e5c86d681c 100644 Binary files a/tools/sdk/lib/NONOSDK305/libpp.a and b/tools/sdk/lib/NONOSDK305/libpp.a differ diff --git a/tools/sdk/lib/NONOSDK305/libsmartconfig.a b/tools/sdk/lib/NONOSDK305/libsmartconfig.a index b8963440aa..d6d593e87f 100644 Binary files a/tools/sdk/lib/NONOSDK305/libsmartconfig.a and b/tools/sdk/lib/NONOSDK305/libsmartconfig.a differ diff --git a/tools/sdk/lib/NONOSDK305/libwpa.a b/tools/sdk/lib/NONOSDK305/libwpa.a index c8ea191977..18b5efc3f5 100644 Binary files a/tools/sdk/lib/NONOSDK305/libwpa.a and b/tools/sdk/lib/NONOSDK305/libwpa.a differ diff --git a/tools/sdk/lib/NONOSDK305/libwpa2.a b/tools/sdk/lib/NONOSDK305/libwpa2.a index cc781f2080..a3a7a4210c 100644 Binary files a/tools/sdk/lib/NONOSDK305/libwpa2.a and b/tools/sdk/lib/NONOSDK305/libwpa2.a differ diff --git a/tools/sdk/lib/NONOSDK305/libwps.a b/tools/sdk/lib/NONOSDK305/libwps.a index 1241bef129..fe821a418d 100644 Binary files a/tools/sdk/lib/NONOSDK305/libwps.a and b/tools/sdk/lib/NONOSDK305/libwps.a differ diff --git a/tools/sdk/lib/NONOSDK3V0/libmain.a b/tools/sdk/lib/NONOSDK3V0/libmain.a index fb5242f1be..14158e4efb 100644 Binary files a/tools/sdk/lib/NONOSDK3V0/libmain.a and b/tools/sdk/lib/NONOSDK3V0/libmain.a differ diff --git a/tools/sdk/lib/README.md b/tools/sdk/lib/README.md index 6b92d04307..6e30c9a58d 100644 --- a/tools/sdk/lib/README.md +++ b/tools/sdk/lib/README.md @@ -1,8 +1,20 @@ +## Adding a new SDK library + +- Create a directory for the new SDK. +- Copy .a files from SDK `lib` directory to the new directory +- Add the new SDK directory to those supported in `eval_fix_sdks.sh` and `fix_sdk_libs.sh`. +- To support WPA2 Enterprise connections, some patches are reguired review `wpa2_eap_patch.cpp` and `eval_fix_sdks.sh` for details. +- Use `./eval_fix_sdks.sh --analyze` to aid in finding relevant differences. + - Also, you can compare two SDKs with something like `./eval_fix_sdks.sh --analyze "NONOSDK305\nNONOSDK306"` +- Apply updates to `fix_sdk_libs.sh` and `wpa2_eap_patch.cpp`. You can run `./eval_fix_sdks.sh --patch` to do a batch run of `fix_sdk_libs.sh` against each SDK. +- If you used this section, you can skip _Updating SDK libraries_. + ## Updating SDK libraries - Copy .a files from SDK `lib` directory to this directory - Run `fix_sdk_libs.sh` + ## Updating libstdc++ After building gcc using crosstool-NG, get compiled libstdc++ and remove some objects: @@ -17,4 +29,3 @@ xtensa-lx106-elf-ar d libstdc++.a del_opv.o xtensa-lx106-elf-ar d libstdc++.a new_op.o xtensa-lx106-elf-ar d libstdc++.a new_opv.o ``` - diff --git a/tools/sdk/lib/eval_fix_sdks.sh b/tools/sdk/lib/eval_fix_sdks.sh index dfbd81913e..818c9d09cd 100755 --- a/tools/sdk/lib/eval_fix_sdks.sh +++ b/tools/sdk/lib/eval_fix_sdks.sh @@ -1,6 +1,13 @@ #!/bin/bash # set -e +single_sdk="${2}" +if [[ -n "$single_sdk" ]]; then + if [[ "NONOSDK" != "${single_sdk:0:7}" ]]; then + single_sdk="" + fi +fi + add_path_ifexist() { if [[ -d $1 ]]; then export PATH=$( realpath $1 ):$PATH @@ -24,6 +31,10 @@ EOF } list_sdks() { + if [[ -n "$single_sdk" ]]; then + echo -e "$single_sdk" + return + fi cat <